• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python i18n._函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中taskcoachlib.i18n._函数的典型用法代码示例。如果您正苦于以下问题:Python _函数的具体用法?Python _怎么用?Python _使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了_函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: fillInterior

    def fillInterior(self):
        self._templateList = wx.ListCtrl(self._interior, wx.ID_ANY, style=wx.LC_REPORT)
        self._templateList.InsertColumn(0, _('Template'))
        self._templateList.Bind(wx.EVT_LIST_ITEM_SELECTED, self.OnSelectionChanged)
        self._templateList.Bind(wx.EVT_LIST_ITEM_DESELECTED, self.OnSelectionChanged)

        self._loadTemplates()

        for task, name in self.tasks:
            self._templateList.InsertStringItem(self._templateList.GetItemCount(), task.subject())

        self._templateList.SetColumnWidth(0, -1)

        self._btnDelete = wx.Button(self._interior, wx.ID_ANY, _("Delete"))
        self._btnDelete.Bind(wx.EVT_BUTTON, self.OnDelete)
        self._btnDelete.Enable(False)

        self._btnUp = wx.BitmapButton(self._interior, wx.ID_ANY,
                                     wx.ArtProvider.GetBitmap('arrow_up_icon', size=(32, 32)))
        self._btnUp.Bind(wx.EVT_BUTTON, self.OnUp)
        self._btnUp.Enable(False)

        self._btnDown = wx.BitmapButton(self._interior, wx.ID_ANY,
                                       wx.ArtProvider.GetBitmap('arrow_down_icon', size=(32, 32)))
        self._btnDown.Bind(wx.EVT_BUTTON, self.OnDown)
        self._btnDown.Enable(False)

        hsz = wx.BoxSizer(wx.HORIZONTAL)
        hsz.Add(self._templateList, 1, wx.EXPAND|wx.ALL, 3)
        vsz = wx.BoxSizer(wx.VERTICAL)
        vsz.Add(self._btnDelete, 0, wx.ALL, 3)
        vsz.Add(self._btnUp, 0, wx.ALL|wx.ALIGN_CENTRE, 3)
        vsz.Add(self._btnDown, 0, wx.ALL|wx.ALIGN_CENTRE, 3)
        hsz.Add(vsz, 0, wx.ALL, 3)
        self._interior.SetSizer(hsz)
开发者ID:asone77,项目名称:taskcoach,代码行数:35,代码来源:templates.py


示例2: SetOptions

    def SetOptions(self, options):
        self.options = options

        if self.interior.GetSizer():
            self.interior.GetSizer().Clear(True)

        for child in self.interior.GetChildren():
            self.interior.RemoveChild(child)
        self.choices = []

        gsz = wx.FlexGridSizer(0, 2, 4, 2)
        
        gsz.Add(wx.StaticText(self.interior, wx.ID_ANY, _('Column header in CSV file')))
        gsz.Add(wx.StaticText(self.interior, wx.ID_ANY, _('%s attribute')%meta.name))
        gsz.AddSpacer((3,3))
        gsz.AddSpacer((3,3))
        tcFieldNames = [field[0] for field in self.fields]
        for fieldName in options['fields']:
            gsz.Add(wx.StaticText(self.interior, wx.ID_ANY, fieldName), flag=wx.ALIGN_CENTER_VERTICAL)
            
            choice = wx.Choice(self.interior, wx.ID_ANY)
            for tcFieldName in tcFieldNames:
                choice.Append(tcFieldName)
            choice.SetSelection(self.findFieldName(fieldName, tcFieldNames))
            self.choices.append(choice)

            gsz.Add(choice, flag=wx.ALIGN_CENTER_VERTICAL)

        gsz.AddGrowableCol(1)
        self.interior.SetSizer(gsz)
        gsz.Layout()
开发者ID:dfainstein,项目名称:seng_taskcoach,代码行数:31,代码来源:csvimport.py


