fix: remove logging.info

This commit is contained in:
Fabian 2021-07-23 17:10:10 +02:00
parent 0a798bb21b
commit 59aab7159a
2 changed files with 8 additions and 10 deletions

View File

@ -1084,13 +1084,11 @@ class RefreshServerStatus(bpy.types.Operator):
settings = utils.get_preferences() settings = utils.get_preferences()
for server in settings.server_preset: for server in settings.server_preset:
infos = porcelain.request_session_info(f"{server.ip}:{server.port}", timeout=1000) infos = porcelain.request_session_info(f"{server.ip}:{server.port}", timeout=500) # TODO: timeout in a settings
server.is_online = True if infos else False server.is_online = True if infos else False
if server.is_online: if server.is_online:
server.is_private = infos.get("private") server.is_private = infos.get("private")
logging.info(f"{server.server_name} status: {infos}")
return {'FINISHED'} return {'FINISHED'}
class GetDoc(bpy.types.Operator): class GetDoc(bpy.types.Operator):
@ -1123,8 +1121,7 @@ class FirstLaunch(bpy.types.Operator):
assert(context) assert(context)
settings = utils.get_preferences() settings = utils.get_preferences()
settings.is_first_launch = False settings.is_first_launch = False
for i in range(len(settings.server_preset)): # TODO: Try to empty the server list preset in a cleaner way settings.server_preset.clear()
settings.server_preset.remove(i)
prefs = bpy.context.preferences.addons[__package__].preferences prefs = bpy.context.preferences.addons[__package__].preferences
prefs.generate_default_presets() prefs.generate_default_presets()
return {'FINISHED'} return {'FINISHED'}

View File

@ -113,7 +113,7 @@ class ReplicatedDatablock(bpy.types.PropertyGroup):
class ServerPreset(bpy.types.PropertyGroup): class ServerPreset(bpy.types.PropertyGroup):
server_name: bpy.props.StringProperty(default="") server_name: bpy.props.StringProperty(default="")
ip: bpy.props.StringProperty(default="127.0.0.1") ip: bpy.props.StringProperty(default="127.0.0.1", update=update_ip)
port: bpy.props.IntProperty(default=5555) port: bpy.props.IntProperty(default=5555)
use_server_password: bpy.props.BoolProperty(default=False) use_server_password: bpy.props.BoolProperty(default=False)
server_password: bpy.props.StringProperty(default="", subtype = "PASSWORD") server_password: bpy.props.StringProperty(default="", subtype = "PASSWORD")
@ -191,12 +191,12 @@ class SessionPrefs(bpy.types.AddonPreferences):
name="server_index", name="server_index",
description="index of the server", description="index of the server",
) )
# User host session settings
host_port: bpy.props.IntProperty( host_port: bpy.props.IntProperty(
name="host_port", name="host_port",
description='Distant host port', description='Distant host port',
default=5555 default=5555
) )
# User host session settings
host_use_server_password: bpy.props.BoolProperty( host_use_server_password: bpy.props.BoolProperty(
name="use_server_password", name="use_server_password",
description='Use session password', description='Use session password',
@ -210,16 +210,17 @@ class SessionPrefs(bpy.types.AddonPreferences):
host_use_admin_password: bpy.props.BoolProperty( host_use_admin_password: bpy.props.BoolProperty(
name="use_admin_password", name="use_admin_password",
description='Use admin password', description='Use admin password',
default=False default=True
) )
host_admin_password: bpy.props.StringProperty( host_admin_password: bpy.props.StringProperty(
name="admin_password", name="admin_password",
description='Admin password', description='Admin password',
subtype='PASSWORD' subtype='PASSWORD',
default='admin'
) )
# Other # Other
is_first_launch: bpy.props.BoolProperty( is_first_launch: bpy.props.BoolProperty(
name="is_first_launch", name="is_fnirst_launch",
description="First time lauching the addon", description="First time lauching the addon",
default=True default=True
) )