clean: remove unused vars from operator.py

doc: carry on hosting guide
This commit is contained in:
Swann 2020-06-22 17:25:44 +02:00
parent b1ccbf72f3
commit 8ddb86556d
No known key found for this signature in database
GPG Key ID: 5E0D936BD280E963
3 changed files with 13 additions and 15 deletions

View File

@ -29,7 +29,8 @@ In order grant server access to people from internet you have tow main option:
Using a connection sharing solution
-----------------------------------
1. Simple: use a third party software like `HAMACHI <https://vpn.net/>`_ (Free until 5 users) or `ZEROTIER <https://www.zerotier.com/download/>`_ to handle network sharing.
Many different third party software like `ZEROTIER <https://www.zerotier.com/download/>`_ (Free) or `HAMACHI <https://vpn.net/>`_ (Free until 5 users) allow you to share your private network with other peole.
For the example I'm gonna use ZeroTier because it (free and open soure).
.. _port-forwarding:

@ -1 +1 @@
Subproject commit 7f9d5bfc3f60b1d9c79e380ff49864d47cde55f2
Subproject commit d24f92f78666a62aed52fe19a8e4f00f791f34a0

View File

@ -43,10 +43,8 @@ from .libs.replication.replication.interface import Session
client = None
delayables = []
ui_context = None
stop_modal_executor = False
modal_executor_queue = None
server_process = None
def unregister_delayables():
@ -75,19 +73,19 @@ class SessionStartOperator(bpy.types.Operator):
return True
def execute(self, context):
global client, delayables, ui_context, server_process
global client, delayables
settings = utils.get_preferences()
runtime_settings = context.window_manager.session
users = bpy.data.window_managers['WinMan'].online_users
admin_pass = runtime_settings.password
# TODO: Sync server clients
unregister_delayables()
users.clear()
delayables.clear()
client = None
bpy_factory = ReplicatedDataFactory()
supported_bl_types = []
ui_context = context.copy()
# init the factory with supported types
for type in bl_types.types_to_register():
@ -107,9 +105,10 @@ class SessionStartOperator(bpy.types.Operator):
automatic=type_local_config.auto_push)
if type_local_config.bl_delay_apply > 0:
delayables.append(delayable.ApplyTimer(
timout=type_local_config.bl_delay_apply,
target_type=type_module_class))
delayables.append(
delayable.ApplyTimer(
timout=type_local_config.bl_delay_apply,
target_type=type_module_class))
client = Session(
factory=bpy_factory,
@ -152,8 +151,8 @@ class SessionStartOperator(bpy.types.Operator):
password=admin_pass
)
except Exception as e:
self.report({'ERROR'}, repr(e))
logging.error(f"Error: {e}")
self.report({'ERROR'}, str(e))
logging.error(str(e))
# Background client updates service
#TODO: Refactoring
@ -238,8 +237,6 @@ class SessionStopOperator(bpy.types.Operator):
client.disconnect()
except Exception as e:
self.report({'ERROR'}, repr(e))
except zmq.ZMQError:
self.report("A client is already connected (Could be a bug). \n Retry after closing any blender instance from your task manager.")
return {"FINISHED"}