本文整理汇总了Python中VFS.isdir方法的典型用法代码示例。如果您正苦于以下问题:Python VFS.isdir方法的具体用法?Python VFS.isdir怎么用?Python VFS.isdir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VFS
的用法示例。
在下文中一共展示了VFS.isdir方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: shown
# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import isdir [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: _getTagLine
# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import isdir [as 别名]
def _getTagLine():
import VFS # can't be done at top level due to circular import issues...
# Look for a git repository.
if VFS.isdir("/gameroot/.git"):
# HEAD is in the form "ref: refs/heads/master\n"
headref = VFS.open("/gameroot/.git/HEAD").read()[5:].strip()
if VFS.isfile("/gameroot/.git/" + headref):
# The ref is in the form "sha1-hash\n"
headhash = VFS.open("/gameroot/.git/" + headref).read().strip()
else:
# It's a packed ref.
for line in VFS.open("/gameroot/.git/packed-refs"):
if line.strip().endswith(headref):
headhash = line[:40]
break
shortref = re.sub("^refs/(heads/)?", "", headref)
return "development (git %s %s)" % (shortref, headhash[:7])
# Look for the svn administrative directory.
elif VFS.isdir("/gameroot/src/.svn"):
revision = VFS.open("/gameroot/src/.svn/entries").readlines()[3].strip()
return "development (svn r%s)" % revision
else:
return None
示例3: _getTagLine
# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import isdir [as 别名]
def _getTagLine():
import VFS # can't be done at top level due to circular import issues...
# Look for a git repository.
if VFS.isdir('/gameroot/.git'):
# HEAD is in the form "ref: refs/heads/master\n"
headref = VFS.open('/gameroot/.git/HEAD').read()[5:].strip()
# The ref is in the form "sha1-hash\n"
headhash = VFS.open('/gameroot/.git/' + headref).read().strip()
shortref = re.sub('^refs/(heads/)?', '', headref)
return 'development (git %s %s)' % (shortref, headhash[:7])
# Look for the svn administrative directory.
elif VFS.isdir('/gameroot/src/.svn'):
revision = VFS.open('/gameroot/src/.svn/entries').readlines()[3].strip()
return 'development (svn r%s)' % revision
else:
return None
示例4: _getTagLine
# 需要导入模块: import VFS [as 别名]
# 或者: from VFS import isdir [as 别名]
def _getTagLine():
import VFS # can't be done at top level due to circular import issues...
# Look for a git repository.
if VFS.isdir('/gameroot/.git'):
shortref = None
headhash = None
# HEAD is in the form "ref: refs/heads/master\n" if a branch is
# checked out, or just the hash if HEAD is detached.
refline = VFS.open('/gameroot/.git/HEAD').read().strip()
if refline[0:5] == "ref: ":
headref = refline[5:]
if VFS.isfile('/gameroot/.git/' + headref):
# The ref is in the form "sha1-hash\n"
headhash = VFS.open('/gameroot/.git/' + headref).read().strip()
else:
# It's a packed ref.
for line in VFS.open('/gameroot/.git/packed-refs'):
if line.strip().endswith(headref):
headhash = line[:40]
break
shortref = re.sub('^refs/(heads/)?', '', headref)
else:
shortref = "(detached)"
headhash = refline
return 'development (git %s %s)' % (shortref or "(unknown)",
headhash and headhash[:7] or "(unknown)")
# Look for the svn administrative directory.
elif VFS.isdir('/gameroot/src/.svn'):
revision = VFS.open('/gameroot/src/.svn/entries').readlines()[3].strip()
return 'development (svn r%s)' % revision
else:
return None