本文整理汇总了Python中setup.require_git_master函数的典型用法代码示例。如果您正苦于以下问题:Python require_git_master函数的具体用法?Python require_git_master怎么用?Python require_git_master使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了require_git_master函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: pre_sub_commands
def pre_sub_commands(self, opts):
require_git_master()
require_clean_git()
if 'PUBLISH_BUILD_DONE' not in os.environ:
subprocess.check_call([sys.executable, 'setup.py', 'build'])
os.environ['PUBLISH_BUILD_DONE'] = '1'
os.execl(os.path.abspath('setup.py'), './setup.py', 'publish')
开发者ID:JimmXinu,项目名称:calibre,代码行数:7,代码来源:publish.py
示例2: run
def run(self, opts):
require_git_master()
pot_header = textwrap.dedent('''\
# Translation template file..
# Copyright (C) %(year)s Kovid Goyal
# Kovid Goyal <[email protected]>, %(year)s.
#
msgid ""
msgstr ""
"Project-Id-Version: %(appname)s %(version)s\\n"
"POT-Creation-Date: %(time)s\\n"
"PO-Revision-Date: %(time)s\\n"
"Last-Translator: Automatically generated\\n"
"Language-Team: LANGUAGE\\n"
"MIME-Version: 1.0\\n"
"Report-Msgid-Bugs-To: https://bugs.launchpad.net/calibre\\n"
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\\n"
"Content-Type: text/plain; charset=UTF-8\\n"
"Content-Transfer-Encoding: 8bit\\n"
''')%dict(appname=__appname__, version=__version__,
year=time.strftime('%Y'),
time=time.strftime('%Y-%m-%d %H:%M+%Z'))
files = self.source_files()
qt_inputs = qt_sources()
with tempfile.NamedTemporaryFile() as fl:
fl.write('\n'.join(files))
fl.flush()
out = tempfile.NamedTemporaryFile(suffix='.pot', delete=False)
out.close()
self.info('Creating translations template...')
subprocess.check_call(['xgettext', '-f', fl.name,
'--default-domain=calibre', '-o', out.name, '-L', 'Python',
'--from-code=UTF-8', '--sort-by-file', '--omit-header',
'--no-wrap', '-k__', '--add-comments=NOTE:',
])
subprocess.check_call(['xgettext', '-j',
'--default-domain=calibre', '-o', out.name,
'--from-code=UTF-8', '--sort-by-file', '--omit-header',
'--no-wrap', '-kQT_TRANSLATE_NOOP:2',
] + qt_inputs)
with open(out.name, 'rb') as f:
src = f.read()
os.remove(out.name)
src = pot_header + '\n' + src
src += '\n\n' + self.get_tweaks_docs()
pot = os.path.join(self.LP_PATH, __appname__+'.pot')
# Workaround for bug in xgettext:
# https://savannah.gnu.org/bugs/index.php?41668
src = re.sub(r'#, python-brace-format\s+msgid ""\s+.*<code>{0:</code>',
lambda m: m.group().replace('python-brace', 'no-python-brace'), src)
with open(pot, 'wb') as f:
f.write(src)
self.info('Translations template:', os.path.abspath(pot))
self.upload_pot(os.path.abspath(pot))
return pot
开发者ID:Kielek,项目名称:calibre,代码行数:60,代码来源:translations.py
示例3: run
def run(self, opts):
require_git_master()
self.tx('pull -a')
if self.is_modified:
self.check_for_errors()
self.upload_to_vcs()
else:
print ('No translations were updated')
开发者ID:kba,项目名称:calibre,代码行数:8,代码来源:translations.py
示例4: run
def run(self, opts):
require_git_master()
if opts.check_for_errors:
self.check_all()
return
self.tx('pull -a')
if not self.is_modified:
self.info('No translations were updated')
return
self.upload_to_vcs()
self.check_all()
开发者ID:NiLuJe,项目名称:calibre,代码行数:11,代码来源:translations.py
示例5: run
def run(self, opts):
require_git_master()
if not self.modified_translations:
try:
subprocess.check_call(['bzr', 'merge', self.BRANCH], cwd=self.LP_BASE)
except subprocess.CalledProcessError:
self.resolve_conflicts()
self.check_for_errors()
if self.modified_translations:
subprocess.check_call(['bzr', 'commit', '-m',
self.CMSG], cwd=self.LP_BASE)
else:
print('No updated translations available')
开发者ID:BobPyron,项目名称:calibre,代码行数:14,代码来源:translations.py
示例6: pre_sub_commands
def pre_sub_commands(self, opts):
require_git_master()
require_clean_git()
开发者ID:Aliminator666,项目名称:calibre,代码行数:3,代码来源:publish.py
注:本文中的setup.require_git_master函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论