示例3: __init__

 def __init__(self, taskBarIcon, settings, taskFile, viewer):
     super(TaskBarMenu, self).__init__(taskBarIcon)
     tasks = taskFile.tasks()
     efforts = taskFile.efforts()
     self.appendUICommands(
         uicommand.TaskNew(taskList=tasks, settings=settings))
     self.appendMenu(_('New task from &template'),
         TaskTemplateMenu(taskBarIcon, taskList=tasks, settings=settings),
         'newtmpl')
     self.appendUICommands(None)  # Separator
     self.appendUICommands(
         uicommand.EffortNew(effortList=efforts, taskList=tasks, 
                             settings=settings),
         uicommand.CategoryNew(categories=taskFile.categories(), 
                               settings=settings),
         uicommand.NoteNew(notes=taskFile.notes(), settings=settings))
     self.appendUICommands(None)  # Separator
     label = _('&Start tracking effort')
     self.appendMenu(label,
         StartEffortForTaskMenu(taskBarIcon, 
                                base.filter.DeletedFilter(tasks), 
                                self, label), 'clock_icon')
     self.appendUICommands(uicommand.EffortStop(viewer=viewer,
                                                effortList=efforts,
                                                taskList=tasks))
     self.appendUICommands(
         None,
         uicommand.MainWindowRestore(),
         uicommand.FileQuit())
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:29,代码来源:menu.py


示例4: summary

 def summary(self):
     if self.__handle is not None:
         self.close()
         if operating_system.isWindows():
             wx.MessageBox(_('Errors have occured. Please see "taskcoachlog.txt" in your "My Documents" folder.'), _('Error'), wx.OK)
         else:
             wx.MessageBox(_('Errors have occured. Please see "%s"') % self.__path, _('Error'), wx.OK)
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:7,代码来源:application.py


示例5: _createColumns

 def _createColumns(self):
     # pylint: disable-msg=W0142
     kwargs = dict(renderDescriptionCallback=lambda category: category.description(),
                   resizeCallback=self.onResizeColumn)
     columns = [widgets.Column('subject', _('Subject'), 
                    category.Category.subjectChangedEventType(),  
                    sortCallback=uicommand.ViewerSortByCommand(viewer=self,
                        value='subject'),
                    imageIndexCallback=self.subjectImageIndex,
                    width=self.getColumnWidth('subject'), 
                    **kwargs),
                widgets.Column('description', _('Description'), 
                    category.Category.descriptionChangedEventType(), 
                    sortCallback=uicommand.ViewerSortByCommand(viewer=self,
                        value='description'),
                    renderCallback=lambda category: category.description(), 
                    width=self.getColumnWidth('description'), 
                    **kwargs),
                widgets.Column('attachments', '', 
                    category.Category.attachmentsChangedEventType(), # pylint: disable-msg=E1101
                    width=self.getColumnWidth('attachments'),
                    alignment=wx.LIST_FORMAT_LEFT,
                    imageIndexCallback=self.attachmentImageIndex,
                    headerImageIndex=self.imageIndex['paperclip_icon'],
                    renderCallback=lambda category: '', **kwargs)]
     if self.settings.getboolean('feature', 'notes'):
         columns.append(widgets.Column('notes', '', 
                    category.Category.notesChangedEventType(), # pylint: disable-msg=E1101
                    width=self.getColumnWidth('notes'),
                    alignment=wx.LIST_FORMAT_LEFT,
                    imageIndexCallback=self.noteImageIndex,
                    headerImageIndex=self.imageIndex['note_icon'],
                    renderCallback=lambda category: '', **kwargs))
     return columns
开发者ID:asone77,项目名称:taskcoach,代码行数:34,代码来源:category.py


示例6: __init__

 def __init__(self, *args, **kwargs):
     super(TaskReminderPage, self).__init__(columns=3, growableColumn=-1, 
                                            *args, **kwargs)
     names = []  # There's at least one, the universal one
     for name in notify.AbstractNotifier.names():
         names.append((name, name))
     self.addChoiceSetting('feature', 'notifier', 
                           _('Notification system to use for reminders'), 
                           '', names, flags=(None, wx.ALL | wx.ALIGN_LEFT))
     if operating_system.isMac() or operating_system.isGTK():
         self.addBooleanSetting('feature', 'sayreminder', 
                                _('Let the computer say the reminder'),
                                _('(Needs espeak)') if operating_system.isGTK() else '',
                                flags=(None, wx.ALL | wx.ALIGN_LEFT, 
                                       wx.ALL | wx.ALIGN_LEFT | wx.ALIGN_CENTER_VERTICAL))
     snoozeChoices = [(str(choice[0]), choice[1]) for choice in date.snoozeChoices]
     self.addChoiceSetting('view', 'defaultsnoozetime', 
                           _('Default snooze time to use after reminder'), 
                           '', snoozeChoices, flags=(None, 
                                                     wx.ALL | wx.ALIGN_LEFT))
     self.addMultipleChoiceSettings('view', 'snoozetimes', 
         _('Snooze times to offer in task reminder dialog'), 
         date.snoozeChoices[1:], 
         flags=(wx.ALIGN_TOP | wx.ALL, None))  # Don't offer "Don't snooze" as a choice
     self.fit()
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:25,代码来源:preferences.py


