本文整理汇总了Python中PyQt4.phonon.Phonon.phononVersion方法的典型用法代码示例。如果您正苦于以下问题:Python Phonon.phononVersion方法的具体用法?Python Phonon.phononVersion怎么用?Python Phonon.phononVersion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.phonon.Phonon
的用法示例。
在下文中一共展示了Phonon.phononVersion方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: getattr
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import phononVersion [as 别名]
"""
The actual exception dialog form.
"""
import logging
import re
import os
import platform
import sqlalchemy
import BeautifulSoup
from lxml import etree
from PyQt4 import Qt, QtCore, QtGui, QtWebKit
try:
from PyQt4.phonon import Phonon
PHONON_VERSION = Phonon.phononVersion()
except ImportError:
PHONON_VERSION = u'-'
try:
import migrate
MIGRATE_VERSION = getattr(migrate, u'__version__', u'< 0.7')
except ImportError:
MIGRATE_VERSION = u'-'
try:
import chardet
CHARDET_VERSION = chardet.__version__
except ImportError:
CHARDET_VERSION = u'-'
try:
import enchant
ENCHANT_VERSION = enchant.__version__
示例2: sanity_check
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import phononVersion [as 别名]
def sanity_check():
"Sanity Check for script."
config.count_application_runs += 1
_warnings = []
### LOCAL CHECKS ###
# Windows version check
winver = sys.getwindowsversion()
log.debug('Running iQuality v%s (r%d) on Windows %d.%d.%d %s' % (__version__, __rev__, winver.major, winver.minor, winver.build, winver.service_pack))
# Python version check
if sys.version_info < (2, 6) or sys.version_info >= (3, 0):
msg = "must use python 2.7"
log.critical(msg)
raise Exception(msg)
log.debug('CPython version is %d.%d.%d' % (sys.version_info.major, sys.version_info.minor, sys.version_info.micro))
log.debug('PyQt version is %s, Qt version is %s' % (QtCore.PYQT_VERSION_STR, QtCore.QT_VERSION_STR))
# youtube-dl check
try:
import youtube_dl
log.debug("youtube-dl version is %s" % youtube_dl.__version__)
except ImportError:
log.warning("Could not load the youtube-dl module")
# Phonon version check
try:
from PyQt4.phonon import Phonon
if Phonon.BackendCapabilities.isMimeTypeAvailable('video/x-flv'):
log.debug('Phonon version is %s. video/x-flv is supported.' % Phonon.phononVersion())
else:
log.warning('Phonon version is %s. video/x-flv is not supported.' % Phonon.phononVersion())
except ImportError:
log.warning("Could not load the phonon module")
# Free space check
freespace = utils.get_free_space(config.temp_dir)
if freespace < 200*1024**2: # 200 MB
drive = os.path.splitdrive(config.temp_dir)[0]
log.warning("There are less than 200MB available in drive %s (%.2fMB left)." % (drive, freespace/1024.0**2))
_warnings.append(NoSpaceWarning(drive, freespace))
# iTunes' availablity check
itunesPath = r'%s\My Documents\My Music\iTunes\iTunes Media\Automatically Add to iTunes' % utils.get_home_dir()
if not os.path.exists(itunesPath):
config.is_itunes_installed = False
if config.post_download_action == 'addItunes':
config.post_download_action = 'ask'
log.warning("iTunes Media not found. setting is_itunes_installed to False")
# Context Menu check
try: # IMPROVE: REMOVE THE TRY-EXCEPT BLOCK
if config.id3editor_in_context_menu and not utils.check_context_menu_status():
log.debug("Registering Context Menu Object...")
try:
utils.register_with_context_menu()
except WindowsError, e:
if e.winerror == 5: # Access is denied
log.debug("Access is denied. Setting id3editor_in_context_menu to False.")
config.id3editor_in_context_menu = False
else:
raise
if not config.id3editor_in_context_menu and utils.check_context_menu_status():
log.debug("Unregistering Context Menu Object...")
try:
utils.unregister_with_context_menu()
except WindowsError, e:
if e.winerror == 5: # Access is denied
log.debug("Access is denied. Setting id3editor_in_context_menu to True.")
config.id3editor_in_context_menu = True
else:
raise
示例3: phononVersion
# 需要导入模块: from PyQt4.phonon import Phonon [as 别名]
# 或者: from PyQt4.phonon.Phonon import phononVersion [as 别名]
def phononVersion ():
return map (int, Phonon.phononVersion ().split ('.'))