def Save(self): strFile = self.CalcFileName() ini = IniFile() ini.SetPath(strFile) #ini.Load()#strFile) nTotalCount = len(self.m_lstBookmarks) ini.SetValue(self.g_szSection, 'Count', nTotalCount) for i in range(nTotalCount): strKey = '%d_Title' % i ini.SetValue(self.g_szSection, strKey, self.m_lstBookmarks[i].m_strTitle) strKey = '%d_Path' % i ini.SetValue(self.g_szSection, strKey, self.m_lstBookmarks[i].m_strPath) if not ini.Save(): return False return True
def Load(self): strFile = self.CalcFileName() ini = IniFile() if not ini.Load(strFile): return False nTotalCount = int(ini.GetValue('Bookmarks', 'Count', 0)) #print nTotalCount strKey = '' for i in range(nTotalCount): strKey = '%d_Title' % i strTitle = ini.GetValue(self.g_szSection, strKey, '') strKey = '%d_Path' % i strPath = ini.GetValue(self.g_szSection, strKey, '') item = BrowseBookmark(strTitle, strPath) if (item.IsValid()): self.m_lstBookmarks.append(item) return True
def __init__(self): self.m_bLangRestartReminder = True p = PathName() strFile = p.GetIniDirectory() #print strFile #TOFIX strFile += '/atol.ini' ini = IniFile() inifileloaded = False self.m_strCurLang = 'en' if ini.Load(strFile): inifileloaded = true strValue = ini.GetValue('Default', 'Language', '') if (strValue != ''): self.m_strCurLang = strValue else: #// francesco: not sure, if there exists already a translated mo file #// m_strCurLang = wxLANGUAGE_DEFAULT; self.m_strCurLang = '' else: self.m_strCurLang = '' self.FindLanguages()