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

Python operating_system.isGTK函数代码示例

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

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



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

示例1: __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


示例2: __init__

 def __init__(self, parent, *args, **kwargs):
     super(BaseTextCtrl, self).__init__(parent, -1, *args, **kwargs)
     self.__data = None
     if operating_system.isGTK() or operating_system.isMac():
         if operating_system.isGTK():
             self.Bind(wx.EVT_KEY_DOWN, self.__on_key_down)
         self.Bind(wx.EVT_KILL_FOCUS, self.__on_kill_focus)
         self.__initial_value = self.GetValue()
         self.__undone_value = None
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:9,代码来源:textctrl.py


示例3: quitApplication

    def quitApplication(self, force=False):
        if not self.iocontroller.close(force=force):
            return False
        # Remember what the user was working on: 
        self.settings.set('file', 'lastfile', self.taskFile.lastFilename())
        self.mainwindow.save_settings()
        self.settings.save()
        if hasattr(self, 'taskBarIcon'):
            self.taskBarIcon.RemoveIcon()
        if self.mainwindow.bonjourRegister is not None:
            self.mainwindow.bonjourRegister.stop()
        from taskcoachlib.domain import date 
        date.Scheduler().shutdown()
        self.__wx_app.ProcessIdle()

        # For PowerStateMixin
        self.mainwindow.OnQuit()

        if operating_system.isGTK() and self.sessionMonitor is not None:
            self.sessionMonitor.stop()

        if isinstance(sys.stdout, RedirectedOutput):
            sys.stdout.summary()

        self.__wx_app.ExitMainLoop()
        return True
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:26,代码来源:application.py


示例4: __init__

    def __init__(self, parent, title, bitmap='edit', 
                 direction=None, *args, **kwargs):
        self._buttonTypes = kwargs.get('buttonTypes', wx.OK | wx.CANCEL)
        super(Dialog, self).__init__(parent, -1, title,
            style=wx.DEFAULT_DIALOG_STYLE | wx.RESIZE_BORDER | wx.MAXIMIZE_BOX | wx.MINIMIZE_BOX)
        self.SetIcon(wx.ArtProvider_GetIcon(bitmap, wx.ART_FRAME_ICON,
            (16, 16)))

        if operating_system.isWindows7_OrNewer():
            # Without this the window has no taskbar icon on Windows, and the focus comes back to the main
            # window instead of this one when returning to Task Coach through Alt+Tab. Which is probably not
            # what we want.
            import win32gui, win32con
            exStyle = win32gui.GetWindowLong(self.GetHandle(), win32con.GWL_EXSTYLE)
            win32gui.SetWindowLong(self.GetHandle(), win32con.GWL_EXSTYLE, exStyle|win32con.WS_EX_APPWINDOW)

        self._panel = self.GetContentsPane()
        self._panel.SetSizerType('vertical')
        self._panel.SetSizerProps(expand=True, proportion=1)
        self._direction = direction
        self._interior = self.createInterior()
        self._interior.SetSizerProps(expand=True, proportion=1)
        self.fillInterior()
        self._buttons = self.createButtons()
        self._panel.Fit()
        self.Fit()
        self.CentreOnParent()
        if not operating_system.isGTK():
            wx.CallAfter(self.Raise)
        wx.CallAfter(self._panel.SetFocus)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:30,代码来源:dialog.py


示例5: _SetSelection

 def _SetSelection(self, start, end):
     if operating_system.isGTK():  # pragma: no cover
         # By exchanging the start and end parameters we make sure that the 
         # cursor is at the start of the field so that typing overwrites the 
         # current field instead of moving to the next field:
         start, end = end, start
     super(FixOverwriteSelectionMixin, self)._SetSelection(start, end)
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:7,代码来源:masked.py


示例6: __init__

 def __init__(self):
     if operating_system.isMac():
         self.__binary = 'say'
     elif operating_system.isGTK():
         self.__binary = 'espeak'
     self.__texts_to_say = []
     self.__current_speech_process = None
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:7,代码来源:speaker.py


示例7: pathToDocumentsDir

 def pathToDocumentsDir():
     if operating_system.isWindows():
         from win32com.shell import shell, shellcon
         try:
             return shell.SHGetSpecialFolderPath(None, shellcon.CSIDL_PERSONAL)
         except:
             # Yes, one of the documented ways to get this sometimes fail with "Unspecified error". Not sure
             # this will work either.
             # Update: There are cases when it doesn't work either; see support request #410...
             try:
                 return shell.SHGetFolderPath(None, shellcon.CSIDL_PERSONAL, None, 0) # SHGFP_TYPE_CURRENT not in shellcon
             except:
                 return os.getcwd() # Fuck this
     elif operating_system.isMac():
         import Carbon.Folder, Carbon.Folders, Carbon.File
         pathRef = Carbon.Folder.FSFindFolder(Carbon.Folders.kUserDomain, Carbon.Folders.kDocumentsFolderType, True)
         return Carbon.File.pathname(pathRef)
     elif operating_system.isGTK():
         try:
             from PyKDE4.kdeui import KGlobalSettings
         except ImportError:
             pass
         else:
             return unicode(KGlobalSettings.documentPath())
     # Assuming Unix-like
     return os.path.expanduser('~')
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:26,代码来源:settings.py


