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

Python operating_system.isWindows函数代码示例

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

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



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


示例16: __init__

 def __init__(self, *args, **kwargs):
     super(AuiManagedFrameWithDynamicCenterPane, self).__init__(*args, 
                                                                **kwargs)
     agwStyle = aui.AUI_MGR_DEFAULT | aui.AUI_MGR_ALLOW_ACTIVE_PANE
     if not operating_system.isWindows():
         # With this style on Windows, you can't dock back floating frames
         agwStyle |= aui.AUI_MGR_USE_NATIVE_MINIFRAMES
     self.manager = aui.AuiManager(self, agwStyle)
     self.manager.SetAutoNotebookStyle(aui.AUI_NB_TOP | \
                                       aui.AUI_NB_CLOSE_BUTTON | \
                                       aui.AUI_NB_SUB_NOTEBOOK | \
                                       aui.AUI_NB_SCROLL_BUTTONS)
     self.bindEvents()
开发者ID:HieronymusCH,项目名称:TaskCoach,代码行数:13,代码来源:frame.py


示例17: getSimple

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

        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')
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:13,代码来源:notifier.py


示例18: _pathToDataDir

    def _pathToDataDir(self, *args, **kwargs):
        forceGlobal = kwargs.pop('forceGlobal', False)
        if operating_system.isGTK():
            from taskcoachlib.thirdparty.xdg import BaseDirectory
            path = BaseDirectory.save_data_path(meta.name)
        elif operating_system.isMac():
            import Carbon.Folder, Carbon.Folders, Carbon.File
            pathRef = Carbon.Folder.FSFindFolder(Carbon.Folders.kUserDomain, Carbon.Folders.kApplicationSupportFolderType, True)
            path = Carbon.File.pathname(pathRef)
            # XXXFIXME: should we release pathRef ? Doesn't seem so since I get a SIGSEGV if I try.
            path = os.path.join(path, meta.name)
        elif operating_system.isWindows():
            if self.__iniFileSpecifiedOnCommandLine and not forceGlobal:
                path = self.pathToIniFileSpecifiedOnCommandLine()
            else:
                from win32com.shell import shell, shellcon
                path = os.path.join(shell.SHGetSpecialFolderPath(None, shellcon.CSIDL_APPDATA, True), meta.name)

        else: # Errr...
            path = self.path()

        if operating_system.isWindows():
            # Follow shortcuts.
            from win32com.client import Dispatch
            shell = Dispatch('WScript.Shell')
            for component in args:
                path = os.path.join(path, component)
                if os.path.exists(path + '.lnk'):
                    shortcut = shell.CreateShortcut(path + '.lnk')
                    path = shortcut.TargetPath
        else:
            path = os.path.join(path, *args)

        exists = os.path.exists(path)
        if not exists:
            os.makedirs(path)
        return path, exists
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:37,代码来源:settings.py


示例19: updateMenuText

 def updateMenuText(self, menuText):
     self.menuText = menuText
     if operating_system.isWindows():
         for menuItem in self.menuItems[:]:
             menu = menuItem.GetMenu()
             pos = menu.GetMenuItems().index(menuItem)
             newMenuItem = wx.MenuItem(menu, self.id, menuText, self.helpText, self.kind)
             self.addBitmapToMenuItem(newMenuItem)
             menu.DeleteItem(menuItem)
             self.menuItems.remove(menuItem)
             self.menuItems.append(newMenuItem)
             menu.InsertItem(pos, newMenuItem)
     else:
         for menuItem in self.menuItems:
             menuItem.SetItemLabel(menuText)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:15,代码来源:base_uicommand.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.isWindows函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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