mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Use vim rather than gvim
This commit is contained in:
parent
e863f7227d
commit
1f2293fc11
@ -119,7 +119,7 @@ class Check(Command):
|
|||||||
self.info('\tChecking', f)
|
self.info('\tChecking', f)
|
||||||
if self.file_has_errors(f):
|
if self.file_has_errors(f):
|
||||||
self.info('%d files left to check' % (len(dirty_files) - i - 1))
|
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])
|
self.j(self.SRC, '../session.vim'), '-f', f])
|
||||||
if self.file_has_errors(f):
|
if self.file_has_errors(f):
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
@ -15,6 +15,7 @@ from setup import Command, __appname__, __version__, require_git_master, build_c
|
|||||||
from setup.parallel_build import parallel_check_output
|
from setup.parallel_build import parallel_check_output
|
||||||
is_ci = os.environ.get('CI', '').lower() == 'true'
|
is_ci = os.environ.get('CI', '').lower() == 'true'
|
||||||
|
|
||||||
|
|
||||||
def qt_sources():
|
def qt_sources():
|
||||||
qtdir = '/usr/src/qt5'
|
qtdir = '/usr/src/qt5'
|
||||||
j = partial(os.path.join, qtdir)
|
j = partial(os.path.join, qtdir)
|
||||||
@ -24,6 +25,7 @@ def qt_sources():
|
|||||||
'qtbase/src/widgets/dialogs/qfontdialog.cpp',
|
'qtbase/src/widgets/dialogs/qfontdialog.cpp',
|
||||||
]))
|
]))
|
||||||
|
|
||||||
|
|
||||||
class POT(Command): # {{{
|
class POT(Command): # {{{
|
||||||
|
|
||||||
description = 'Update the .pot translation template and upload it'
|
description = 'Update the .pot translation template and upload it'
|
||||||
@ -203,6 +205,7 @@ class POT(Command): # {{{
|
|||||||
return pot
|
return pot
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
class Translations(POT): # {{{
|
class Translations(POT): # {{{
|
||||||
description='''Compile the translations'''
|
description='''Compile the translations'''
|
||||||
DEST = os.path.join(os.path.dirname(POT.SRC), 'resources', 'localization',
|
DEST = os.path.join(os.path.dirname(POT.SRC), 'resources', 'localization',
|
||||||
@ -317,6 +320,7 @@ class Translations(POT): # {{{
|
|||||||
lcf.write(cPickle.dumps(ld, -1))
|
lcf.write(cPickle.dumps(ld, -1))
|
||||||
|
|
||||||
stats = {}
|
stats = {}
|
||||||
|
|
||||||
def handle_stats(f, nums):
|
def handle_stats(f, nums):
|
||||||
trans = nums[0]
|
trans = nums[0]
|
||||||
total = trans if len(nums) == 1 else (trans + nums[1])
|
total = trans if len(nums) == 1 else (trans + nums[1])
|
||||||
@ -478,6 +482,7 @@ class Translations(POT): # {{{
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
class GetTranslations(Translations): # {{{
|
class GetTranslations(Translations): # {{{
|
||||||
|
|
||||||
description = 'Get updated translations from Transifex'
|
description = 'Get updated translations from Transifex'
|
||||||
@ -545,7 +550,7 @@ class GetTranslations(Translations): # {{{
|
|||||||
subprocess.check_call(pofilter)
|
subprocess.check_call(pofilter)
|
||||||
errfiles = glob.glob(errors+os.sep+'*.po')
|
errfiles = glob.glob(errors+os.sep+'*.po')
|
||||||
if errfiles:
|
if errfiles:
|
||||||
subprocess.check_call(['gvim', '-f', '-p', '--']+errfiles)
|
subprocess.check_call(['vim', '-f', '-p', '--']+errfiles)
|
||||||
for f in errfiles:
|
for f in errfiles:
|
||||||
with open(f, 'r+b') as f:
|
with open(f, 'r+b') as f:
|
||||||
raw = f.read()
|
raw = f.read()
|
||||||
@ -574,6 +579,7 @@ class GetTranslations(Translations): # {{{
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
class ISO639(Command): # {{{
|
class ISO639(Command): # {{{
|
||||||
|
|
||||||
description = 'Compile language code maps for performance'
|
description = 'Compile language code maps for performance'
|
||||||
@ -636,6 +642,7 @@ class ISO639(Command): # {{{
|
|||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
class ISO3166(ISO639): # {{{
|
class ISO3166(ISO639): # {{{
|
||||||
|
|
||||||
description = 'Compile country code maps for performance'
|
description = 'Compile country code maps for performance'
|
||||||
|
@ -83,11 +83,11 @@ class ContainerTests(BaseTest):
|
|||||||
for x in files:
|
for x in files:
|
||||||
self.assertNotIn(x, raw)
|
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:
|
with TemporaryFile(suffix='.epub', dir=self.tdir) as f:
|
||||||
container.commit(outpath=f)
|
container.commit(outpath=f)
|
||||||
if gvim:
|
if vim:
|
||||||
subprocess.Popen(['gvim', '-f', f]).wait()
|
subprocess.Popen(['vim', '-f', f]).wait()
|
||||||
if epubcheck:
|
if epubcheck:
|
||||||
subprocess.Popen(['epubcheck', f]).wait()
|
subprocess.Popen(['epubcheck', f]).wait()
|
||||||
|
|
||||||
@ -169,7 +169,7 @@ class ContainerTests(BaseTest):
|
|||||||
rename_files(c, {'index_split_000.html':'Index_split_000.html'})
|
rename_files(c, {'index_split_000.html':'Index_split_000.html'})
|
||||||
self.check_links(c)
|
self.check_links(c)
|
||||||
|
|
||||||
# self.run_external_tools(c, gvim=True)
|
# self.run_external_tools(c, vim=True)
|
||||||
|
|
||||||
def test_file_add(self):
|
def test_file_add(self):
|
||||||
' Test adding of files '
|
' Test adding of files '
|
||||||
|
Loading…
x
Reference in New Issue
Block a user