示例7: __restore_perspective

    def __restore_perspective(self):
        perspective = self.settings.get('view', 'perspective')
        for viewer_type in viewer.viewerTypes():
            if self.__perspective_and_settings_viewer_count_differ(viewer_type):
                # Different viewer counts may happen when the name of a viewer 
                # is changed between versions
                perspective = ''
                break

        try:
            self.manager.LoadPerspective(perspective)
        except ValueError, reason:
            # This has been reported to happen. Don't know why. Keep going
            # if it does.
            if self.__splash:
                self.__splash.Destroy()
            wx.MessageBox(_('''Couldn't restore the pane layout from TaskCoach.ini:
%s

The default pane layout will be used.

If this happens again, please make a copy of your TaskCoach.ini file '''
'''before closing the program, open a bug report, and attach the '''
'''copied TaskCoach.ini file to the bug report.''') % reason,
            _('%s settings error') % meta.name, style=wx.OK | wx.ICON_ERROR)
            self.manager.LoadPerspective('')
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:26,代码来源:mainwindow.py


示例8: validateDrag

    def validateDrag(self, dropItem, dragItems, columnIndex):
        if columnIndex == -1 or self.visibleColumns()[columnIndex].name() != 'ordering':
            return None # Normal behavior

        # Ordering

        if not self.isTreeViewer():
            return True

        # Tree mode. Only allow drag if all selected items are siblings.
        if len(set([item.parent() for item in dragItems])) >= 2:
            wx.GetTopLevelParent(self).AddBalloonTip(self.settings, 'treemanualordering', self,
                title=_('Reordering in tree mode'),
                getRect=lambda: wx.Rect(0, 0, 28, 16),
                message=_('''When in tree mode, manual ordering is only possible when all selected items are siblings.'''))
            return False

        # If they are, only allow drag at the same level
        if dragItems[0].parent() != (None if dropItem is None else dropItem.parent()):
            wx.GetTopLevelParent(self).AddBalloonTip(self.settings, 'treechildrenmanualordering', self,
                title=_('Reordering in tree mode'),
                getRect=lambda: wx.Rect(0, 0, 28, 16),
                message=_('''When in tree mode, you can only put objects at the same level (parent).'''))
            return False

        return True
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:26,代码来源:base.py


示例9: __init__

    def __init__(self, parent):
        super(SyncMLWarningDialog, self).__init__(parent, wx.ID_ANY, _("Compatibility warning"))

        textWidget = wx.StaticText(
            self,
            wx.ID_ANY,
            _(
                "The SyncML feature is disabled, because the module\n"
                "could not be loaded. This may be because your platform\n"
                "is not supported, or under Windows, you may be missing\n"
                "some mandatory DLLs. Please see the SyncML section of\n"
                'the online help for details (under "Troubleshooting").'
            ),
        )
        self.checkbox = wx.CheckBox(self, wx.ID_ANY, _("Never show this dialog again"))
        self.checkbox.SetValue(True)
        button = wx.Button(self, wx.ID_ANY, _("OK"))

        sizer = wx.BoxSizer(wx.VERTICAL)
        sizer.Add(textWidget, 0, wx.ALL, 10)
        sizer.Add(self.checkbox, 0, wx.ALL, 3)
        sizer.Add(button, 0, wx.ALL | wx.ALIGN_CENTRE, 3)

        self.SetSizer(sizer)

        wx.EVT_BUTTON(button, wx.ID_ANY, self.OnOK)
        wx.EVT_CLOSE(self, self.OnOK)

        self.Fit()
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:29,代码来源:syncmlwarning.py


