コード例 #1
0
def get_last_line_date(buffer):
    date = '1970-01-01 01:00:00'
    infolist = w.infolist_get('buffer_lines', buffer, '')
    while w.infolist_prev(infolist):
        date = w.infolist_time(infolist, 'date')
        if date != '1970-01-01 01:00:00':
        # Some lines like "Day changed to" message doesn't have date 
        # set so loop until we find a message that does
            break
    w.infolist_free(infolist)
    return date
コード例 #2
0
def get_last_line_date(buffer):
    date = "1970-01-01 01:00:00"
    infolist = w.infolist_get("buffer_lines", buffer, "")
    while w.infolist_prev(infolist):
        date = w.infolist_time(infolist, "date")
        if date != "1970-01-01 01:00:00":
            # Some lines like "Day changed to" message doesn't have date
            # set so loop until we find a message that does
            break
    w.infolist_free(infolist)
    return date
コード例 #3
0
ファイル: gre.py プロジェクト: aji/gre
def privmsgs(ptr):
    lines = weechat.infolist_get('buffer_lines', ptr, '')

    chan = weechat.buffer_get_string(ptr, 'localvar_channel')

    while weechat.infolist_prev(lines):
        kind, nick, text = lineextract(lines)

        if kind == 'irc_privmsg':
            yield chan, nick, text

    weechat.infolist_free(lines)
コード例 #4
0
def get_last_line_date(buffer):
    date = '1970-01-01 01:00:00'
    infolist = w.infolist_get('buffer_lines', buffer, '')
    while w.infolist_prev(infolist):
        date = w.infolist_time(infolist, 'date')
        # since WeeChat 2.2, infolist_time returns a long integer instead of
        # a string
        if not isinstance(date, str):
            date = time.strftime('%F %T', time.localtime(int(date)))
        if date != '1970-01-01 01:00:00':
            # Some lines like "Day changed to" message doesn't have date
            # set so loop until we find a message that does
            break
    w.infolist_free(infolist)
    return date
コード例 #5
0
def get_last_line_date(buffer):
    date = '1970-01-01 01:00:00'
    infolist = w.infolist_get('buffer_lines', buffer, '')
    while w.infolist_prev(infolist):
        date = w.infolist_time(infolist, 'date')
        # since WeeChat 2.2, infolist_time returns a long integer instead of
        # a string
        if not isinstance(date, str):
            date = time.strftime('%F %T', time.localtime(int(date)))
        if date != '1970-01-01 01:00:00':
        # Some lines like "Day changed to" message doesn't have date 
        # set so loop until we find a message that does
            break
    w.infolist_free(infolist)
    return date
コード例 #6
0
ファイル: warn.py プロジェクト: 9ary/weechat-scripts
 def prev(self):
     self.cursor = weechat.infolist_prev(self.pointer)
     return self.cursor
コード例 #7
0
ファイル: infos.py プロジェクト: norrs/weechat-plugins
 def prev(self):
     self.cursor = weechat.infolist_prev(self.pointer)
     return self.cursor
コード例 #8
0
def dev_pev(ptr):
    """ prev an infolist """
    if w.infolist_prev(ptr):
        w.prnt("", f"cursor moved to previous item for infolist {ptr}")
    else:
        w.prnt("", f"cursor reached beginning of infolist {ptr}")
コード例 #9
0
ファイル: dev.py プロジェクト: miniCruzer/irc-scripts
def dev_pev(ptr):
    """ prev an infolist """
    if w.infolist_prev(ptr):
        w.prnt("", f"cursor moved to previous item for infolist {ptr}")
    else:
        w.prnt("", f"cursor reached beginning of infolist {ptr}")