当前位置: 首页>>代码示例>>Python>>正文


Python operating_system.isMac函数代码示例

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


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

示例1: __init__

 def __init__(self, iocontroller=None, *args, **kwargs):
     self.iocontroller = iocontroller
     super(SyncMLPreferences, self).__init__(bitmap='wrench_icon', *args,
                                             **kwargs)
     self.SetSize((700, -1))
     if operating_system.isMac():
         self.CentreOnParent()
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:7,代码来源:syncpreferences.py

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

示例3: getSimple

    def getSimple(klass):
        """
        Returns a notifier suitable for simple notifications. This
        defaults to Growl/Snarl/libnotify depending on their
        availability.
        """

        if klass._enabled:
            if operating_system.isMac():
                return klass.get("Growl") or klass.get("Task Coach")
            elif operating_system.isWindows():
                return klass.get("Snarl") or klass.get("Task Coach")
            else:
                return klass.get("libnotify") or klass.get("Task Coach")
        else:

            class DummyNotifier(AbstractNotifier):
                def getName(self):
                    return u"Dummy"

                def isAvailable(self):
                    return True

                def notify(self, title, summary, bitmap, **kwargs):
                    pass

            return DummyNotifier()
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:27,代码来源:notifier.py

示例4: sendMail

def sendMail(to, subject, body, cc=None, openURL=openfile.openFile):
    def unicode_quote(s):
        # This is like urllib.quote but leaves out Unicode characters,
        # which urllib.quote does not support.
        chars = [c if ord(c) >= 128 else urllib.quote(c) for c in s]
        return ''.join(chars)

    cc = cc or []
    if isinstance(to, (str, unicode)):
        to = [to]

    # FIXME: Very  strange things happen on  MacOS X. If  there is one
    # non-ASCII character in the body, it works. If there is more than
    # one, it fails.  Maybe we should use Mail.app  directly ? What if
    # the user uses something else ?

    if not operating_system.isMac():
        body = unicode_quote(body) # Otherwise newlines disappear
        cc = map(unicode_quote, cc)
        to = map(unicode_quote, to)

    components = ['subject=%s' % subject, 'body=%s' % body]
    if cc:
        components.append('cc=%s' % ','.join(cc))

    openURL(u'mailto:%s?%s' % (','.join(to), '&'.join(components)))
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:26,代码来源:__init__.py

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

示例6: test_change_size

 def test_change_size(self):
     self.frame.Maximize(False)
     if operating_system.isMac():
         self.frame.SetClientSize((123, 200))
     else:
         self.frame.ProcessEvent(wx.SizeEvent((123, 200)))
     self.assertEqual((123, 200), self.settings.getvalue(self.section, "size"))
开发者ID:jonnybest,项目名称:taskcoach,代码行数:7,代码来源:WindowDimensionsTrackerTest.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: test_initial_size

 def test_initial_size(self):
     # See MainWindowTest...
     width, height = self.frame.GetSizeTuple()
     if operating_system.isMac():  # pragma: no cover
         width, height = self.frame.GetClientSize()
         height -= 18
     self.assertEqual((width, height), self.settings.getvalue(self.section, "size"))
开发者ID:jonnybest,项目名称:taskcoach,代码行数:7,代码来源:WindowDimensionsTrackerTest.py

示例9: _createSpinCtrl

 def _createSpinCtrl(self, percentage):
     entry = widgets.SpinCtrl(
         self, value=percentage, min=0, max=100, size=(60 if operating_system.isMac() else 50, -1)
     )
     for eventType in wx.EVT_SPINCTRL, wx.EVT_KILL_FOCUS:
         entry.Bind(eventType, self.onSpin)
     return entry
开发者ID:jonnybest,项目名称:taskcoach,代码行数:7,代码来源:entry.py

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

示例11: onTaskbarClick

 def onTaskbarClick(self, event):
     if self.__window.IsIconized() or not self.__window.IsShown():
         self.__window.restore(event)
     else:
         if operating_system.isMac():
             self.__window.Raise()
         else:
             self.__window.Iconize()
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:8,代码来源:taskbaricon.py

示例12: __get_agw_style

 def __get_agw_style():
     agw_style = wx.TR_DEFAULT_STYLE | wx.TR_HIDE_ROOT | wx.TR_MULTIPLE \
         | wx.TR_EDIT_LABELS | wx.TR_HAS_BUTTONS | wx.TR_FULL_ROW_HIGHLIGHT \
         | customtree.TR_HAS_VARIABLE_ROW_HEIGHT
     if operating_system.isMac():
         agw_style |= wx.TR_NO_LINES
     agw_style &= ~hypertreelist.TR_NO_HEADER
     return agw_style
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:8,代码来源:treectrl.py

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

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

示例15: 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


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