示例8: addBitmapToMenuItem

 def addBitmapToMenuItem(self, menuItem):
     if self.bitmap2 and self.kind == wx.ITEM_CHECK and not operating_system.isGTK():
         bitmap1 = self.__getBitmap(self.bitmap) 
         bitmap2 = self.__getBitmap(self.bitmap2)
         menuItem.SetBitmaps(bitmap1, bitmap2)
     elif self.bitmap and self.kind == wx.ITEM_NORMAL:
         menuItem.SetBitmap(self.__getBitmap(self.bitmap))
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:7,代码来源:base_uicommand.py


示例9: setDescription

 def setDescription(self, newDescription):
     page = self.editor._interior[0]
     page._descriptionEntry.SetFocus()
     page._descriptionEntry.SetValue(newDescription)
     if operating_system.isGTK(): # pragma: no cover
         page._descriptionSync.onAttributeEdited(DummyEvent())
     else: # pragma: no cover
         page._subjectEntry.SetFocus()
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:8,代码来源:AttachmentEditorTest.py


示例10: tearDown

 def tearDown(self):
     # TaskEditor uses CallAfter for setting the focus, make sure those 
     # calls are dealt with, otherwise they'll turn up in other tests
     if operating_system.isGTK():
         wx.Yield()  # pragma: no cover 
     super(TaskEditorTestCase, self).tearDown()
     self.taskFile.close()
     self.taskFile.stop()
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:8,代码来源:TaskEditorTest.py


示例11: __init__

 def __init__(self):
     self.__iconCache = dict()
     if operating_system.isMac():
         self.__iconSizeOnCurrentPlatform = 128
     elif operating_system.isGTK():
         self.__iconSizeOnCurrentPlatform = 48
     else:
         self.__iconSizeOnCurrentPlatform = 16
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:8,代码来源:artprovider.py


示例12: OnInit

    def OnInit(self):
        if operating_system.isWindows():
            self.Bind(wx.EVT_QUERY_END_SESSION, self.onQueryEndSession)

        if (operating_system.isMac() and hasattr(sys, 'frozen')) or \
            (operating_system.isGTK() and not sys.stdout.isatty()):
            sys.stdout = sys.stderr = RedirectedOutput()

        return True
开发者ID:jonnybest,项目名称:taskcoach,代码行数:9,代码来源:application.py


示例13: __should_create_page

 def __should_create_page(self, page_name):
     if page_name == 'iphone':
         return self.settings.getboolean('feature', 'iphone')
     elif page_name == 'os_darwin':
         return operating_system.isMac()
     elif page_name == 'os_linux':
         return operating_system.isGTK()
     else:
         return True
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:9,代码来源:preferences.py


示例14: checkXFCE4

 def checkXFCE4(self):
     if operating_system.isGTK():
         mon = application.Application().sessionMonitor
         if mon is not None and \
                 self.settings.getboolean('feature', 'usesm2') and \
                 self.settings.getboolean('feature', 'showsmwarning') and \
                 mon.vendor == 'xfce4-session':
             dlg = XFCE4WarningDialog(self, self.settings)
             dlg.Show()
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:9,代码来源:mainwindow.py


示例15: _setLocale

 def _setLocale(self, language):
     ''' Try to set the locale, trying possibly multiple localeStrings. '''
     if not operating_system.isGTK():
         locale.setlocale(locale.LC_ALL, '')
     # Set the wxPython locale:
     for localeString in self._localeStrings(language):
         languageInfo = wx.Locale.FindLanguageInfo(localeString)
         if languageInfo:
             self.__locale = wx.Locale(languageInfo.Language) # pylint: disable=W0201
             # Add the wxWidgets message catalog. This is really only for 
             # py2exe'ified versions, but it doesn't seem to hurt on other
             # platforms...
             localeDir = os.path.join(wx.StandardPaths_Get().GetResourcesDir(), 'locale')
             self.__locale.AddCatalogLookupPathPrefix(localeDir)
             self.__locale.AddCatalog('wxstd')
             break
     if operating_system.isGTK():
         locale.setlocale(locale.LC_ALL, '')
     self._fixBrokenLocales()
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:19,代码来源:__init__.py


示例16: __isFuse

 def __isFuse(self, path):
     if operating_system.isGTK() and os.path.exists('/proc/mounts'):
         for line in file('/proc/mounts', 'rb'):
             try:
                 location, mountPoint, fsType, options, a, b = line.strip().split()
             except:
                 pass
             if os.path.abspath(path).startswith(mountPoint) and fsType.startswith('fuse.'):
                 return True
     return False
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:10,代码来源:taskfile.py


