Esempio n. 1
0
 def __init__(self, Parent=None, ProjectDatabase=None, Projectname=""):
     Enum.__init__(self)
     
     ProjectDatabase.getProject(Projectname)
     self.FilesDatabase = ProjectDatabase.getFilesDatabase()
     self.ID = None
     self.Parent = Parent
Esempio n. 2
0
 def __init__(self):
     Enum.__init__(self)
     
     self.MainWindowStyle = CSSMakeUpGenerator.CSS()
     GtkWindow = self.MainWindowStyle.addElementSelector('GtkWindow')
     GtkWindow.addElement('margin', '30px')
     GtkWindow.addElement('padding', '30px')
     
     GtkLabel = self.MainWindowStyle.addElementSelector('GtkLabel')
     GtkLabel.addElement('padding', '3px')
     
     GtkLabelIDTitle = self.MainWindowStyle.addElementSelector('GtkLabel#title')
     GtkLabelIDTitle.addElement('font-size', '30')       
     GtkLabelIDTitle.addElement('padding', '20px')  
     GtkLabelIDTitle.addElement('padding-right', '30px')  
     GtkLabelIDTitle.addElement('padding-left', '30px')       
     
     GtkLabelIDPre = self.MainWindowStyle.addElementSelector('GtkLabel#pre')
     GtkLabelIDPre.addElement('font-size', '15')
     GtkLabelIDPre.addElement('color', '#00abab')
     
     GtkLabelIDHeadline = self.MainWindowStyle.addElementSelector('GtkLabel#headline')
     GtkLabelIDHeadline.addElement('padding-top', '10px')
     GtkLabelIDHeadline.addElement('font-size', '20')
     GtkLabelIDHeadline.addElement('border-bottom', '3px solid #000')
     
     InfoBox = self.MainWindowStyle.addElementSelector('#infobox')
     InfoBox.addElement('background-color', '#66bb55')
     InfoBox.addElement('color', '#434343')
     InfoBox.addElement('padding', '10px')
     InfoBox.addElement('margin', '10px')
 
     Toolbar_Black = self.MainWindowStyle.addElementSelector('GtkToolbar#black')
     Toolbar_Black.addElement('background-color', '#333333')
Esempio n. 3
0
 def __init__(self):
     Enum.__init__(self)
     
     self.read_languages_file()
     
     for translate_object in languages.translates.TranslatesObjects():
         named_object = translate_object.split("_", 1)[1]
         self.__dict__[translate_object] = self.get_translations_for(named_object)
Esempio n. 4
0
 def __init__(self):
     SETTINGS = SettingsDatabase.Settings()
     Enum.__init__(self)
     
     self.Critical = Enum(BG=Color(SETTINGS.get("TreeColor_BG_Critical")), FG=Color(SETTINGS.get("TreeColor_FG_Critical")))
     self.Important = Enum(BG=Color(SETTINGS.get("TreeColor_BG_Important")), FG=Color(SETTINGS.get("TreeColor_FG_Important")))
     self.Revise = Enum(BG=Color(SETTINGS.get("TreeColor_BG_Revise")), FG=Color(SETTINGS.get("TreeColor_FG_Revise")))
     self.InOrder = Enum(BG=Color(SETTINGS.get("TreeColor_BG_InOrder")), FG=Color(SETTINGS.get("TreeColor_FG_InOrder")))
     self.Default = Enum(BG=Color(SETTINGS.get("TreeColor_BG_Default")), FG=Color(SETTINGS.get("TreeColor_FG_Default")))