示例10: __setTooltipText

 def __setTooltipText(self):
     ''' Note that Windows XP and Vista limit the text shown in the
         tool tip to 64 characters, so we cannot show everything we would
         like to and have to make choices. '''
     textParts = []              
     trackedTasks = self.__taskList.tasksBeingTracked()
     if trackedTasks:
         count = len(trackedTasks)
         if count == 1:
             tracking = _('tracking "%s"')%trackedTasks[0].subject()
         else:
             tracking = _('tracking effort for %d tasks')%count
         textParts.append(tracking)
     else:
         for getCountMethodName, singular, plural in self.toolTipMessages:
             count = getattr(self.__taskList, getCountMethodName)()
             if count == 1:
                 textParts.append(singular)
             elif count > 1:
                 textParts.append(plural%count)
             
     text = ', '.join(textParts)
     text = u'%s - %s'%(meta.name, text) if text else meta.name
     
     if text != self.__tooltipText:
         self.__tooltipText = text
         self.__setIcon() # Update tooltip
开发者ID:asone77,项目名称:taskcoach,代码行数:27,代码来源:taskbaricon.py


示例11: createTemplateEntries

 def createTemplateEntries(self, pane):
     panel = self._editPanel = sized_controls.SizedPanel(pane)
     panel.SetSizerType('form')
     panel.SetSizerProps(expand=True)
     label = wx.StaticText(panel, label=_('Subject'))
     label.SetSizerProps(valign='center')
     self._subjectCtrl = wx.TextCtrl(panel)
     label = wx.StaticText(panel, label=_('Planned start date'))
     label.SetSizerProps(valign='center')
     self._plannedStartDateTimeCtrl = TimeExpressionEntry(panel)
     label = wx.StaticText(panel, label=_('Due date'))
     label.SetSizerProps(valign='center')
     self._dueDateTimeCtrl = TimeExpressionEntry(panel)
     label = wx.StaticText(panel, label=_('Completion date'))
     label.SetSizerProps(valign='center')
     self._completionDateTimeCtrl = TimeExpressionEntry(panel)
     label = wx.StaticText(panel, label=_('Reminder'))
     label.SetSizerProps(valign='center')
     self._reminderDateTimeCtrl = TimeExpressionEntry(panel)
     self._taskControls = (self._subjectCtrl, self._plannedStartDateTimeCtrl, self._dueDateTimeCtrl,
                           self._completionDateTimeCtrl, self._reminderDateTimeCtrl)
     for ctrl in self._taskControls:
         ctrl.SetSizerProps(valign='center', expand=True)
         ctrl.Bind(wx.EVT_TEXT, self.onValueChanged)
     self.enableEditPanel(False)
     panel.Fit()
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:26,代码来源:templates.py


示例12: addColorEntry

 def addColorEntry(self):
     currentColor = self._category.color(recursive=False)
     self._checkBox = wx.CheckBox(self, label=_("Use this color:"))
     self._checkBox.SetValue(currentColor is not None)
     self._colorButton = wx.ColourPickerCtrl(self, -1, currentColor or wx.WHITE, size=(40, -1))
     self._colorButton.Bind(wx.EVT_COLOURPICKER_CHANGED, lambda event: self._checkBox.SetValue(True))
     self.addEntry(_("Color"), self._checkBox, self._colorButton)
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:7,代码来源:editor.py


示例13: addStartAndStopEntries

    def addStartAndStopEntries(self):
        starthour = self._settings.getint("view", "efforthourstart")
        endhour = self._settings.getint("view", "efforthourend")
        interval = self._settings.getint("view", "effortminuteinterval")
        self._startEntry = widgets.DateTimeCtrl(
            self,
            self._effort.getStart(),
            self.onPeriodChanged,
            noneAllowed=False,
            starthour=starthour,
            endhour=endhour,
            interval=interval,
        )
        startFromLastEffortButton = wx.Button(self, label=_("Start tracking from last stop time"))
        self.Bind(wx.EVT_BUTTON, self.onStartFromLastEffort, startFromLastEffortButton)
        if self._effortList.maxDateTime() is None:
            startFromLastEffortButton.Disable()

        self._stopEntry = widgets.DateTimeCtrl(
            self,
            self._effort.getStop(),
            self.onPeriodChanged,
            noneAllowed=True,
            starthour=starthour,
            endhour=endhour,
            interval=interval,
        )

        flags = [None, wx.ALIGN_RIGHT | wx.ALL, wx.ALIGN_LEFT | wx.ALL, None]
        self.addEntry(_("Start"), self._startEntry, startFromLastEffortButton, flags=flags)
        self.addEntry(_("Stop"), self._stopEntry, "", flags=flags)
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:31,代码来源:editor.py


示例14: __init__

    def __init__(self, *args, **kwargs):
        super(SyncMLAccessPage, self).__init__(*args, **kwargs)

        self.addTextSetting('access', 'syncUrl', _('SyncML server URL'))
        self.addTextSetting('access', 'username', _('User name/ID'))

        self.fit()
