本文整理汇总了Python中fofix.core.Version.version方法的典型用法代码示例。如果您正苦于以下问题:Python Version.version方法的具体用法?Python Version.version怎么用?Python Version.version使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类fofix.core.Version
的用法示例。
在下文中一共展示了Version.version方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: shown
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
def shown(self):
self.engine.view.pushLayer(self.menu)
shaders.checkIfEnabled()
if not self.shownOnce:
self.shownOnce = True
if hasattr(sys, 'frozen'):
# Check whether this is a release binary being run from an svn/git
# working copy or whether this is an svn/git binary not being run
# from an corresponding working copy.
currentVcs, buildVcs = None, None
if VFS.isdir('/gameroot/.git'):
currentVcs = 'git'
elif VFS.isdir('/gameroot/src/.svn'):
currentVcs = 'Subversion'
if 'git' in Version.version():
buildVcs = 'git'
elif 'svn' in Version.version():
buildVcs = 'Subversion'
if currentVcs != buildVcs:
if buildVcs is None:
msg = _('This binary release is being run from a %(currentVcs)s working copy. This is not the correct way to run FoFiX from %(currentVcs)s. Please see one of the following web pages to set your %(currentVcs)s working copy up correctly:') + \
'\n\nhttp://code.google.com/p/fofix/wiki/RunningUnderPython26' + \
'\nhttp://code.google.com/p/fofix/wiki/RequiredSourceModules'
else:
msg = _('This binary was built from a %(buildVcs)s working copy but is not running from one. The FoFiX Team will not provide any support whatsoever for this binary. Please see the following site for official binary releases:') + \
'\n\nhttp://code.google.com/p/fofix/'
Dialogs.showMessage(self.engine, msg % {'buildVcs': buildVcs, 'currentVcs': currentVcs})
示例2: test_version
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
def test_version(self):
"""Test the complete version format"""
complete_version = Version.version()
version_num = Version.versionNum()
release = Version.revision()
expected_version = "%s %s" % (version_num, release)
self.assertEqual(complete_version, expected_version)
示例3: run
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
def run(self):
xgettext_cmd = find_command('xgettext')
potfile = os.path.join('..', 'data', 'po', 'messages.pot')
self.spawn([xgettext_cmd,
'--package-name='+Version.PROGRAM_NAME,
'--package-version='+Version.version(),
'--copyright-holder=FoFiX Team',
'-o', potfile] +
['-k' + funcname for funcname in self.FUNCNAMES] +
glob.glob('*.py'))
示例4: run
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
def run(self):
py_files = glob_recursive('.', '*.py')
xgettext_cmd = find_command('xgettext')
potfile = os.path.join('data', 'po', 'messages.pot')
self.spawn([xgettext_cmd,
'--package-name=' + Version.PROGRAM_NAME,
'--package-version=' + Version.version(),
'--copyright-holder=FoFiX Team',
' --sort-output',
'-o', potfile] +
['-k' + funcname for funcname in self.FUNCNAMES] +
py_files)
示例5: run
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
def run(self):
xgettext_cmd = find_command("xgettext")
potfile = os.path.join("..", "data", "po", "messages.pot")
self.spawn(
[
xgettext_cmd,
"--package-name=" + Version.PROGRAM_NAME,
"--package-version=" + Version.version(),
"--copyright-holder=FoFiX Team",
"-o",
potfile,
]
+ ["-k" + funcname for funcname in self.FUNCNAMES]
+ glob.glob("*.py")
)
示例6: __init__
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
def __init__(self, engine, songName = None):
self.engine = engine
self.time = 0.0
self.offset = 0.5 # akedrou - this seems to fix the delay issue, but I'm not sure why. Return here!
self.speedDiv = 20000.0
self.speedDir = 1.0
self.doneList = []
self.themename = Config.get("coffee", "themename")
nf = self.engine.data.font
ns = 0.002
bs = 0.001
hs = 0.003
c1 = (1, 1, .5, 1)
c2 = (1, .75, 0, 1)
self.text_size = nf.getLineSpacing(scale = hs)
#akedrou - Translatable Strings:
self.bank = {}
self.bank['intro'] = [_("Frets on Fire X is a progression of MFH-mod,"),
_("which was built on Alarian's mod,"),
_("which was built on UltimateCoffee's Ultimate mod,"),
_("which was built on RogueF's RF_mod 4.15,"),
_("which was, of course, built on Frets on Fire 1.2.451,"),
_("which was created by Unreal Voodoo")]
self.bank['noOrder'] = [_("No particular order")]
self.bank['accessOrder']= [_("In order of project commit access")]
self.bank['coders'] = [_("Active Coders")]
self.bank['otherCoding']= [_("Programming")]
self.bank['graphics'] = [_("Graphic Design")]
self.bank['3d'] = [_("3D Textures")]
self.bank['logo'] = [_("FoFiX Logo Design")]
self.bank['hollowmind'] = [_("Hollowmind Necks")]
self.bank['themes'] = [_("Included Themes")]
self.bank['shaders'] = [_("Shaders")]
self.bank['sounds'] = [_("Sound Design")]
self.bank['translators']= [_("Translators")]
self.bank['honorary'] = [_("Honorary Credits")]
self.bank['codeHonor'] = [_("Without whom this game would not exist")]
self.bank['giveThanks'] = [_("Special Thanks to")]
self.bank['community'] = [_("nwru and all of the community at fretsonfire.net")]
self.bank['other'] = [_("Other Contributors:")]
self.bank['tutorial'] = [_("Jurgen FoF tutorial inspired by adam02"),
_("Drum test song tutorial by Heka"),
_("Drum Rolls practice tutorial by venom426")]
self.bank['disclaimer'] = [_("If you have contributed to this game and are not credited,"),
_("please let us know what and when you contributed.")]
self.bank['thanks'] = [_("Thank you for your contribution.")]
self.bank['oversight'] = [_("Please keep in mind that it is not easy to trace down and"),
_("credit every single person who contributed; if your name is"),
_("not included, it was not meant to slight you."),
_("It was an oversight.")]
# evilynux - Theme strings
self.bank['themeCreators'] = [_("%s theme credits:") % self.themename]
self.bank['themeThanks'] = [_("%s theme specific thanks:") % self.themename]
# Languages
self.bank['french'] = [_("French")]
self.bank['french90'] = [_("French (reform 1990)")]
self.bank['german'] = [_("German")]
self.bank['italian'] = [_("Italian")]
self.bank['piglatin'] = [_("Pig Latin")]
self.bank['portuguese-b'] = [_("Portuguese (Brazilian)")]
self.bank['russian'] = [_("Russian")]
self.bank['spanish'] = [_("Spanish")]
self.bank['swedish'] = [_("Swedish")]
self.videoLayer = False
self.background = None
vidSource = os.path.join(Version.dataPath(), 'themes', self.themename, \
'menu', 'credits.ogv')
if os.path.isfile(vidSource):
try:
self.vidPlayer = VideoLayer(self.engine, vidSource, mute = True, loop = True)
except (IOError, VideoPlayerError):
Log.error('Error loading credits video:')
else:
self.vidPlayer.play()
self.engine.view.pushLayer(self.vidPlayer)
self.videoLayer = True
if not self.videoLayer and \
not self.engine.loadImgDrawing(self, 'background', os.path.join('themes', self.themename, 'menu', 'credits.png')):
self.background = None
if not self.engine.loadImgDrawing(self, 'topLayer', os.path.join('themes', self.themename, 'menu', 'creditstop.png')):
self.topLayer = None
space = Text(nf, hs, c1, "center", " ")
self.credits = [
Picture(self.engine, "fofix_logo.png", .10),
Text(nf, ns, c1, "center", "%s" % Version.version()), space]
# evilynux: Main FoFiX credits (taken from CREDITS).
self.parseText("CREDITS")
self.credits.extend([space, space, space])
# evilynux: Theme credits (taken from data/themes/<theme name>/CREDITS).
self.parseText(os.path.join('data', 'themes', self.themename, 'CREDITS'))
self.credits.extend( [
#.........这里部分代码省略.........
示例7: len
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
from fofix.core.Task import TaskEngine
from fofix.core import cmgl
from fofix.core import Config
from fofix.core import ConfigDefs
from fofix.core import Version
from fofix.core import Player
from fofix.core import Log
from fofix.core import Mod
from fofix.game import Dialogs
from fofix.game.World import World
from fofix.game.Debug import DebugLayer
# evilynux - Grab name and version from Version class.
version = "%s v%s" % ( Version.PROGRAM_NAME, Version.version() )
##Alarian: Get unlimited themes by foldername
themepath = os.path.join(Version.dataPath(), "themes")
themes = []
defaultTheme = None #myfingershurt
allthemes = os.listdir(themepath)
for name in allthemes:
if os.path.exists(os.path.join(themepath,name,"notes","notes.png")):
themes.append(name)
if name == "MegaLight V4":
defaultTheme = name
i = len(themes)
if i == 0:
if os.name == 'posix':
示例8: Main
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
while True:
main = Main()
main.run()
if not main.restartRequested:
break
except (KeyboardInterrupt, SystemExit):
raise
except:
log.error("Terminating due to unhandled exception: ")
_logname = os.path.abspath(log.logFile.name)
_errmsg = "%s\n\n%s\n%s\n%s\n%s" % (
_("Terminating due to unhandled exception:"),
traceback.format_exc(),
_("If you make a bug report about this error, please include the contents of the following log file:"),
_logname,
_("The log file already includes the traceback given above."))
if os.name == 'nt':
# If we move to PySDL2 we can replace this with a call to SDL_ShowSimpleMessageBox
import win32api
import win32con
if win32api.MessageBox(0, "%s\n\n%s" % (_errmsg, _("Open the logfile now?")), "%s %s" % (Version.PROGRAM_NAME, Version.version()), win32con.MB_YESNO|win32con.MB_ICONSTOP) == win32con.IDYES:
log.logFile.close()
os.startfile(_logname)
if hasattr(sys, 'frozen'):
sys.exit(1) # don't reraise if py2exe'd so the "Errors occurred" box won't appear after this and confuse the user as to which logfile we actually want
else:
print >>sys.stderr, _errmsg
raise
示例9: VersionResource
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
'zipfile': "data/library.zip",
'windows': [
{
"script": "FoFiX.py",
"icon_resources": [(1, "./win32/fofix.ico")],
"other_resources": [(RT_VERSION, 1, VersionResource(
# the parameter below must consist only of up to four numerical fields separated by dots
Version.versionNum(),
file_description="Frets on Fire X",
legal_copyright=r"© 2008-2013 FoFiX Team. GNU GPL v2 or later.",
company_name="FoFiX Team",
internal_name="FoFiX.exe",
original_filename="FoFiX.exe",
product_name=Version.PROGRAM_NAME,
# when run from the exe, FoFiX will claim to be "FoFiX v" + product_version
product_version=Version.version()
).resource_bytes())]
}
],
'data_files': data_files
})
elif sys.platform == 'darwin':
try:
import py2app
except ImportError:
if 'py2app' in sys.argv:
sys.stderr.write('py2app must be installed to create .app bundles.\n')
sys.exit(1)
setup_args.update({
'app': ['FoFiX.py'],
示例10: VersionResource
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
"icon_resources": [(1, "./win32/fofix.ico")],
"other_resources": [
(
RT_VERSION,
1,
VersionResource(
# stump: the parameter below must consist only of up to four numerical fields separated by dots
Version.versionNum(),
file_description="Frets on Fire X",
legal_copyright=r"© 2008-2013 FoFiX Team. GNU GPL v2 or later.",
company_name="FoFiX Team",
internal_name="FoFiX.exe",
original_filename="FoFiX.exe",
product_name=Version.PROGRAM_NAME,
# stump: when run from the exe, FoFiX will claim to be "FoFiX v" + product_version
product_version=Version.version(),
).resource_bytes(),
)
],
}
],
}
)
elif sys.platform == "darwin":
try:
import py2app
except ImportError:
if "py2app" in sys.argv:
sys.stderr.write("py2app must be installed to create .app bundles.\n")
sys.exit(1)
示例11: _
# 需要导入模块: from fofix.core import Version [as 别名]
# 或者: from fofix.core.Version import version [as 别名]
_("Terminating due to unhandled exception:"),
traceback.format_exc(),
_("If you make a bug report about this error, please include the contents of the following log file:"),
_logname,
_("The log file already includes the traceback given above."),
)
if os.name == "nt":
# If we move to PySDL2 we can replace this with a call to SDL_ShowSimpleMessageBox
import win32api
import win32con
if (
win32api.MessageBox(
0,
"%s\n\n%s" % (_errmsg, _("Open the logfile now?")),
"%s %s" % (Version.PROGRAM_NAME, Version.version()),
win32con.MB_YESNO | win32con.MB_ICONSTOP,
)
== win32con.IDYES
):
Log.logFile.close()
os.startfile(_logname)
if hasattr(sys, "frozen"):
sys.exit(
1
) # don't reraise if py2exe'd so the "Errors occurred" box won't appear after this and confuse the user as to which logfile we actually want
else:
print >>sys.stderr, _errmsg
raise