From 509cc82d805e7c49057ddba6aaf1109e982b7226 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Wed, 3 Jul 2013 21:58:44 +0530 Subject: [PATCH] Allow running python setup.py develop froma git checkout --- setup/install.py | 2 +- setup/translations.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup/install.py b/setup/install.py index b1698d88ed..d1bb2058f1 100644 --- a/setup/install.py +++ b/setup/install.py @@ -56,7 +56,7 @@ class Develop(Command): short_description = 'Setup a development environment for calibre' MODE = 0o755 - sub_commands = ['build', 'resources', 'iso639', 'gui',] + sub_commands = ['build', 'resources', 'gui',] def add_postinstall_options(self, parser): parser.add_option('--make-errors-fatal', action='store_true', default=False, diff --git a/setup/translations.py b/setup/translations.py index 17c8d10018..e8b0fecdf1 100644 --- a/setup/translations.py +++ b/setup/translations.py @@ -21,7 +21,12 @@ def qt_sources(): class POT(Command): # {{{ description = 'Update the .pot translation template and upload it' - LP_BASE = os.path.join(os.path.dirname(os.path.dirname(Command.SRC)), 'calibre-translations') + LP_BASE = os.path.join(os.path.dirname(Command.SRC)) + if not os.path.exists(os.path.join(LP_BASE, 'setup', 'iso_639')): + # We are in a git checkout, translations are assumed to be in a + # directory called calibre-translations at the same level as the + # calibre directory. + LP_BASE = os.path.join(os.path.dirname(os.path.dirname(Command.SRC)), 'calibre-translations') LP_SRC = os.path.join(LP_BASE, 'src') LP_PATH = os.path.join(LP_SRC, os.path.join(__appname__, 'translations')) LP_ISO_PATH = os.path.join(LP_BASE, 'setup', 'iso_639')