def get_accessable_groups(self): groups = [] for wl in self.attracts.entries: linked_wfn = wl.to group = linked_wfn.get_group() if group not in groups: groups.append(group) for wl in self.attracted.entries: linked_wfn = wl.frm group = linked_wfn.get_group() if group not in groups: groups.append(group) return groups
def get_distinct_groups(self): gids = self.sub.gid.tolist() levels = self.get_distinct(self.db.Value,'level') years = [None] months = [None] days = [None] if 'year' in self.grouping: years = self.get_distinct(self.db.Time,'year') if 'month' in self.grouping: months = self.get_distinct(self.db.Time,'month') if 'day' in self.grouping: days = self.get_distinct(self.db.Time,'day') Group = namedtuple('Group',['gid','level','day','month','year']) groups = [] for gid,level,year,month,day in itertools.product(gids,levels,years,months,days): groups.append(Group(gid=gid,level=level,year=year,day=day,month=month)) return(groups)
def get_distinct_groups(self): gids = self.sub.gid.tolist() levels = self.get_distinct(self.db.Value, 'level') years = [None] months = [None] days = [None] if 'year' in self.grouping: years = self.get_distinct(self.db.Time, 'year') if 'month' in self.grouping: months = self.get_distinct(self.db.Time, 'month') if 'day' in self.grouping: days = self.get_distinct(self.db.Time, 'day') Group = namedtuple('Group', ['gid', 'level', 'day', 'month', 'year']) groups = [] for gid, level, year, month, day in itertools.product( gids, levels, years, months, days): groups.append( Group(gid=gid, level=level, year=year, day=day, month=month)) return (groups)
for i in groups: keys.extend([ # mod1 + letter of group = switch to group Key([mod], i.name, lazy.group[i.name].toscreen()), # mod1 + shift + letter of group = switch to & move focused window to group # Key([mod, "shift"], i.name, lazy.window.togroup(i.name, switch_group=True)), # Or, use below if you prefer not to switch to that group. # # mod1 + shift + letter of group = move focused window to group Key([mod, "shift"], i.name, lazy.window.togroup(i.name)), ]) groups.append( ScratchPad( "scratchpad", [ # define a drop down terminal. # it is placed in the upper third of selfcreen by default. DropDown("term", "xterm", height=0.5), DropDown("org", "emacs", height=0.5), ])) layouts = [ layout.Max(), layout.Stack(num_stacks=2, border_focus=border_color, border_width=2), layout.MonadTall(border_focus=border_color, border_width=2), layout.MonadWide(border_focus=border_color, border_width=2), layout.TreeTab(border_focus=border_color, border_width=2), ] screens = screens.init_screens(border_color) # Drag floating layouts.