开发者ID:asone77,项目名称:taskcoach,代码行数:7,代码来源:syncpreferences.py


示例15: __DisplayBalloon

 def __DisplayBalloon(self):
     # AuiFloatingFrame is instantiated from framemanager, we can't derive it from BalloonTipManager
     if self.toolbar.IsShownOnScreen() and hasattr(wx.GetTopLevelParent(self), 'AddBalloonTip'):
         wx.GetTopLevelParent(self).AddBalloonTip(self.settings, 'customizabletoolbars', self.toolbar,
             title=_('Toolbars are customizable'),
             getRect=lambda: self.toolbar.GetToolRect(self.toolbar.getToolIdByCommand('EditToolBarPerspective')),
             message=_('''Click on the gear icon on the right to add buttons and rearrange them.'''))
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:7,代码来源:base.py


示例16: __askOpenUnlocked

 def __askOpenUnlocked(self, filename):
     result = wx.MessageBox(_('Cannot acquire a lock because locking is not '
         'supported\non the location of %s.\n'
         'Open %s unlocked?') % (filename, filename), 
          _('%s: file locked') % meta.name,
         style=wx.YES_NO | wx.ICON_QUESTION | wx.NO_DEFAULT)
     return result == wx.YES
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:7,代码来源:iocontroller.py


示例17: updateRecurrenceLabel

 def updateRecurrenceLabel(self):
     recurrenceDict = {0: _('period,'), 1: _('day(s),'), 2: _('week(s),'),
                       3: _('month(s),'), 4: _('year(s),')}
     recurrenceLabel = recurrenceDict[self._recurrencePeriodEntry.Selection]
     self._recurrenceStaticText.SetLabel(recurrenceLabel)
     self._recurrenceSameWeekdayCheckBox.Enable(self._recurrencePeriodEntry.Selection in (3, 4))
     self._recurrenceSizer.Layout()
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:7,代码来源:entry.py


示例18: __warn_user_that_ini_file_was_not_loaded

 def __warn_user_that_ini_file_was_not_loaded(self):
     from taskcoachlib import meta
     reason = self.settings.get('file', 'inifileloaderror')
     wx.MessageBox(\
         _("Couldn't load settings from TaskCoach.ini:\n%s") % reason,
         _('%s file error') % meta.name, style=wx.OK | wx.ICON_ERROR)
     self.settings.setboolean('file', 'inifileloaded', True)  # Reset
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:7,代码来源:application.py


示例19: AttachmentSelector

def AttachmentSelector(**callerKeywordArguments):
    kwargs = {'message': _('Add attachment'),
              'default_path': os.getcwd(), 
              'wildcard': _('All files (*.*)|*'), 
              'flags': wx.FD_OPEN}
    kwargs.update(callerKeywordArguments)
    return wx.FileSelector(**kwargs)  # pylint: disable=W0142
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:7,代码来源:dialog.py


示例20: __init__

    def __init__(self, url):
        """url is the internal reference to the mail, as collected
        through drag-n-drop."""

        mt = _RX_MAILBOX.search(url)
        if mt is None:
            raise RuntimeError(_('Malformed Thunderbird internal ID: %s. Please file a bug report.') % url)

        self.url = url

        # The url has the form
        # mailbox-message://<username>@<hostname>//<filename>#<id>. Or
        # so I hope.

        config = loadPreferences()

        self.user = unquote(mt.group(1))
        self.server = unquote(mt.group(2))
        self.path = unquote(mt.group(3)).split('/')
        self.offset = long(mt.group(4))

        for i in xrange(200):
            base = 'mail.server.server%d' % i
            if config.has_key('%s.userName' % base):
                if config['%s.userName' % base] == self.user and config['%s.hostname' % base] == self.server:
                    self.filename = os.path.join(config['%s.directory' % base], *tuple(self.path))
                    break
        else:
            raise RuntimeError(_('Could not find directory for ID %s. Please file a bug report.') % url)

        self.fp = file(self.filename, 'rb')
        self.fp.seek(self.offset)

        self.done = False
开发者ID:asone77,项目名称:taskcoach,代码行数:34,代码来源:thunderbird.py



注:本文中的taskcoachlib.i18n._函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python operating_system.isGTK函数代码示例发布时间:2022-05-27
下一篇:
Python templates.Templates类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap