Exemplo n.º 1
0
 def docking_config(self):
     conf = igmconfig.IGMConfig()
     kind = "docking-station" 
     self.cfg[kind] = {
         "enabled": conf._getboolean(kind, "enabled"),
         "schema": {
             "x": conf.x(kind, "schema"),
             "y": conf.y(kind, "schema"),
             "h": conf.h(kind, "schema"),
             "w": conf.w(kind, "schema"),
             "ttl": conf.ttl(kind, "schema"),
             "rgb": conf.rgb_list(kind, "schema"),
             "fill": conf.fill_list(kind, "schema"),
         }
     }
     if not conf.panel(kind):
         return
     self.cfg[kind]["panel"] = {
         "x": conf.x(kind, "panel"),
         "y": conf.y(kind, "panel"),
         "x2": conf.x2(kind, "panel"),
         "y2": conf.y2(kind, "panel"),
         "ttl": conf.ttl(kind, "panel"),
         "rgb": conf.rgb(kind, "panel"),
         "fill": conf.fill(kind, "panel")
     }
Exemplo n.º 2
0
 def general_config(self):
     conf = igmconfig.IGMConfig()
     self.cfg["general"] = {
         "large": {
             "h": conf.large_height(),
             "w": conf.large_width()
         },
         "normal": {
             "h": conf.normal_height(),
             "w": conf.normal_width()
         }
     }
Exemplo n.º 3
0
 def message_config(self, kind):
     conf = igmconfig.IGMConfig()
     self.cfg[kind] = {
         "h": {
             "x": conf.x(kind, "header"),
             "y": conf.y(kind, "header"),
             "ttl": conf.ttl(kind, "header"),
             "rgb": conf.rgb(kind, "header"),
             "size": conf.size(kind, "header"),
             "len": conf.len(kind, "header"),
             "align": conf.align(kind, "header")
         },
         "b": {
             "x":
             conf.x(kind, "body"),
             "y":
             conf.y(kind, "body"),
             "ttl":
             conf.ttl(kind, "body"),
             "rgb":
             conf.rgb(kind, "body"),
             "size":
             conf.size(kind, "body"),
             "len":
             conf.len(kind, "body"),
             "align":
             conf.align(kind, "body"),
             "rows":
             conf.body_rows(kind),
             "cache":
             lrucache.LRUCache(conf.body_rows(kind), conf.ttl(kind,
                                                              "body")),
             "last_row":
             0
         }
     }
     if not conf.panel(kind):
         return
     self.cfg[kind]["panel"] = {
         "x": conf.x(kind, "panel"),
         "y": conf.y(kind, "panel"),
         "x2": conf.x2(kind, "panel"),
         "y2": conf.y2(kind, "panel"),
         "ttl": conf.ttl(kind, "panel"),
         "rgb": conf.rgb(kind, "panel"),
         "fill": conf.fill(kind, "panel")
     }
Exemplo n.º 4
0
 def legal_config(self, kind):
     conf = igmconfig.IGMConfig() 
     kind = u"{}-legal".format(kind)
     self.cfg[kind] = {
         "enabled": conf._getboolean(kind, "enabled"),
         "clean": {
             "x": conf.x(kind, "clean"),
             "y": conf.y(kind, "clean"),
             "h": conf.h(kind, "clean_bar"),
             "w": conf.w(kind, "clean_bar"),
             "s": conf.s(kind, "clean_bar"),
             "ttl": conf.ttl(kind, "clean"),
             "rgb": conf.rgb_list(kind, "clean"),
             "fill": conf.fill_list(kind, "clean"),
         },
         "wanted": {
             "x": conf.x(kind, "wanted"),
             "y": conf.y(kind, "wanted"),
             "h": conf.h(kind, "wanted_bar"),
             "w": conf.w(kind, "wanted_bar"),
             "s": conf.s(kind, "wanted_bar"),
             "ttl": conf.ttl(kind, "wanted"),
             "rgb": conf.rgb_list(kind, "wanted"),
             "fill": conf.fill_list(kind, "wanted"),
         },
         "bounties": {
             "x": conf.x(kind, "bounties"),
             "y": conf.y(kind, "bounties"),
             "h": conf.h(kind, "bounties_bar"),
             "w": conf.w(kind, "bounties_bar"),
             "s": conf.s(kind, "bounties_bar"),
             "ttl": conf.ttl(kind, "bounties"),
             "rgb": conf.rgb_list(kind, "bounties"),
             "fill": conf.fill_list(kind, "bounties"),
         },
     }
     if not conf.panel(kind):
         return
     self.cfg[kind]["panel"] = {
         "x": conf.x(kind, "panel"),
         "y": conf.y(kind, "panel"),
         "x2": conf.x2(kind, "panel"),
         "y2": conf.y2(kind, "panel"),
         "ttl": conf.ttl(kind, "panel"),
         "rgb": conf.rgb(kind, "panel"),
         "fill": conf.fill(kind, "panel")
     }
