From 1f2293fc11499463a840c159df38967d95a534e2 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 9 Feb 2017 23:39:45 +0530 Subject: [PATCH] Use vim rather than gvim --- setup/check.py | 2 +- setup/translations.py | 9 ++++++++- src/calibre/ebooks/oeb/polish/tests/container.py | 8 ++++---- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/setup/check.py b/setup/check.py index 13d9f53dfb..d7d9983bd6 100644 --- a/setup/check.py +++ b/setup/check.py @@ -119,7 +119,7 @@ class Check(Command): self.info('\tChecking', f) if self.file_has_errors(f): self.info('%d files left to check' % (len(dirty_files) - i - 1)) - subprocess.call(['gvim', '-c', 'SyntasticCheck', '-c', 'll', '-S', + subprocess.call(['vim', '-c', 'SyntasticCheck', '-c', 'll', '-S', self.j(self.SRC, '../session.vim'), '-f', f]) if self.file_has_errors(f): raise SystemExit(1) diff --git a/setup/translations.py b/setup/translations.py index 2058287c3c..0dd35bb51a 100644 --- a/setup/translations.py +++ b/setup/translations.py @@ -15,6 +15,7 @@ from setup import Command, __appname__, __version__, require_git_master, build_c from setup.parallel_build import parallel_check_output is_ci = os.environ.get('CI', '').lower() == 'true' + def qt_sources(): qtdir = '/usr/src/qt5' j = partial(os.path.join, qtdir) @@ -24,6 +25,7 @@ def qt_sources(): 'qtbase/src/widgets/dialogs/qfontdialog.cpp', ])) + class POT(Command): # {{{ description = 'Update the .pot translation template and upload it' @@ -203,6 +205,7 @@ class POT(Command): # {{{ return pot # }}} + class Translations(POT): # {{{ description='''Compile the translations''' DEST = os.path.join(os.path.dirname(POT.SRC), 'resources', 'localization', @@ -317,6 +320,7 @@ class Translations(POT): # {{{ lcf.write(cPickle.dumps(ld, -1)) stats = {} + def handle_stats(f, nums): trans = nums[0] total = trans if len(nums) == 1 else (trans + nums[1]) @@ -478,6 +482,7 @@ class Translations(POT): # {{{ # }}} + class GetTranslations(Translations): # {{{ description = 'Get updated translations from Transifex' @@ -545,7 +550,7 @@ class GetTranslations(Translations): # {{{ subprocess.check_call(pofilter) errfiles = glob.glob(errors+os.sep+'*.po') if errfiles: - subprocess.check_call(['gvim', '-f', '-p', '--']+errfiles) + subprocess.check_call(['vim', '-f', '-p', '--']+errfiles) for f in errfiles: with open(f, 'r+b') as f: raw = f.read() @@ -574,6 +579,7 @@ class GetTranslations(Translations): # {{{ # }}} + class ISO639(Command): # {{{ description = 'Compile language code maps for performance' @@ -636,6 +642,7 @@ class ISO639(Command): # {{{ # }}} + class ISO3166(ISO639): # {{{ description = 'Compile country code maps for performance' diff --git a/src/calibre/ebooks/oeb/polish/tests/container.py b/src/calibre/ebooks/oeb/polish/tests/container.py index 2a798a8bab..a1a5a8c591 100644 --- a/src/calibre/ebooks/oeb/polish/tests/container.py +++ b/src/calibre/ebooks/oeb/polish/tests/container.py @@ -83,11 +83,11 @@ class ContainerTests(BaseTest): for x in files: self.assertNotIn(x, raw) - def run_external_tools(self, container, gvim=False, epubcheck=True): + def run_external_tools(self, container, vim=False, epubcheck=True): with TemporaryFile(suffix='.epub', dir=self.tdir) as f: container.commit(outpath=f) - if gvim: - subprocess.Popen(['gvim', '-f', f]).wait() + if vim: + subprocess.Popen(['vim', '-f', f]).wait() if epubcheck: subprocess.Popen(['epubcheck', f]).wait() @@ -169,7 +169,7 @@ class ContainerTests(BaseTest): rename_files(c, {'index_split_000.html':'Index_split_000.html'}) self.check_links(c) - # self.run_external_tools(c, gvim=True) + # self.run_external_tools(c, vim=True) def test_file_add(self): ' Test adding of files '