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


Python operating_system.isWindows函数代码示例

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


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

示例1: OnInit

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

        try:
            isatty = sys.stdout.isatty()
        except AttributeError:
            isatty = False

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

        return True
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:13,代码来源:application.py

示例2: __is_scrollbar_included_in_client_size

 def __is_scrollbar_included_in_client_size(self):
     # NOTE: on GTK, the scrollbar is included in the client size, but on
     # Windows it is not included
     if operating_system.isWindows():
         return isinstance(self, hypertreelist.HyperTreeList)
     else:
         return True
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:7,代码来源:autowidth.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: __create_mutex

 def __create_mutex():
     ''' On Windows, create a mutex so that InnoSetup can check whether the
         application is running. '''
     if operating_system.isWindows():
         import ctypes
         from taskcoachlib import meta
         ctypes.windll.kernel32.CreateMutexA(None, False, meta.filename)
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:7,代码来源:application.py

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

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

示例7: migrateConfigurationFiles

 def migrateConfigurationFiles(self):
     # Templates. Extra care for Windows shortcut.
     oldPath = self.pathToTemplatesDir_deprecated(doCreate=False)
     newPath, exists = self._pathToTemplatesDir()
     if self.__iniFileSpecifiedOnCommandLine:
         globalPath = os.path.join(self.pathToDataDir(forceGlobal=True), 'templates')
         if os.path.exists(globalPath) and not os.path.exists(oldPath):
             # Upgrade from fresh installation of 1.3.24 Portable
             oldPath = globalPath
             if exists and not os.path.exists(newPath + '-old'):
                 # WTF?
                 os.rename(newPath, newPath + '-old')
             exists = False
     if exists:
         return
     if oldPath != newPath:
         if operating_system.isWindows() and os.path.exists(oldPath + '.lnk'):
             shutil.move(oldPath + '.lnk', newPath + '.lnk')
         elif os.path.exists(oldPath):
             # pathToTemplatesDir() has created the directory
             try:
                 os.rmdir(newPath)
             except:
                 pass
             shutil.move(oldPath, newPath)
     # Ini file
     oldPath = os.path.join(self.pathToConfigDir_deprecated(environ=os.environ), '%s.ini' % meta.filename)
     newPath = os.path.join(self.pathToConfigDir(environ=os.environ), '%s.ini' % meta.filename)
     if newPath != oldPath and os.path.exists(oldPath):
         shutil.move(oldPath, newPath)
     # Cleanup
     try:
         os.rmdir(self.pathToConfigDir_deprecated(environ=os.environ))
     except:
         pass
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:35,代码来源:settings.py

示例8: init

def init():
    if operating_system.isWindows() and wx.DisplayDepth() >= 32:
        wx.SystemOptions_SetOption("msw.remap", "0")  # pragma: no cover
    try:
        wx.ArtProvider_PushProvider(ArtProvider())  # pylint: disable=E1101
    except AttributeError:
        wx.ArtProvider.Push(ArtProvider())
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:7,代码来源:artprovider.py

示例9: OnBeginColumnDrag

 def OnBeginColumnDrag(self, event):
     # pylint: disable=W0201
     if event.Column == self.ResizeColumn:
         self.__oldResizeColumnWidth = self.GetColumnWidth(self.ResizeColumn)
     # Temporarily unbind the EVT_SIZE to prevent resizing during dragging
     self.Unbind(wx.EVT_SIZE)
     if operating_system.isWindows():
         event.Skip()
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:8,代码来源:autowidth.py

示例10: testWindowSizeShouldnotChangeWhenReceivingChangeSizeEvent

 def testWindowSizeShouldnotChangeWhenReceivingChangeSizeEvent(self):
     event = wx.SizeEvent((100, 20))
     process = self.mainwindow.ProcessEvent
     if operating_system.isWindows():
         process(event)  # pragma: no cover
     else:
         wx.CallAfter(process, event)  # pragma: no cover
     self.assertEqual((900, self.expectedHeight()), eval(self.settings.get("window", "size")))
开发者ID:TaskEvolution,项目名称:Task-Coach-Evolution,代码行数:8,代码来源:MainWindowTest.py

示例11: setUp

 def setUp(self):
     super(WindowDimensionsTrackerTest, self).setUp()
     self.settings = config.Settings(load=False)
     self.section = "window"
     self.settings.setvalue(self.section, "position", (50, 50))
     self.settings.setvalue(self.section, "starticonized", "Never")
     if operating_system.isWindows():
         self.frame.Show()
     self.tracker = gui.windowdimensionstracker.WindowDimensionsTracker(self.frame, self.settings)
开发者ID:jonnybest,项目名称:taskcoach,代码行数:9,代码来源:WindowDimensionsTrackerTest.py

示例12: testMaximize

 def testMaximize(self): # pragma: no cover
     # Skipping this test under wxGTK. I don't know how it managed
     # to pass before but according to
     # http://trac.wxwidgets.org/ticket/9167 and to my own tests,
     # EVT_MAXIMIZE is a noop under this platform.
     self.mainwindow.Maximize()
     if operating_system.isWindows():
         wx.Yield()
     self.failUnless(self.settings.getboolean('window', 'maximized'))
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:9,代码来源:MainWindowTest.py

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

示例14: setUp

 def setUp(self):
     super(WindowDimensionsTrackerTest, self).setUp()
     self.settings = config.Settings(load=False)
     self.section = 'window'
     self.settings.setvalue(self.section, 'position', (50, 50))
     self.settings.setvalue(self.section, 'starticonized', 'Never')
     if operating_system.isWindows():
         self.frame.Show()
     self.tracker = gui.windowdimensionstracker.WindowDimensionsTracker( \
                        self.frame, self.settings)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:10,代码来源:WindowDimensionsTrackerTest.py

示例15: __register_signal_handlers

 def __register_signal_handlers(self):
     quit_adapter = lambda *args: self.quitApplication()
     if operating_system.isWindows():
         import win32api  # pylint: disable=F0401
         win32api.SetConsoleCtrlHandler(quit_adapter, True)
     else:
         import signal
         signal.signal(signal.SIGTERM, quit_adapter)
         if hasattr(signal, 'SIGHUP'):
             forced_quit = lambda *args: self.quitApplication(force=True)
             signal.signal(signal.SIGHUP, forced_quit)  # pylint: disable=E1101
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:11,代码来源:application.py


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