def reload_settings(): global settings print('Reloading settings...') # TODO: settings doesn't seem to load most settings. # Also, settings.get('key', 'default_value') returns None settings = sublime.load_settings('Floobits.sublime-settings') G.ALERT_ON_MSG = settings.get('alert_on_msg') if G.ALERT_ON_MSG is None: G.ALERT_ON_MSG = True G.DEBUG = settings.get('debug') if G.DEBUG is None: G.DEBUG = False G.COLAB_DIR = settings.get('share_dir') or '~/.floobits/share/' G.COLAB_DIR = os.path.expanduser(G.COLAB_DIR) G.COLAB_DIR = os.path.realpath(G.COLAB_DIR) utils.mkdir(G.COLAB_DIR) G.DEFAULT_HOST = settings.get('host') or 'floobits.com' G.DEFAULT_PORT = settings.get('port') or 3448 G.SECURE = settings.get('secure') if G.SECURE is None: G.SECURE = True G.USERNAME = settings.get('username') G.SECRET = settings.get('secret') floorc_settings = load_floorc() for name, val in floorc_settings.items(): setattr(G, name, val) if agent and agent.is_ready(): msg.log('Reconnecting due to settings change') agent.reconnect() print('Floobits debug is %s' % G.DEBUG)
def reload_settings(): global settings print('Reloading settings...') settings = sublime.load_settings('Floobits.sublime-settings') G.ALERT_ON_MSG = settings.get('alert_on_msg', True) G.DEBUG = settings.get('debug', False) G.COLAB_DIR = settings.get('share_dir', '~/.floobits/share/') G.COLAB_DIR = os.path.expanduser(G.COLAB_DIR) G.COLAB_DIR = os.path.realpath(G.COLAB_DIR) utils.mkdir(G.COLAB_DIR) G.DEFAULT_HOST = settings.get('host', 'floobits.com') G.DEFAULT_PORT = settings.get('port', 3448) G.SECURE = settings.get('secure', True) G.USERNAME = settings.get('username') G.SECRET = settings.get('secret') floorc_settings = load_floorc() for name, val in floorc_settings.items(): setattr(G, name, val) if agent and agent.is_ready(): msg.log('Reconnecting due to settings change') agent.reconnect()
def print_msg(chat_view): msg.log('Opened message view') if not agent: msg.log('Not joined to a room.')
def part_room(): if not agent: return msg.warn('Unable to part room: You are not joined to a room.') stop_everything() msg.log('You left the room.')