Пример #1
0
def getCommitList(obj, startJd=None, endJd=None):
    '''
        returns a list of (epoch, commit_id) tuples
    '''
    cmd = [
        'git',
        '--git-dir', join(obj.vcsDir, '.git'),
        'log',
        '--pretty=format:%ct %H',
    ]
    if startJd is not None:
        cmd += [
            '--since',
            dateEncode(jd_to(startJd, DATE_GREG)),
        ]
    if endJd is not None:
        cmd += [
            '--until',
            dateEncode(jd_to(endJd, DATE_GREG)),
        ]
    p = Popen(cmd, stdout=PIPE)
    p.wait()
    data = []
    for line in p.stdout:
        parts = line.strip().split(' ')
        data.append((
            int(parts[0]),
            parts[1],
        ))
    return data
Пример #2
0
from scal2 import core
from scal2.locale_man import tr as _
from scal2.locale_man import textNumEncode, textNumDecode
from scal2.date_utils import dateEncode, dateDecode

from scal2 import event_lib
from scal2 import ui

import gtk
from gtk import gdk

from scal2.ui_gtk.utils import toolButtonFromStock, set_tooltip

## FIXME
encode = lambda d: textNumEncode(dateEncode(d))
decode = lambda s: dateDecode(textNumDecode(s))
validate = lambda s: encode(decode(s))

class RuleWidget(gtk.HBox):
    def __init__(self, rule):
        self.rule = rule
        gtk.HBox.__init__(self)
        ###
        self.countLabel = gtk.Label('')
        self.pack_start(self.countLabel, 0, 0)
        ###
        self.editButton = gtk.Button(_('Edit'))
        self.editButton.set_image(gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_BUTTON))
        self.editButton.connect('clicked', self.showDialog)
        self.pack_start(self.editButton, 0, 0)
Пример #3
0
# with this program. If not, see <http://www.gnu.org/licenses/gpl.txt>.
# Also avalable in /usr/share/common-licenses/GPL on Debian systems
# or /usr/share/licenses/common/GPL3/license.txt on ArchLinux

from scal2 import core
from scal2.date_utils import dateEncode, dateDecode
from scal2.locale_man import tr as _
from scal2.locale_man import textNumEncode, textNumDecode
from scal2 import event_lib
from scal2 import ui

from scal2.ui_gtk import *
from scal2.ui_gtk.utils import toolButtonFromStock, set_tooltip

## FIXME
encode = lambda d: textNumEncode(dateEncode(d))
decode = lambda s: dateDecode(textNumDecode(s))
validate = lambda s: encode(decode(s))


class WidgetClass(gtk.HBox):
    def __init__(self, rule):
        self.rule = rule
        gtk.HBox.__init__(self)
        ###
        self.countLabel = gtk.Label('')
        pack(self, self.countLabel)
        ###
        self.editButton = gtk.Button(_('Edit'))
        self.editButton.set_image(
            gtk.image_new_from_stock(gtk.STOCK_EDIT, gtk.ICON_SIZE_BUTTON))