本文整理汇总了Python中scal2.locale_man._函数的典型用法代码示例。如果您正苦于以下问题:Python _函数的具体用法?Python _怎么用?Python _使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了_函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, group):
BaseWidgetClass.__init__(self, group)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
hbox = gtk.HBox()
label = gtk.Label(_('Scale'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
pack(hbox, label)
self.scaleCombo = common.Scale10PowerComboBox()
pack(hbox, self.scaleCombo)
pack(self, hbox)
####
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
pack(hbox, label)
self.startSpin = IntSpinButton(-maxStartEnd, maxStartEnd)
pack(hbox, self.startSpin)
pack(self, hbox)
####
hbox = gtk.HBox()
label = gtk.Label(_('End'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
pack(hbox, label)
self.endSpin = IntSpinButton(-maxStartEnd, maxStartEnd)
pack(hbox, self.endSpin)
pack(self, hbox)
示例2: __init__
def __init__(self, group):
NormalGroupWidget.__init__(self, group)
######
hbox = gtk.HBox()
label = gtk.Label(_('VCS Type'))
label.set_alignment(0, 0.5)
self.sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.vcsTypeCombo = gtk.combo_box_new_text()
for name in vcsModuleNames:
self.vcsTypeCombo.append_text(name)## descriptive name FIXME
hbox.pack_start(self.vcsTypeCombo, 0, 0)
self.pack_start(hbox, 0, 0)
######
hbox = gtk.HBox()
label = gtk.Label(_('Directory'))
label.set_alignment(0, 0.5)
self.sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.dirEntry = gtk.Entry()
hbox.pack_start(self.dirEntry, 0, 0)
##
#self.dirBrowse = gtk.Button(_('Browse'))
##
self.pack_start(hbox, 0, 0)
示例3: readLocationData
def readLocationData():
lines = open(dataDir+'/locations.txt').read().split('\n')
cityData = []
country = ''
for l in lines:
p = l.split('\t')
if len(p)<2:
#print(p)
continue
if p[0]=='':
if p[1]=='':
city, lat, lng = p[2:5]
#if country=='Iran':
# print(city)
if len(p)>4:
cityData.append((
country + '/' + city,
_(country) + '/' + _(city),
float(lat),
float(lng)
))
else:
print(country, p)
else:
country = p[1]
return cityData
示例4: __init__
def __init__(self, account=None):
gtk.Dialog.__init__(self)
self.set_title(_('Edit Account') if account else _('Add New Account'))
###
dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), gtk.RESPONSE_CANCEL)
dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.RESPONSE_OK)
##
self.connect('response', lambda w, e: self.hide())
#######
self.account = account
self.activeWidget = None
#######
hbox = gtk.HBox()
combo = gtk.combo_box_new_text()
for cls in event_lib.classes.account:
combo.append_text(cls.desc)
hbox.pack_start(gtk.Label(_('Account Type')), 0, 0)
hbox.pack_start(combo, 0, 0)
hbox.pack_start(gtk.Label(''), 1, 1)
self.vbox.pack_start(hbox, 0, 0)
####
if self.account:
self.isNew = False
combo.set_active(event_lib.classes.account.names.index(self.account.name))
else:
self.isNew = True
defaultAccountTypeIndex = 0
combo.set_active(defaultAccountTypeIndex)
self.account = event_lib.classes.account[defaultAccountTypeIndex]()
self.activeWidget = None
combo.connect('changed', self.typeChanged)
self.comboType = combo
self.vbox.show_all()
self.typeChanged()
示例5: __init__
def __init__(self, event):## FIXME
common.WidgetClass.__init__(self, event)
################
hbox = gtk.HBox()
pack(hbox, gtk.Label(_('Month')))
self.monthCombo = MonthComboBox()
self.monthCombo.build(event.mode)
pack(hbox, self.monthCombo)
pack(hbox, gtk.Label(''), 1, 1)
#pack(self, hbox)
###
#hbox = gtk.HBox()
pack(hbox, gtk.Label(_('Day')))
self.daySpin = DaySpinButton()
pack(hbox, self.daySpin)
pack(hbox, gtk.Label(''), 1, 1)
pack(self, hbox)
###
hbox = gtk.HBox()
self.startYearCheck = gtk.CheckButton(_('Start Year'))
pack(hbox, self.startYearCheck)
self.startYearSpin = YearSpinButton()
pack(hbox, self.startYearSpin)
pack(hbox, gtk.Label(''), 1, 1)
pack(self, hbox)
self.startYearCheck.connect('clicked', self.startYearCheckClicked)
####
self.notificationBox = common.NotificationBox(event)
pack(self, self.notificationBox)
示例6: __init__
def __init__(self, abrivateWeekDays=False):
self.abrivateWeekDays = abrivateWeekDays
self.absWeekNumber = core.getAbsWeekNumberFromJd(ui.cell.jd)## FIXME
gtk.TreeView.__init__(self)
self.set_headers_visible(False)
self.ls = gtk.ListStore(gdk.Pixbuf, str, str, str)## icon, weekDay, time, text
self.set_model(self.ls)
###
cell = gtk.CellRendererPixbuf()
col = gtk.TreeViewColumn(_('Icon'), cell)
col.add_attribute(cell, 'pixbuf', 0)
self.append_column(col)
###
cell = gtk.CellRendererText()
col = gtk.TreeViewColumn(_('Week Day'), cell)
col.add_attribute(cell, 'text', 1)
col.set_resizable(True)
self.append_column(col)
###
cell = gtk.CellRendererText()
col = gtk.TreeViewColumn(_('Time'), cell)
col.add_attribute(cell, 'text', 2)
col.set_resizable(True)## FIXME
self.append_column(col)
###
cell = gtk.CellRendererText()
col = gtk.TreeViewColumn(_('Description'), cell)
col.add_attribute(cell, 'text', 3)
col.set_resizable(True)
self.append_column(col)
示例7: __init__
def __init__(self, group):
self._group = group
gtk.Dialog.__init__(self)
self.set_title(_('Convert Calendar Type'))
####
dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), gtk.RESPONSE_CANCEL)
dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.RESPONSE_OK)
##
self.connect('response', lambda w, e: self.hide())
####
hbox = gtk.HBox()
label = gtk.Label(_('This is going to convert calendar types of all events inside group \"%s\" to a specific type. This operation does not work for Yearly events and also some of Custom events. You have to edit those events manually to change calendar type.')%group.title)
label.set_line_wrap(True)
pack(hbox, label)
pack(hbox, gtk.Label(''), 1, 1)
pack(self.vbox, hbox)
###
hbox = gtk.HBox()
pack(hbox, gtk.Label(_('Calendar Type')+':'))
combo = CalTypeCombo()
combo.set_active(group.mode)
pack(hbox, combo)
pack(hbox, gtk.Label(''), 1, 1)
self.modeCombo = combo
pack(self.vbox, hbox)
####
self.vbox.show_all()
示例8: __init__
def __init__(self, group=None):
gtk.Dialog.__init__(self)
self.isNew = (group is None)
self.set_title(_('Add New Group') if self.isNew else _('Edit Group'))
#self.connect('delete-event', lambda obj, e: self.destroy())
#self.resize(800, 600)
###
dialog_add_button(self, gtk.STOCK_CANCEL, _('_Cancel'), gtk.RESPONSE_CANCEL)
dialog_add_button(self, gtk.STOCK_OK, _('_OK'), gtk.RESPONSE_OK)
self.connect('response', lambda w, e: self.hide())
#######
self.activeWidget = None
#######
hbox = gtk.HBox()
combo = gtk.combo_box_new_text()
for cls in event_lib.classes.group:
combo.append_text(cls.desc)
hbox.pack_start(gtk.Label(_('Group Type')), 0, 0)
hbox.pack_start(combo, 0, 0)
hbox.pack_start(gtk.Label(''), 1, 1)
self.vbox.pack_start(hbox, 0, 0)
####
if self.isNew:
self._group = event_lib.classes.group[event_lib.defaultGroupTypeIndex]()
combo.set_active(event_lib.defaultGroupTypeIndex)
else:
self._group = group
combo.set_active(event_lib.classes.group.names.index(group.name))
self.activeWidget = None
combo.connect('changed', self.typeChanged)
self.comboType = combo
self.vbox.show_all()
self.typeChanged()
示例9: __init__
def __init__(self, module, opt):
t = opt[1]
self.opt = opt ## needed??
self.module = module
self.type = t
self.var_name = opt[0]
hbox = gtk.HBox()
if t==bool:
w = gtk.CheckButton(_(opt[2]))
self.get_value = w.get_active
self.set_value = w.set_active
elif t==list:
hbox.pack_start(gtk.Label(_(opt[2])), 0, 0)
w = gtk.combo_box_new_text() ### or RadioButton
for s in opt[3]:
w.append_text(_(s))
self.get_value = w.get_active
self.set_value = w.set_active
elif t==int:
hbox.pack_start(gtk.Label(_(opt[2])), 0, 0)
w = IntSpinButton(opt[3], opt[4])
self.get_value = w.get_value
self.set_value = w.set_value
elif t==float:
hbox.pack_start(gtk.Label(_(opt[2])), 0, 0)
w = FloatSpinButton(opt[3], opt[4], opt[5])
self.get_value = w.get_value
self.set_value = w.set_value
else:
raise RuntimeError('bad option type "%s"'%t)
hbox.pack_start(w, 0, 0)
self.widget = hbox
####
self.updateVar = lambda: setattr(self.module, self.var_name, self.get_value())
self.updateWidget = lambda: self.set_value(getattr(self.module, self.var_name))
示例10: set_value
def set_value(self, value):
for i, row in enumerate(self.ls):
if row[0] == value:
self.set_active(i)
return
self.ls.append((value, _('%s Years')%_(value)))
self.set_active(len(self.ls)-1)
示例11: __init__
def __init__(self, group):
BaseGroupWidget.__init__(self, group)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
hbox = gtk.HBox()
label = gtk.Label(_('Scale'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.scaleCombo = common.Scale10PowerComboBox()
hbox.pack_start(self.scaleCombo, 0, 0)
self.pack_start(hbox, 0, 0)
####
hbox = gtk.HBox()
label = gtk.Label(_('Start'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.startSpin = IntSpinButton(-maxStartEnd, maxStartEnd)
hbox.pack_start(self.startSpin, 0, 0)
self.pack_start(hbox, 0, 0)
####
hbox = gtk.HBox()
label = gtk.Label(_('End'))
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
self.endSpin = IntSpinButton(-maxStartEnd, maxStartEnd)
hbox.pack_start(self.endSpin, 0, 0)
self.pack_start(hbox, 0, 0)
示例12: onEventLabelPopup
def onEventLabelPopup(self, label, menu, ids):
menu = gtk.Menu()
self.labelMenuAddCopyItems(label, menu)
####
groupId, eventId = ids
event = ui.getEvent(groupId, eventId)
if not event.readOnly:
menu.add(gtk.SeparatorMenuItem())
###
winTitle = _('Edit ') + event.desc
menu.add(labelStockMenuItem(
winTitle,
gtk.STOCK_EDIT,
self.editEventClicked,
winTitle,
event,
groupId,
))
###
menu.add(gtk.SeparatorMenuItem())
###
menu.add(labelImageMenuItem(
_('Move to %s') % ui.eventTrash.title,
ui.eventTrash.icon,
self.moveEventToTrash,
event,
groupId,
))
####
menu.show_all()
menu.popup(None, None, None, 3, 0)
ui.updateFocusTime()
示例13: __init__
def __init__(self, event):
gtk.Expander.__init__(self, _('Notification'))
self.event = event
self.hboxDict = {}
totalVbox = gtk.VBox()
###
hbox = gtk.HBox()
pack(hbox, gtk.Label(_('Notify')+' '))
self.notifyBeforeInput = DurationInputBox()
pack(hbox, self.notifyBeforeInput, 0, 0)
pack(hbox, gtk.Label(' '+_('before event')))
pack(hbox, gtk.Label(), 1, 1)
pack(totalVbox, hbox)
###
for cls in event_lib.classes.notifier:
notifier = cls(self.event)
inputWidget = makeWidget(notifier)
if not inputWidget:
printError('notifier %s, inputWidget = %r'%(cls.name, inputWidget))
continue
hbox = gtk.HBox()
cb = gtk.CheckButton(notifier.desc)
cb.inputWidget = inputWidget
cb.connect('clicked', lambda check: check.inputWidget.set_sensitive(check.get_active()))
cb.set_active(False)
pack(hbox, cb)
hbox.cb = cb
#pack(hbox, gtk.Label(''), 1, 1)
pack(hbox, inputWidget, 1, 1)
hbox.inputWidget = inputWidget
self.hboxDict[notifier.name] = hbox
pack(totalVbox, hbox)
self.add(totalVbox)
示例14: __init__
def __init__(self, event):## FIXME
common.EventWidget.__init__(self, event)
######
sizeGroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
######
try:
seperated = event.parent.showSeperatedYmdInputs
except AttributeError:
seperated = False
if seperated:
self.startDateInput = YearMonthDayBox()
self.endDateInput = YearMonthDayBox()
else:
self.startDateInput = DateButton()
self.endDateInput = DateButton()
######
hbox = gtk.HBox()
label = gtk.Label(_('Start')+': ')
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
hbox.pack_start(self.startDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
######
hbox = gtk.HBox()
label = gtk.Label(_('End')+': ')
label.set_alignment(0, 0.5)
sizeGroup.add_widget(label)
hbox.pack_start(label, 0, 0)
hbox.pack_start(self.endDateInput, 0, 0)
self.pack_start(hbox, 0, 0)
示例15: __init__
def __init__(self, term, **kwargs):
self.term = term
gtk.Dialog.__init__(self, **kwargs)
self.resize(800, 500)
self.set_title(_('View Weekly Schedule'))
self.connect('delete-event', self.onDeleteEvent)
#####
hbox = gtk.HBox()
self.currentWOnlyCheck = gtk.CheckButton(_('Current Week Only'))
self.currentWOnlyCheck.connect('clicked', lambda obj: self.updateWidget())
hbox.pack_start(self.currentWOnlyCheck, 0, 0)
##
hbox.pack_start(gtk.Label(''), 1, 1)
##
button = gtk.Button(_('Export to ')+'SVG')
button.connect('clicked', self.exportToSvgClicked)
hbox.pack_start(button, 0, 0)
##
self.vbox.pack_start(hbox, 0, 0)
#####
self.widget = WeeklyScheduleWidget(term)
self.vbox.pack_start(self.widget, 1, 1)
#####
self.vbox.show_all()
self.updateWidget()