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
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 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: .. _port-forwarding:

View File

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