def __init__(self, profile): gtk.gdk.threads_init() ### Initialise Variables self.windows = {"Battle": False, "Lobby": False, "Options": False} self.updating = False self.profile = profile ## Platform self.platform = sys.platform if self.platform != "win32": ## Linux HOME = os.environ["HOME"] self.profile_dir = os.path.join(HOME, ".unity-lobby", "profiles", profile) self.ini_file = os.path.join(HOME, ".unity-lobby", "profiles", "setup.ini") else: ## Windows APPDATA = os.environ["APPDATA"] self.setup_dir = os.path.join(APPDATA, "unity-lobby", "profiles", profile) self.ini_file = os.path.join(APPDATA, "unity-lobby", "profiles", "setup.ini") ## Unity Conf self.ini = ConfigParser.ConfigParser() self.ini.optionxform = lambda x: x self.ini.read(self.ini_file) ## Lobby Conf self.lobby_ini_file = self.ini.get(self.profile, "LOBBY_CONF") self.lobby_ini = ConfigParser.ConfigParser() self.lobby_ini.optionxform = lambda x: x self.lobby_ini.read(self.lobby_ini_file) ## Unitsync Wrapper self.unitsync_wrapper = unitsync_wrapper(self.ini.get(self.profile, "SPRING_DATADIR", None)) ## Unitsync Cache files self.map_index_file = self.ini.get(self.profile, "MAP_INDEX") self.mod_index_file = self.ini.get(self.profile, "MOD_INDEX") ## UnityLobby Location self.unity_location = self.ini.get(self.profile, "UNITY_INSTALL_DIR") ## Register Custom Stock Images bot_image_location = os.path.join(self.unity_location, "resources", "status", "bot.svg") insync_location = os.path.join(self.unity_location, "resources", "sync", "sync1.png") unknownsync_location = os.path.join(self.unity_location, "resources", "sync", "sync2.png") outofsync_location = os.path.join(self.unity_location, "resources", "sync", "sync3.png") self.register_iconsets( [ ("unitylobby-bot", bot_image_location), ("unitylobby-in-sync", insync_location), ("unitylobby-unknown-sync", unknownsync_location), ("unitylobby-outof-sync", outofsync_location), ] )
def __init__(self, profile): gtk.gdk.threads_init() ### Initialise Variables self.windows = ({'Battle': False, 'Lobby': False, 'Options': False}) self.updating = False self.profile = profile ## Platform self.platform = sys.platform if self.platform != 'win32': ## Linux HOME = os.environ['HOME'] self.profile_dir = os.path.join(HOME, '.unity-lobby', 'profiles', profile) self.ini_file = os.path.join(HOME, '.unity-lobby', 'profiles', 'setup.ini') else: ## Windows APPDATA = os.environ['APPDATA'] self.setup_dir = os.path.join(APPDATA, 'unity-lobby', 'profiles', profile) self.ini_file = os.path.join(APPDATA, 'unity-lobby', 'profiles', 'setup.ini') ## Unity Conf self.ini = ConfigParser.ConfigParser() self.ini.optionxform = lambda x: x self.ini.read(self.ini_file) ## Lobby Conf self.lobby_ini_file = self.ini.get(self.profile, 'LOBBY_CONF') self.lobby_ini = ConfigParser.ConfigParser() self.lobby_ini.optionxform = lambda x: x self.lobby_ini.read(self.lobby_ini_file) ## Unitsync Wrapper self.unitsync_wrapper = unitsync_wrapper( self.ini.get(self.profile, 'SPRING_DATADIR', None)) ## Unitsync Cache files self.map_index_file = self.ini.get(self.profile, 'MAP_INDEX') self.mod_index_file = self.ini.get(self.profile, 'MOD_INDEX') ## UnityLobby Location self.unity_location = self.ini.get(self.profile, 'UNITY_INSTALL_DIR') ## Register Custom Stock Images bot_image_location = os.path.join(self.unity_location, 'resources', 'status', 'bot.svg') self.register_iconsets([('unitylobby-bot', bot_image_location)])
def __init__(self, profile): gtk.gdk.threads_init() ### Initialise Variables self.windows = ({'Battle':False, 'Lobby':False, 'Options':False}) self.updating = False self.profile = profile ## Platform self.platform = sys.platform if self.platform != 'win32': ## Linux HOME = os.environ['HOME'] self.profile_dir = os.path.join(HOME, '.unity-lobby', 'profiles', profile) self.ini_file = os.path.join(HOME, '.unity-lobby', 'profiles', 'setup.ini') else: ## Windows APPDATA = os.environ['APPDATA'] self.setup_dir = os.path.join(APPDATA, 'unity-lobby', 'profiles', profile) self.ini_file = os.path.join(APPDATA, 'unity-lobby', 'profiles', 'setup.ini') ## Unity Conf self.ini = ConfigParser.ConfigParser() self.ini.optionxform = lambda x: x self.ini.read(self.ini_file) ## Lobby Conf self.lobby_ini_file = self.ini.get(self.profile, 'LOBBY_CONF') self.lobby_ini = ConfigParser.ConfigParser() self.lobby_ini.optionxform = lambda x: x self.lobby_ini.read(self.lobby_ini_file) ## Unitsync Wrapper self.unitsync_wrapper = unitsync_wrapper(self.ini.get(self.profile, 'SPRING_DATADIR', None)) ## Unitsync Cache files self.map_index_file = self.ini.get(self.profile, 'MAP_INDEX') self.mod_index_file = self.ini.get(self.profile, 'MOD_INDEX') ## UnityLobby Location self.unity_location = self.ini.get(self.profile, 'UNITY_INSTALL_DIR') ## Register Custom Stock Images bot_image_location = os.path.join(self.unity_location, 'resources', 'status', 'bot.svg') insync_location = os.path.join(self.unity_location, 'resources', 'sync', 'sync1.png') unknownsync_location = os.path.join(self.unity_location, 'resources', 'sync', 'sync2.png') outofsync_location = os.path.join(self.unity_location, 'resources', 'sync', 'sync3.png') self.register_iconsets([('unitylobby-bot', bot_image_location), ('unitylobby-in-sync', insync_location), ('unitylobby-unknown-sync', unknownsync_location), ('unitylobby-outof-sync', outofsync_location)])
def __init__(self, profile): gtk.gdk.threads_init() # Initialise Variables self.windows = ({'Battle':False, 'Lobby':False, 'Options':False}) self.updating = False # Profile self.profile = profile # Platform self.platform = sys.platform if self.platform != 'win32': # Linux HOME = os.environ['HOME'] self.profile_dir = os.path.join(HOME, '.unity-lobby', 'profiles', profile) self.ini_file = os.path.join(HOME, '.unity-lobby', 'profiles', 'setup.ini') else: # Windows APPDATA = os.environ['APPDATA'] self.setup_dir = os.path.join(APPDATA, 'unity-lobby', 'profiles', profile) self.ini_file = os.path.join(APPDATA, 'unity-lobby', 'profiles', 'setup.ini') # Unity Conf self.ini = ConfigParser.ConfigParser() self.ini.optionxform = lambda x: x self.ini.read(self.ini_file) # Lobby Conf self.lobby_ini_file = self.ini.get(self.profile, 'LOBBY_CONF') self.lobby_ini = ConfigParser.ConfigParser() self.lobby_ini.optionxform = lambda x: x self.lobby_ini.read(self.lobby_ini_file) # Unitsync Wrapper self.unitsync_wrapper = unitsync_wrapper(self.ini.get(self.profile, 'SPRING_DATADIR', None)) # Unitsync Cache files self.map_index_file = self.ini.get(self.profile, 'MAP_INDEX') self.mod_index_file = self.ini.get(self.profile, 'MOD_INDEX')