def __init__(self, parent, commit, show_full_msg=False): self.commit = commit Table.__init__(self, parent, padding=(5,5)) self.show() pic = GravatarPict(self) pic.size_hint_align = 0.0, 0.0 pic.email_set(commit.author_email) self.pack(pic, 0, 0, 1, 1) pic.show() if commit.committer and commit.committer != commit.author: committed = '<name>Committed by:</name> <b>{}</b><br>'.format( commit.committer) else: committed = '' text = '<name>{}</name> <b>{}</b> {}<br>{}<br>{}'.format( commit.sha[:9], commit.author, format_date(commit.commit_date), committed, utf8_to_markup(commit.title)) if show_full_msg: text += '<br><br>{}'.format(utf8_to_markup(commit.message)) en = Entry(self, text=text, line_wrap=ELM_WRAP_NONE, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.pack(en, 1, 0, 1, 1) en.show()
def __init__(self, parent, *args, **kargs): self.repo = None self.win = parent self.themef = theme_file_get() self.colors = [(0,100,0,100), (0,0,100,100), (100,0,0,100), (100,100,0,100), (0,100,100,100), (100,0,100,100)] Table.__init__(self, parent, homogeneous=True, padding=(0,0))
def __init__(self, parent_widget, titles=None, initial_sort=0, ascending=True, *args, **kwargs): self.header = titles self.sort_column = initial_sort self.sort_column_ascending = ascending self.rows = [] self.header_row = [] Table.__init__(self, parent_widget, *args, **kwargs) if titles is not None: self.header_row_pack(titles)
def __init__(self, parent, app): self.app = app self.commit = None self.win = parent Table.__init__(self, parent, padding=(5,5)) self.show() # description entry self.entry = Entry(self, text='Unknown', line_wrap=ELM_WRAP_MIXED, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, editable=False) self.pack(self.entry, 0, 0, 1, 1) self.entry.show() # gravatar picture self.picture = GravatarPict(self) self.picture.size_hint_align = 1.0, 0.0 self.picture.show() self.pack(self.picture, 1, 0, 1, 1) # action buttons box self.action_box = Box(self, horizontal=True, size_hint_weight=EXPAND_HORIZ, size_hint_align=(1.0, 1.0)) self.pack(self.action_box, 0, 1, 2, 1) self.action_box.show() # panes panes = Panes(self, content_left_size = 0.3, horizontal=True, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.pack(panes, 0, 2, 2, 1) panes.show() # file list self.itc = GenlistItemClass(item_style='default', text_get_func=self._gl_text_get, content_get_func=self._gl_content_get) self.diff_list = Genlist(self, homogeneous=True, mode=ELM_LIST_COMPRESS, select_mode=ELM_OBJECT_SELECT_MODE_ALWAYS, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.diff_list.callback_selected_add(self._list_selected_cb) panes.part_content_set('left', self.diff_list) # diff entry self.diff_entry = DiffedEntry(self) panes.part_content_set('right', self.diff_entry)
def __init__(self, parent, repo): self.repo = repo self.commit = None self.win = parent Table.__init__(self, parent, padding=(5,5)) self.show() # gravatar picture self.picture = GravatarPict(self) self.picture.size_hint_align = 0.0, 0.0 self.picture.show() self.pack(self.picture, 0, 0, 1, 2) # description entry self.entry = Entry(self, text="Unknown", line_wrap=ELM_WRAP_MIXED, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, editable=False) self.pack(self.entry, 1, 0, 1, 1) self.entry.show() # action buttons box self.action_box = Box(self, horizontal=True, size_hint_weight=EXPAND_HORIZ, size_hint_align=(0.98, 0.98)) self.pack(self.action_box, 1, 1, 1, 1) self.action_box.show() # panes panes = Panes(self, content_left_size = 0.3, horizontal=True, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.pack(panes, 0, 2, 2, 1) panes.show() # file list self.diff_list = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.diff_list.callback_selected_add(self.change_selected_cb) panes.part_content_set("left", self.diff_list) # diff entry self.diff_entry = DiffedEntry(self) panes.part_content_set("right", self.diff_entry)
def __init__(self, parent, repo, commit): self.repo = repo self.commit = commit Table.__init__(self, parent, padding=(5,5)) self.show() pic = GravatarPict(self) pic.email_set(commit.author_email) self.pack(pic, 0, 0, 1, 1) pic.show() text = u'<name>{}</name> <b>{}</b> {}<br><br>{}'.format(commit.sha[:9], commit.author, format_date(commit.commit_date), commit.title) en = Entry(self, text=text) en.line_wrap = ELM_WRAP_NONE en.size_hint_weight = EXPAND_BOTH en.size_hint_align = FILL_BOTH self.pack(en, 1, 0, 1, 1) en.show()
def __init__(self, parent, min_size=(0,0)): Table.__init__(self, parent, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH) self._entry = Entry(self, scrollable=True, editable=False, line_wrap=ELM_WRAP_NONE, size_hint_expand=EXPAND_BOTH, size_hint_fill=FILL_BOTH) self._wheel = Progressbar(self, style='wheel', pulse_mode=True, size_hint_expand=EXPAND_BOTH) self._rect = Rectangle(self.evas, size_hint_min=min_size, size_hint_expand=EXPAND_BOTH, color=(0,0,0,0)) self.pack(self._entry, 0, 0, 1, 1) self.pack(self._rect, 0, 0, 1, 1) self.pack(self._wheel, 0, 0, 1, 1) self._last_was_carriage = False self._entry.show() self._rect.show() self.show()
def __init__(self, parent, session): Table.__init__(self, parent) self.session = session s = session.status() self.padding = 5, 5 ses_pause_ic = self.ses_pause_ic = Icon(parent) ses_pause_ic.size_hint_align = -1.0, -1.0 try: if session.is_paused(): ses_pause_ic.standard = "player_pause" else: ses_pause_ic.standard = "player_play" except RuntimeError: self.log.debug("Setting session ic failed") self.pack(ses_pause_ic, 1, 0, 1, 1) ses_pause_ic.show() title_l = Label(parent) title_l.text = "<b>Session</b>" self.pack(title_l, 0, 0, 1, 1) title_l.show() d_ic = Icon(parent) try: d_ic.standard = "down" except RuntimeError: self.log.debug("Setting d_ic failed") d_ic.size_hint_align = -1.0, -1.0 self.pack(d_ic, 0, 2, 1, 1) d_ic.show() d_l = self.d_l = Label(parent) d_l.text = "{}/s".format(intrepr(s.payload_download_rate)) self.pack(d_l, 1, 2, 1, 1) d_l.show() u_ic = Icon(self) try: u_ic.standard = "up" except RuntimeError: self.log.debug("Setting u_ic failed") u_ic.size_hint_align = -1.0, -1.0 self.pack(u_ic, 0, 3, 1, 1) u_ic.show() u_l = self.u_l = Label(parent) u_l.text = "{}/s".format(intrepr(s.payload_upload_rate)) self.pack(u_l, 1, 3, 1, 1) u_l.show() peer_t = Label(parent) peer_t.text = "Peers" self.pack(peer_t, 0, 4, 1, 1) peer_t.show() peer_l = self.peer_l = Label(parent) peer_l.text = str(s.num_peers) self.pack(peer_l, 1, 4, 1, 1) peer_l.show() self.show() self.update_timer = Timer(1.0, self.update)