Esempio n. 5
0
class Sync(threading.Thread):
    def __init__(self, Logger=None):
        threading.Thread.__init__(self)

        self.SyncObjectsEnum = Enum()
        self.Projects = Enum()
        self.RunClasses = Enum()

        self.running = True
        self.logger = Logger

    def addProject(self, ProjectName):
        self.Projects[ProjectName] = None

    def getProjects(self):
        return self.Projects

    def addRunClass(self, Name, RunClass):
        self.RunClasses[Name] = RunClass

    def getRunClasses(self):
        return self.RunClasses

    def addSyncTask(self, ProjectName, Name, Sync):
        if ProjectName in self.Projects.keys():
            SyncObjectsEnum = Enum()
            SyncObjectsEnum[Name] = Sync
            self.Projects[ProjectName] = SyncObjectsEnum
        else:
            SyncObjectsEnum = Enum()
            SyncObjectsEnum[Name] = Sync
            self.Projects[""] = SyncObjectsEnum

    def removeSyncTask(self, ProjectName):
        return self.Projects.pop(ProjectName)

    def run(self):
        while self.running:
            time.sleep(1.5)
            try:
                for Project in self.Projects:
                    for SyncObject in self.Projects[Project].keys():
                        self.Projects[Project][SyncObject].run()
                        self.logger.info("Running Object " + SyncObject + "...")
            except RuntimeError:
                continue
        else:
            if self.logger:
                self.logger.info("Shutdown Mainthread ...")
Esempio n. 6
0
    def __init__(self, Logger=None):
        threading.Thread.__init__(self)

        self.SyncObjectsEnum = Enum()
        self.Projects = Enum()
        self.RunClasses = Enum()

        self.running = True
        self.logger = Logger
Esempio n. 7
0
class Tab(Gtk.Notebook, TabWidgets):
    def __init__(self, ClassRegister):
        Gtk.Notebook.__init__(self)
        TabWidgets.__init__(self)

        self.Tabs = Enum()
        self.TempTabs = Enum()
        self.NamedTabs = Enum()

        self.Scrollabe = False
        self.ClassRegister = ClassRegister

        self.connect("switch-page", self.tabChanged)

    def addTab(self, TabWidget, TabLabel, Pos=None):
        CurrentPage = self.get_n_pages()
        if Pos:
            CurrentPage = Pos

        self.Tabs[CurrentPage] = Enum(TabWidget=TabWidget, TabLabel=TabLabel)
        TabLabel.connect("close-clicked", self.removeTabByWidget, TabWidget)

        if hasattr(TabLabel, "get_text"):
            self.NamedTabs[TabLabel.get_text()] = CurrentPage

        self.insert_page(TabWidget, TabLabel, CurrentPage)
        return True

    def removeTabByWidget(self, TabLabel=None, TabWidget=None):
        self.remove_page(self.page_num(TabWidget))

    def hasTab(self, name):
        return self.NamedTabs.has_key(name)

    def tabChanged(self, notebook, current_page, index):
        if self.ClassRegister.CreatingTabsIsFinish:
            if hasattr(self.Tabs[index].TabWidget, "preload"):
                if not self.Tabs[index].TabWidget.IsLoad:
                    self.Tabs[index].TabWidget.preload()
        if not index:
            return
        try:
            title = self.Tabs[index].TabWidget.title
        except AttributeError:
            title = ""
        if title:
            self.ClassRegister.Window.set_title("{0} - {1}".format(self.ClassRegister.Windowname, title))

    def setScrollabe(self, state=None):
        if state:
            self.set_scrollable(state)
        else:
            self.set_scrollable(not self.Scrollabe)
            self.Scrollabe = not self.Scrollabe
Esempio n. 8
0
    def __init__(self, ClassRegister):
        Gtk.Notebook.__init__(self)
        TabWidgets.__init__(self)

        self.Tabs = Enum()
        self.TempTabs = Enum()
        self.NamedTabs = Enum()

        self.Scrollabe = False
        self.ClassRegister = ClassRegister

        self.connect("switch-page", self.tabChanged)
Esempio n. 9
0
 def __init__(self, name, runobject):
     super(SubAction, self).__init__()
     Enum.__init__(self)
     
     self.name = name
     self.runobject = runobject
Esempio n. 10
0
 def __init__(self, name=None):
     super(Action, self).__init__()
     Enum.__init__(self)
     
     self.name = name
     self.subactions = Enum()
Esempio n. 11
0
 def __init__(self):
     Enum.__init__(self)
Esempio n. 12
0
 def __getitem__(self, key):
     try:
         return Enum.__getitem__(self, key)
     except KeyError:
         return self.Default