示例17: getIconFromArtProvider

    def getIconFromArtProvider(self, iconTitle, iconSize=None):
        size = iconSize or self.__iconSizeOnCurrentPlatform
        # I just spent two hours trying to get rid of garbage in the icon
        # background on KDE. I give up.
        if operating_system.isGTK():
            return wx.ArtProvider_GetIcon(iconTitle, wx.ART_FRAME_ICON, (size, size))

        # wx.ArtProvider_GetIcon doesn't convert alpha to mask, so we do it
        # ourselves:
        bitmap = wx.ArtProvider_GetBitmap(iconTitle, wx.ART_FRAME_ICON, 
                                          (size, size))    
        bitmap = ArtProvider.convertAlphaToMask(bitmap)
        return wx.IconFromBitmap(bitmap)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:13,代码来源:artprovider.py


示例18: __init__

 def __init__(self, *args, **kwargs):
     super(FeaturesPage, self).__init__(columns=3, growableColumn=-1, 
                                        *args, **kwargs)
     self.addEntry(_('All settings on this tab require a restart of %s ' \
                     'to take effect') % meta.name)
     try:
         import taskcoachlib.syncml.core  # pylint: disable=W0404,W0612
     except ImportError:
         pass
     else:
         self.addBooleanSetting('feature', 'syncml', _('Enable SyncML'))
     self.addBooleanSetting('feature', 'iphone', 
                            _('Enable iPhone synchronization'))
     if operating_system.isGTK():
         self.addBooleanSetting('feature', 'usesm2', 
                                _('Use X11 session management'))
     self.addChoiceSetting('view', 'weekstart', _('Start of work week'), ' ',
                           [('monday', _('Monday')), 
                            ('sunday', _('Sunday'))])
     self.addTimeSetting('view', 'efforthourstart',
         _('Hour of start of work day'), helpText=' ')
     self.addTimeSetting('view', 'efforthourend',
         _('Hour of end of work day'), helpText=' ', disabledMessage=_('End of day'),
         disabledValue=24, defaultValue=23)
     self.addBooleanSetting('calendarviewer', 'gradient',
         _('Use gradients in calendar views.\n'
           'This may slow down Task Coach.'))
     self.addChoiceSetting('view', 'effortminuteinterval',
         _('Minutes between suggested times'), 
         _('In popup-menus for time selection (e.g. for setting the start \n'
           'time of an effort) %(name)s will suggest times using this \n'
           'setting. The smaller the number of minutes, the more times \n'
           'are suggested. Of course, you can also enter any time you \n'
           'want beside the suggested times.') % meta.data.metaDict,
         [(minutes, minutes) for minutes in ('5', '6', '10', '15', '20', 
                                             '30')],
         flags=(None, wx.ALL | wx.ALIGN_CENTER_VERTICAL,
                wx.ALL | wx.ALIGN_CENTER_VERTICAL))
     self.addIntegerSetting('feature', 'minidletime', _('Idle time notice'),
         helpText=_('If there is no user input for this amount of time\n'
                    '(in minutes), %(name)s will ask what to do about current '
                    'efforts.') % meta.data.metaDict)
     self.addBooleanSetting('feature', 'decimaltime',
         _('Use decimal times for effort entries.'),
         _('Display one hour, fifteen minutes as 1.25 instead of 1:15\n'
             'This is useful when creating invoices.'))
     self.addBooleanSetting('view', 'descriptionpopups',
         _('Show a popup with the description of an item\n'
           'when hovering over it'))
     self.fit()
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:50,代码来源:preferences.py


示例19: __init__

 def __init__(self, window, settings):
     super(WindowDimensionsTracker, self).__init__(window, settings, 
                                                   'window')
     self.__settings = settings
     if self.__start_iconized():
         if operating_system.isMac() or operating_system.isGTK():
             # Need to show the window on Mac OS X first, otherwise it   
             # won't be properly minimized. On wxGTK we need to show the
             # window first, otherwise clicking the task bar icon won't
             # show it.
             self._window.Show()
         self._window.Iconize(True)
         if not operating_system.isMac() and \
             self.get_setting('hidewheniconized'):
             # Seems like hiding the window after it's been
             # iconized actually closes it on Mac OS...
             wx.CallAfter(self._window.Hide)                
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:17,代码来源:windowdimensionstracker.py


示例20: pathToConfigDir

 def pathToConfigDir(self, environ):
     try:
         if operating_system.isGTK():
             from taskcoachlib.thirdparty.xdg import BaseDirectory
             path = BaseDirectory.save_config_path(meta.name)
         elif operating_system.isMac():
             import Carbon.Folder, Carbon.Folders, Carbon.File
             pathRef = Carbon.Folder.FSFindFolder(Carbon.Folders.kUserDomain, Carbon.Folders.kPreferencesFolderType, True)
             path = Carbon.File.pathname(pathRef)
             # XXXFIXME: should we release pathRef ? Doesn't seem so since I get a SIGSEGV if I try.
         elif operating_system.isWindows():
             from win32com.shell import shell, shellcon
             path = os.path.join(shell.SHGetSpecialFolderPath(None, shellcon.CSIDL_APPDATA, True), meta.name)
         else:
             path = self.pathToConfigDir_deprecated(environ=environ)
     except: # Fallback to old dir
         path = self.pathToConfigDir_deprecated(environ=environ)
     return path
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:18,代码来源:settings.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python operating_system.isMac函数代码示例发布时间:2022-05-27
下一篇:
Python i18n._函数代码示例发布时间: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