Skip to content
Browse files

now commit symlinks in apps dir instead of generating them in bootstr…

…ap.py
  • Loading branch information...
1 parent 47e20bc commit 8161c7f416b6b53842552346cca75003812aa2ce @trey0 trey0 committed Mar 27, 2012
Showing with 28 additions and 23 deletions.
  1. +0 −1 .gitignore
  2. +1 −0 apps/geocamAware
  3. +1 −0 apps/geocamCore
  4. +1 −0 apps/geocamFolder
  5. +1 −0 apps/geocamLens
  6. +1 −0 apps/geocamMemo
  7. +1 −0 apps/geocamTalk
  8. +1 −0 apps/geocamTrack
  9. +1 −0 apps/geocamUtil
  10. +20 −22 management/bootstrap.py
View
1 .gitignore
@@ -11,4 +11,3 @@
/settings.py
/sourceme.sh
/gigapan
-/apps
View
1 apps/geocamAware
View
1 apps/geocamCore
View
1 apps/geocamFolder
View
1 apps/geocamLens
View
1 apps/geocamMemo
View
1 apps/geocamTalk
View
1 apps/geocamTrack
View
1 apps/geocamUtil
View
42 management/bootstrap.py
@@ -41,9 +41,9 @@
dict(name='gitSubmodulesMasterBranch',
desc='Set submodules to be on their master branch for development',
confirm=True),
- dict(name='linkSubmodules',
- desc='Link submodules into apps directory',
- confirm=True),
+ #dict(name='linkSubmodules',
+ # desc='Link submodules into apps directory',
+ # confirm=True),
dict(name='installSubModuleRequirements',
desc='Install Python modules listed in the requirements for each submodule',
confirm=True),
@@ -86,27 +86,27 @@ def dosys(cmd, continueOnError=False):
ret = os.system(cmd)
if ret != 0:
if continueOnError:
- logging.warning('WARNING: Command returned non-zero return value %d', ret)
+ logging.warning('WARNING: Command returned non-zero return value %d' % ret)
else:
- logging.error('ERROR: Command returned non-zero return value %d', ret)
+ logging.error('ERROR: Command returned non-zero return value %d' % ret)
sys.exit(1)
def writeFileMakeDir(path, text):
- d = os.path.dirname(path)
- if not os.path.exists(d):
- os.makedirs(d)
+ dir = os.path.dirname(path)
+ if not os.path.exists(dir):
+ os.makedirs(dir)
f = file(path, 'w')
f.write(text + '\n')
f.close()
def fillTemplate(inputFile, outputFile, context):
if os.path.exists(outputFile):
- logging.warning('WARNING: File %s exists, not overwriting. Move current version out of the way to regenerate', outputFile)
+ logging.warning('WARNING: File %s exists, not overwriting. Move current version out of the way to regenerate' % outputFile)
return
- logging.info('generating %s', outputFile)
+ logging.info('generating %s' % outputFile)
from django.template import Template, Context
from django.conf import settings
@@ -140,9 +140,9 @@ def linkSubmodules(opts):
relativeSrc = '../%s' % src
dst = 'apps/%s' % appName
if os.path.lexists(dst):
- logging.debug(' %s -> %s skipped (already exists)', dst, relativeSrc)
+ logging.debug(' %s -> %s skipped (already exists)' % (dst, relativeSrc))
else:
- logging.debug(' %s -> %s', dst, relativeSrc)
+ logging.debug(' %s -> %s' % (dst, relativeSrc))
os.symlink(relativeSrc, dst)
@@ -154,15 +154,15 @@ def hasRequirements(reqsFile):
def installRequirements(reqsFile):
- needSudo = 'VIRTUALENV' not in os.environ
+ needSudo = 'VIRTUAL_ENV' not in os.environ
if needSudo:
sudoStr = 'sudo '
else:
sudoStr = ''
if hasRequirements(reqsFile):
dosys('%spip install -r %s' % (sudoStr, reqsFile))
else:
- logging.info('requirements file %s is empty', reqsFile)
+ logging.info('requirements file %s is empty' % reqsFile)
def installSubModuleRequirements(opts):
@@ -192,7 +192,7 @@ def needSettings(opts):
def genSettings(opts):
- secretKey = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for _ in range(50)])
+ secretKey = ''.join([choice('abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)') for i in range(50)])
fillTemplate('management/templates/%s' % SETTINGS_NAME,
SETTINGS_NAME,
@@ -229,9 +229,9 @@ def doAction(opts, action):
if status != 'NEEDED':
if opts.retry:
- logging.info('Would skip %s, status is %s, but running in retry mode', action['name'], status)
+ logging.info('Would skip %s, status is %s, but running in retry mode' % (action['name'], status))
else:
- logging.info('Skipping step %s, status is %s', action['name'], status)
+ logging.info('Skipping step %s, status is %s' % (action['name'], status))
return
# confirm with user
@@ -260,16 +260,14 @@ def doit(opts, args):
if args:
for arg in args:
if arg not in ACTION_DICT:
- print >> sys.stderr, 'ERROR: there is no action %s' % arg
- # suppress bogus pylint warning about redefining name 'a' from outer scope
- # pylint: disable=W0621
- print >> sys.stderr, 'Available actions are: %s' % (' '.join([a['name'] for a in ACTIONS]))
+ print >>sys.stderr, 'ERROR: there is no action %s' % arg
+ print >>sys.stderr, 'Available actions are: %s' % (' '.join([a['name'] for a in ACTIONS]))
sys.exit(1)
actions = [ACTION_DICT[arg] for arg in args]
else:
actions = ACTIONS
- logging.info('Working in %s', os.getcwd())
+ logging.info('Working in %s' % os.getcwd())
for action in actions:
doAction(opts, action)

0 comments on commit 8161c7f

Please sign in to comment.
Something went wrong with that request. Please try again.