def SaveOptions(self, event=None): """Save values to options.xml.""" window_dict = {} window_dict['window_position'] = str(self.GetScreenPosition()) window_dict['window_size'] = str(self.GetSize())#[0], self.GetSize()[1])) xml_utils().save_generic_settings(self.LYRICS_SETTINGS, "settings_lyrics.xml", window_dict)
def SaveOptions(self, event): # save value to options.xml window_dict = {} window_dict['password'] = self.tc_dizzler_password.GetValue() window_dict['username'] = self.tc_dizzler_username.GetValue() window_dict['default_text'] = self.tc_dizzler_default.GetValue() xml_utils().save_generic_settings(DIZZLER, "settings_dizzler.xml", window_dict)
def SaveOptions(self, event): # save value to options.xml window_dict = {} window_dict['password'] = self.tc_twitter_password.GetValue() window_dict['username'] = self.tc_twitter_username.GetValue() window_dict['default_text'] = self.tc_twitter_default.GetValue() xml_utils().save_generic_settings(self.TWITTER_SETTINGS, "settings_twitter.xml", window_dict)
def SaveOptions(self, event): # save value to options.xml window_dict = {} window_dict['autoload'] = str(int(self.cb_flash_autoload.GetValue())) window_dict['service'] = str(int(self.rx_flash_service.GetSelection())) window_dict['window_position'] = str(self.GetScreenPosition()) window_dict['window_size'] = str(self.GetSize())#[0], self.GetSize()[1])) xml_utils().save_generic_settings(self.FLASH_SETTINGS, "settings_flash.xml", window_dict)
def SaveOptions(self, event=None): """Save values to options.xml.""" window_dict = {} window_dict['window_position'] = str(self.GetScreenPosition()) window_dict['window_size'] = str( self.GetSize()) #[0], self.GetSize()[1])) xml_utils().save_generic_settings(self.LYRICS_SETTINGS, "settings_lyrics.xml", window_dict)
def SaveOptions(self): # save value to options.xml dir_string = "" num_items = len(self.lb_sync_directories.GetItems()) if num_items > 0: for x in range(num_items, 0, -1): dir_string = dir_string + self.lb_sync_directories.GetString(x - 1) + ";" if len(dir_string) > 1: window_dict = {} window_dict["directories"] = dir_string xml_utils().save_generic_settings(self.SYNC_SETTINGS, "settings_sync.xml", window_dict)
def SaveOptions(self): # save value to options.xml dir_string = '' num_items = len(self.lb_sync_directories.GetItems()) if num_items > 0: for x in range(num_items, 0, -1): dir_string = dir_string + self.lb_sync_directories.GetString( x - 1) + ';' if len(dir_string) > 1: window_dict = {} window_dict['directories'] = dir_string xml_utils().save_generic_settings(self.SYNC_SETTINGS, "settings_sync.xml", window_dict)
def CheckVersion(self): tree ='' try: url_blob = urllib.urlopen(VERSION_URL + '?' + self.current_version) tree = read_write_xml.xml_utils().read_xml_tree(url_blob) except Exception, inst: print 'Exception: version check: ' + str(inst)
def CheckVersion(self): tree = '' try: url_blob = urllib.urlopen(VERSION_URL + '?' + self.current_version) tree = read_write_xml.xml_utils().read_xml_tree(url_blob) except Exception, inst: print 'Exception: version check: ' + str(inst)
def AutoloadSetting(self, plugin_name): #load the setting from settings_[plug-in name].xml if it exists settings_dict = xml_utils().get_generic_settings(self.SETTINGS_LOCATION + "settings_" + plugin_name + ".xml") autoload='' if len(settings_dict) >= 1: if settings_dict.has_key('autoload'): autoload = int(settings_dict['autoload']) return autoload
def AutoloadSetting(self, plugin_name): #load the setting from settings_[plug-in name].xml if it exists settings_dict = xml_utils().get_generic_settings( self.SETTINGS_LOCATION + "settings_" + plugin_name + ".xml") autoload = '' if len(settings_dict) >= 1: if settings_dict.has_key('autoload'): autoload = int(settings_dict['autoload']) return autoload
def LoadSettings(self): """Load the setting from settings_lyrics.xml if it exists.""" settings_dict = xml_utils().get_generic_settings(self.LYRICS_SETTINGS + "settings_lyrics.xml") #print settings_dict if len(settings_dict) >= 1: if settings_dict.has_key('window_position'): # not good, replace eval self.SetPosition(eval(settings_dict['window_position'])) if settings_dict.has_key('window_size'): self.SetSize(eval(settings_dict['window_size']))
def LoadSettings(self): # load the setting from settings_sync.xml if it exists settings_dict = xml_utils().get_generic_settings(self.SYNC_SETTINGS + "settings_sync.xml") # print settings_dict if len(settings_dict) >= 1: directories = "" if settings_dict.has_key("directories"): directories = settings_dict["directories"] h = directories.split(";") counter = 0 for x in h: if len(x) > 0: self.lb_sync_directories.Insert(x, counter) counter = counter + 1
def LoadSettings(self): #load the setting from settings_sync.xml if it exists settings_dict = xml_utils().get_generic_settings(self.SYNC_SETTINGS + "settings_sync.xml") #print settings_dict if len(settings_dict) >= 1: directories = '' if settings_dict.has_key('directories'): directories = settings_dict['directories'] h = directories.split(';') counter = 0 for x in h: if len(x) > 0: self.lb_sync_directories.Insert(x, counter) counter = counter + 1
def LoadSettings(self): #load the setting from settings_twitter.xml if it exists settings_dict = xml_utils().get_generic_settings(self.TWITTER_SETTINGS + "settings_twitter.xml") #print settings_dict if len(settings_dict) >= 1: username='' if settings_dict.has_key('username'): username = settings_dict['username'] password ='' if settings_dict.has_key('password'): password = settings_dict['password'] default_text='' if settings_dict.has_key('default_text'): default_text = settings_dict['default_text'] self.tc_twitter_username.SetValue(username) self.tc_twitter_password.SetValue(password) self.tc_twitter_default.SetValue(default_text)
def LoadSettings(self): #load the setting from settings_falsh.xml if it exists settings_dict = xml_utils().get_generic_settings(self.FLASH_SETTINGS + "settings_flash.xml") #print settings_dict if len(settings_dict) >= 1: autoload=0 if settings_dict.has_key('autoload'): autoload = int(settings_dict['autoload']) self.cb_flash_autoload.SetValue(autoload) service=0 if settings_dict.has_key('service'): service = int(settings_dict['service']) self.rx_flash_service.SetSelection(service) if settings_dict.has_key('window_position'): # not good, replace eval self.SetPosition(eval(settings_dict['window_position'])) if settings_dict.has_key('window_size'): self.SetSize(eval(settings_dict['window_size']))
def LoadSetings(self): #load the setting from settings_dizzler.xml if it exists settings_dict = xml_utils().get_generic_settings(DIZZLER_SETTINGS) #print settings_dict if len(settings_dict) > 1: username = '' if settings_dict.has_key('username'): username = settings_dict['username'] password = '' if settings_dict.has_key('password'): password = settings_dict['password'] default_text = '' if settings_dict.has_key('default_text'): default_text = settings_dict['default_text'] self.tc_dizzler_username.SetValue(username) self.tc_dizzler_password.SetValue(password) self.tc_dizzler_default.SetValue(default_text)
def LoadPlugins(self): base_path = self.parent.working_directory + os.sep + "plugins" + os.sep #PLUGINS_LOCATION #self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.id_array = {} id_counter = 1100 #accerators acc_arr = [] for root, dirs, files in os.walk(base_path): dir_name = root.rsplit(os.sep, 1)[1] #print dir_name counter = 0 #counter = counter + files.count("settings_" + dir_name + ".xml") counter = counter + files.count("layout_" + dir_name + ".xml") counter = counter + files.count("info_" + dir_name + ".xml") counter = counter + files.count("icon_" + dir_name + ".png") counter = counter + files.count(dir_name + ".py") counter = counter + files.count(dir_name + ".pyo") if counter >= 4: #load plugin self.id_array[id_counter] = dir_name btnsizer = wx.BoxSizer(wx.HORIZONTAL) # plugin text xml_dict = xml_utils().get_generic_settings(root + os.sep + "info_" + dir_name + ".xml") hot_key = '' if 'title' in xml_dict: #t = wx.StaticText(self.parent.pa_options_plugins, -1, xml_dict['title'], size=(120,15), style=wx.ALIGN_RIGHT) #font = wx.Font(8, wx.NORMAL, wx.NORMAL, wx.BOLD) #t.SetFont(font) #btnsizer.Add(t, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) hot_key = ' [Alt-' + xml_dict['title'][0] + ']' hot_key_menu = '\t Alt-' + xml_dict['title'][0] acc_arr.append((id_counter, xml_dict['title'][0].upper())) # plugin button #bmp = wx.Bitmap(root + os.sep + "icon_" + dir_name + ".png", wx.BITMAP_TYPE_ANY) #b = wx.BitmapButton(self.parent.pa_options_plugins, id_counter, bmp) #, (20, 20), (bmp.GetWidth()+10, bmp.GetHeight()+10)) #btnsizer.Add(b, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) #self.parent.Bind(wx.EVT_BUTTON, self.LoadPluginWindow, b) #if 'description' in xml_dict: # d = wx.StaticText(self.parent.pa_options_plugins, -1, xml_dict['description'] + hot_key) # btnsizer.Add(d, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) # sizer #self.main_sizer.Add(btnsizer, 0, wx.EXPAND|wx.ALL, 0) #add to plug-ins menu plugins_menu = self.parent.parent.menu_plugins plugins_menu.Append(id_counter, xml_dict['title'])# + hot_key_menu) self.parent.parent.Bind(wx.EVT_MENU, self.LoadPluginWindow, id=id_counter) id_counter = id_counter + 1 #check for autoload #*** if self.AutoloadSetting(dir_name): #*** try: #*** z = self.LoadPluginWindow(None, dir_name) #*** except Exception, expt: #*** print "LoadPlugins: " + str(Exception) + str(expt) #*** #check to see if it has the ability to add itself as a tab, and do so #*** try: #*** z.OnMakeTabClick() #*** except Exception, expt: #*** "LoadPlugins: " + str(Exception) + str(expt) counter = 0 #self.parent.pa_options_plugins.SetSizer(self.main_sizer) #set some more accelerators #use the first letter of the plugin + alt for the accerator x = self.parent.aTable_values for y in acc_arr: #append first letter of plugin and id to accelator table x.append((wx.ACCEL_ALT, ord(y[1]), y[0])) aTable = wx.AcceleratorTable(x) self.parent.SetAcceleratorTable(aTable) self.parent.album_viewer.SetAcceleratorTable(aTable)
def LoadPlugins(self): base_path = self.parent.working_directory + os.sep + "plugins" + os.sep #PLUGINS_LOCATION #self.main_sizer = wx.BoxSizer(wx.VERTICAL) self.id_array = {} id_counter = 1100 #accerators acc_arr = [] for root, dirs, files in os.walk(base_path): dir_name = root.rsplit(os.sep, 1)[1] #print dir_name counter = 0 #counter = counter + files.count("settings_" + dir_name + ".xml") counter = counter + files.count("layout_" + dir_name + ".xml") counter = counter + files.count("info_" + dir_name + ".xml") counter = counter + files.count("icon_" + dir_name + ".png") counter = counter + files.count(dir_name + ".py") counter = counter + files.count(dir_name + ".pyo") if counter >= 4: #load plugin self.id_array[id_counter] = dir_name btnsizer = wx.BoxSizer(wx.HORIZONTAL) # plugin text xml_dict = xml_utils().get_generic_settings(root + os.sep + "info_" + dir_name + ".xml") hot_key = '' if 'title' in xml_dict: #t = wx.StaticText(self.parent.pa_options_plugins, -1, xml_dict['title'], size=(120,15), style=wx.ALIGN_RIGHT) #font = wx.Font(8, wx.NORMAL, wx.NORMAL, wx.BOLD) #t.SetFont(font) #btnsizer.Add(t, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) hot_key = ' [Alt-' + xml_dict['title'][0] + ']' hot_key_menu = '\t Alt-' + xml_dict['title'][0] acc_arr.append((id_counter, xml_dict['title'][0].upper())) # plugin button #bmp = wx.Bitmap(root + os.sep + "icon_" + dir_name + ".png", wx.BITMAP_TYPE_ANY) #b = wx.BitmapButton(self.parent.pa_options_plugins, id_counter, bmp) #, (20, 20), (bmp.GetWidth()+10, bmp.GetHeight()+10)) #btnsizer.Add(b, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) #self.parent.Bind(wx.EVT_BUTTON, self.LoadPluginWindow, b) #if 'description' in xml_dict: # d = wx.StaticText(self.parent.pa_options_plugins, -1, xml_dict['description'] + hot_key) # btnsizer.Add(d, 0, wx.ALL|wx.ALIGN_CENTER_VERTICAL, 5) # sizer #self.main_sizer.Add(btnsizer, 0, wx.EXPAND|wx.ALL, 0) #add to plug-ins menu plugins_menu = self.parent.parent.menu_plugins plugins_menu.Append(id_counter, xml_dict['title']) # + hot_key_menu) self.parent.parent.Bind(wx.EVT_MENU, self.LoadPluginWindow, id=id_counter) id_counter = id_counter + 1 #check for autoload #*** if self.AutoloadSetting(dir_name): #*** try: #*** z = self.LoadPluginWindow(None, dir_name) #*** except Exception, expt: #*** print "LoadPlugins: " + str(Exception) + str(expt) #*** #check to see if it has the ability to add itself as a tab, and do so #*** try: #*** z.OnMakeTabClick() #*** except Exception, expt: #*** "LoadPlugins: " + str(Exception) + str(expt) counter = 0 #self.parent.pa_options_plugins.SetSizer(self.main_sizer) #set some more accelerators #use the first letter of the plugin + alt for the accerator x = self.parent.aTable_values for y in acc_arr: #append first letter of plugin and id to accelator table x.append((wx.ACCEL_ALT, ord(y[1]), y[0])) aTable = wx.AcceleratorTable(x) self.parent.SetAcceleratorTable(aTable) self.parent.album_viewer.SetAcceleratorTable(aTable)