本文整理汇总了Python中taskcoachlib.operating_system.isMac函数的典型用法代码示例。如果您正苦于以下问题:Python isMac函数的具体用法?Python isMac怎么用?Python isMac使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isMac函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: tearDown
def tearDown(self):
if operating_system.isMac():
self.mainwindow.OnQuit() # Stop power monitoring thread
# Also stop idle time thread
self.mainwindow._idleController.stop()
del self.mainwindow
super(MainWindowTestCase, self).tearDown()
self.taskFile.close()
self.taskFile.stop()
开发者ID:jonnybest,项目名称:taskcoach,代码行数:9,代码来源:MainWindowTest.py
示例17: testClearEmitsNoEventOnMacOSX
def testClearEmitsNoEventOnMacOSX(self):
self.clearTextCausesEvent = False # pylint: disable=W0201
textCtrl = wx.TextCtrl(self.frame)
textCtrl.Bind(wx.EVT_TEXT, self.onTextChanged)
textCtrl.Clear()
if operating_system.isMac(): # pragma: no cover
self.failIf(self.clearTextCausesEvent)
else: # pragma: no cover
self.failUnless(self.clearTextCausesEvent)
开发者ID:MahadJamal,项目名称:Task-Coach-Evolution,代码行数:9,代码来源:wxPythonTest.py
示例18: __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
示例19: __set_dimensions
def __set_dimensions(self):
''' Set the window position and size based on the settings. '''
x, y = self.get_setting('position') # pylint: disable=C0103
width, height = self.get_setting('size')
if operating_system.isMac():
# Under MacOS 10.5 and 10.4, when setting the size, the actual
# window height is increased by 40 pixels. Dunno why, but it's
# highly annoying. This doesn't hold for dialogs though. Sigh.
if not isinstance(self._window, wx.Dialog):
height += 18
self._window.SetDimensions(x, y, width, height)
if operating_system.isMac():
self._window.SetClientSize((width, height))
if self.get_setting('maximized'):
self._window.Maximize()
# Check that the window is on a valid display and move if necessary:
if wx.Display.GetFromWindow(self._window) == wx.NOT_FOUND:
self._window.SetDimensions(0, 0, width, height)
if operating_system.isMac():
self._window.SetClientSize((width, height))
开发者ID:jonnybest,项目名称:taskcoach,代码行数:20,代码来源:windowdimensionstracker.py
示例20: open
def open(self, filename=None, showerror=wx.MessageBox,
fileExists=os.path.exists, breakLock=False, lock=True):
if self.__taskFile.needSave():
if not self.__saveUnsavedChanges():
return
if not filename:
filename = self.__askUserForFile(_('Open'),
self.__tskFileOpenDialogOpts)
if not filename:
return
self.__updateDefaultPath(filename)
if fileExists(filename):
self.__closeUnconditionally()
self.__addRecentFile(filename)
try:
try:
self.__taskFile.load(filename, lock=lock,
breakLock=breakLock)
except:
# Need to destroy splash screen first because it may
# interfere with dialogs we show later on Mac OS X
if self.__splash:
self.__splash.Destroy()
raise
except lockfile.LockTimeout:
if breakLock:
if self.__askOpenUnlocked(filename):
self.open(filename, showerror, lock=False)
elif self.__askBreakLock(filename):
self.open(filename, showerror, breakLock=True)
else:
return
except lockfile.LockFailed:
if self.__askOpenUnlocked(filename):
self.open(filename, showerror, lock=False)
else:
return
except persistence.xml.reader.XMLReaderTooNewException:
self.__showTooNewErrorMessage(filename, showerror)
return
except Exception:
self.__showGenericErrorMessage(filename, showerror, showBackups=True)
return
self.__messageCallback(_('Loaded %(nrtasks)d tasks from '
'%(filename)s') % dict(nrtasks=len(self.__taskFile.tasks()),
filename=self.__taskFile.filename()))
else:
errorMessage = _("Cannot open %s because it doesn't exist") % filename
# Use CallAfter on Mac OS X because otherwise the app will hang:
if operating_system.isMac():
wx.CallAfter(showerror, errorMessage, **self.__errorMessageOptions)
else:
showerror(errorMessage, **self.__errorMessageOptions)
self.__removeRecentFile(filename)
开发者ID:pk-codebox-evo,项目名称:ios-apps-taskcoach,代码行数:54,代码来源:iocontroller.py
注:本文中的taskcoachlib.operating_system.isMac函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论