本文整理汇总了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')
示例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
示例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')
示例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()
示例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')
示例6: pre_sub_commands
def pre_sub_commands(self, opts):
require_git_master()
require_clean_git()