def test_init(self):
        ctf_settings = settings("ctf")
        self.assertEqual(ctf_settings.config_file_name, "conf.json")
        self.assertEqual(ctf_settings.root_path, "~/")
        self.assertEqual(ctf_settings.category_path, "~/ctf/")

        audit_settings = settings("audit")
        self.assertEqual(audit_settings.config_file_name, "conf.json")
        self.assertEqual(audit_settings.root_path, "~/")
        self.assertEqual(audit_settings.category_path, "~/audit/")
Exemplo n.º 2
0
    def load(self):
        ''' Load shows, setup the basics '''
        
        label = QLabel()
        self.ui.statusbar.addWidget(label)
        
        try:
            label.setText('Loading settings')
            self.settings = settings()
            
            if self.settings.get(settings.categories.application, settings.keys.firstrun, bool):
                self.ui.tabs.setCurrentIndex(4)
                self.settings.set(settings.categories.application, settings.keys.firstrun, False)
            
            lastupdated = self.settings.get(settings.categories.application, settings.keys.lastupdated, datetime)
            self.setlastupdatedstatus(lastupdated)
            
            self.ui.settingsautoswitchshowtab.setChecked(self.settings.get(settings.categories.application, settings.keys.autoswitchshowtab, bool))
            self.ui.settingsautoswitchseasontab.setChecked(self.settings.get(settings.categories.application, settings.keys.autoswitchseasontab, bool))

            label.setText('Loading storage')
            self.storage = storage(self.settings.path())
            
            label.setText('Loading backend')
            self.backend = thetvdbbackend(self.settings)

            label.setText('Displaying shows')
            self.displayshows()
            
            self.displayshowstatuses()
        except RuntimeError as (errnum, errstr):
            print 'An error has occurred (%d: %s)' % (errnum, errstr)
Exemplo n.º 3
0
    def __init__(self, name):
        self.name = name
        self.date = datetime.datetime.now().year
        self.settings = settings.settings(category="ctf")

        with open("conf.json") as config_file : 
            self.conf = json.load(config_file)["ctf_conf"]
Exemplo n.º 4
0
 def setUp(self):
     self.obj = settings()