Esempio n. 1
0
    def open_lom_list(self, *args):
        LoggerFactory.getLogger(str(
            self.__class__)).debug("open_lom_list Called")
        builder = Gtk.Builder()
        builder.add_from_file("sapy_modules/gui/glade/sapy.glade")

        lom_store = Gtk.ListStore(int, str)

        for l in RunList('lom').list_lom():
            lom_store.append([l.id, l.name])

        lom_tree_view = Gtk.TreeView(lom_store)
        lom_tree_view.append_column(
            Gtk.TreeViewColumn("Id", Gtk.CellRendererText(), text=0))
        lom_tree_view.append_column(
            Gtk.TreeViewColumn("Name", Gtk.CellRendererText(), text=1))
        lom_tree_view.append_column(
            Gtk.TreeViewColumn("Seleceted", Gtk.CellRendererToggle(), text=1))

        lomListBox = builder.get_object("LomListBox")

        lomListBox.pack_start(lom_tree_view, True, True, 1)

        dialog = builder.get_object("gtkdialog_chooe_list")
        dialog.show_all()
Esempio n. 2
0
    def close_lom_list(self, *args):
        LoggerFactory.getLogger(str(
            self.__class__)).debug("close_lom_list Called")
        builder = Gtk.Builder()
        builder.add_from_file("sapy_modules/gui/glade/sapy.glade")

        dialog = builder.get_object("gtkdialog_chooe_list")
        dialog.hide()
Esempio n. 3
0
    def __init__(self,
                 id=None,
                 name="list of movements",
                 visible=False,
                 color="black"):
        self.logger = LoggerFactory.getLogger(str(self.__class__))
        self.name = name
        self.visible = visible
        self.color = color

        if id == None:
            cur = db_iface.get_cursor()
            cur.execute(INSERT_LOM, (name, visible, color))

            cur.execute(GET_LAST_LOM)
            self.id = cur.fetchone()[0]

            db_iface.commit()
            cur.close()
        else:
            self.id = id
Esempio n. 4
0
    def __init__(self):
        self.logger = LoggerFactory.getLogger(str(self.__class__))

        self.parser = argparse.ArgumentParser(
            prog=SapyConstants.APP.NAME,
            description=SapyConstants.APP.DESCRIPTION)

        self.rcl = [
            RunAdd, RunGraph, RunGui, RunImport, RunList, RunRemove,
            RunVersion, RunBalance
        ]

        self.scl = [
            SetDaily, SetEnd, SetId, SetMonthly, SetLom, SetStart, SetValue,
            SetWeekly, SetCause, SetDate, SetName
        ]

        self.tcl = [NewYear, NewMonth, EndWeek, EndMonth]

        for cmd in self.rcl + self.scl + self.tcl:
            if cmd.short_arg:
                if cmd.cmd_type:
                    self.parser.add_argument("--" + cmd.long_arg,
                                             "-" + cmd.short_arg,
                                             type=cmd.cmd_type,
                                             help=cmd.cmd_help)
                else:
                    self.parser.add_argument("--" + cmd.long_arg,
                                             "-" + cmd.short_arg,
                                             action=cmd.cmd_action,
                                             help=cmd.cmd_help)
            elif cmd.long_arg:
                if cmd.cmd_type:
                    self.parser.add_argument("--" + cmd.long_arg,
                                             type=cmd.cmd_type,
                                             help=cmd.cmd_help)
                else:
                    self.parser.add_argument("--" + cmd.long_arg,
                                             action=cmd.cmd_action,
                                             help=cmd.cmd_help)
Esempio n. 5
0
 def __init__(self, param):
     super().__init__()
     self.logger=LoggerFactory.getLogger(str( self.__class__ ))
Esempio n. 6
0
 def __init__( self, param ):
     super().__init__()
     self.logger = LoggerFactory.getLogger( str( self.__class__ ))
     self.file = pathlib.Path( param )
Esempio n. 7
0
 def onDestroy(self, *args):
     LoggerFactory.getLogger(str(self.__class__)).debug("onDestroy Called")
     Gtk.main_quit()
     exit(0)