Exemplo n.º 5
0
 def mining_config(self):
     conf = igmconfig.IGMConfig()
     kind = "mining-graphs" 
     self.cfg[kind] = {
         "enabled": conf._getboolean(kind, "enabled"),
         "yield": {
             "x": conf.x(kind, "yield"),
             "y": conf.y(kind, "yield"),
             "h": conf.h(kind, "yield_bar"),
             "w": conf.w(kind, "yield_bar"),
             "s": conf.s(kind, "yield_bar"),
             "ttl": conf.ttl(kind, "yield"),
             "rgb": conf.rgb_list(kind, "yield"),
             "fill": conf.fill_list(kind, "yield"),
         },
         "efficiency": {
             "x": conf.x(kind, "efficiency"),
             "y": conf.y(kind, "efficiency"),
             "h": conf.h(kind, "efficiency_bar"),
             "w": conf.w(kind, "efficiency_bar"),
             "s": conf.s(kind, "efficiency_bar"),
             "ttl": conf.ttl(kind, "efficiency"),
             "rgb": conf.rgb_list(kind, "efficiency"),
             "fill": conf.fill_list(kind, "efficiency"),
         },
         "distribution": {
             "x": conf.x(kind, "distribution"),
             "y": conf.y(kind, "distribution"),
             "h": conf.h(kind, "distribution_bar"),
             "w": conf.w(kind, "distribution_bar"),
             "s": conf.s(kind, "distribution_bar"),
             "ttl": conf.ttl(kind, "distribution"),
             "rgb": conf.rgb_list(kind, "distribution"),
             "fill": conf.fill_list(kind, "distribution"),
         },
     }
     if not conf.panel(kind):
         return
     self.cfg[kind]["panel"] = {
         "x": conf.x(kind, "panel"),
         "y": conf.y(kind, "panel"),
         "x2": conf.x2(kind, "panel"),
         "y2": conf.y2(kind, "panel"),
         "ttl": conf.ttl(kind, "panel"),
         "rgb": conf.rgb(kind, "panel"),
         "fill": conf.fill(kind, "panel")
     }
Exemplo n.º 6
0
    def __init__(self, status, show, parent=0):
        conf = igmconfig.IGMConfig(
            config_file='config/igm_alt_config.v3.ini',
            user_config_file='config/user_igm_alt_config.v3.ini')
        ToggledFrame.__init__(self,
                              parent,
                              label="EDR:",
                              status=status,
                              show=show)
        self.pack(fill="x", expand=1, pady=2, padx=2, anchor="n")
        self.output = tk.Text(self.sub_frame,
                              width=conf.len("general", "body"),
                              height=conf.body_rows("general"),
                              background=conf.rgb("general", "fill"),
                              foreground=conf.rgb("general", "body"),
                              wrap=tk.WORD,
                              padx=4)
        self.output.pack(fill="x", expand=1)

        self.__configure_tags(conf)
        self.toggle()
Exemplo n.º 7
0
    def __init__(self, parent, label, status, show, *args, **options):
        conf = igmconfig.IGMConfig(
            config_file='config/igm_alt_config.v3.ini',
            user_config_file='config/user_igm_alt_config.v3.ini')
        tk.Frame.__init__(self, parent, *args, **options)
        fg = conf.rgb("status", "body")
        bg = conf.rgb("status", "fill")
        self.tk_setPalette(background=bg,
                           foreground=fg,
                           activeBackground=conf.rgb("status", "active_bg"),
                           activeForeground=conf.rgb("status", "active_fg"))

        self.show = show
        self.title_frame = tk.Frame(self)
        self.title_frame.pack(fill="x", expand=1)

        ttk.Separator(self.title_frame, orient=tk.HORIZONTAL).pack(fill="x",
                                                                   expand=1)
        tk.Label(self.title_frame,
                 text=label,
                 foreground=conf.rgb("status", "label")).pack(side="left",
                                                              fill="x",
                                                              expand=0,
                                                              anchor="w")
        self.status_ui = ttkHyperlinkLabel.HyperlinkLabel(self.title_frame,
                                                          textvariable=status,
                                                          foreground=fg,
                                                          background=bg)
        self.status_ui.pack(side="left", fill="x", expand=0, anchor="w")

        self.toggle_button = tk.Checkbutton(self.title_frame,
                                            width=2,
                                            text='+',
                                            command=self.toggle,
                                            variable=self.show,
                                            foreground=conf.rgb(
                                                "status", "check"))
        self.toggle_button.pack(side="right", expand=1, anchor="e")

        self.sub_frame = tk.Frame(self, relief="sunken", borderwidth=1)