emacs likes """ more than ''', and some whitespace fixes

This commit is contained in:
Christian Thaeter 2007-07-18 01:45:31 +02:00
parent 815ed3a298
commit 805399aa7b

View file

@ -8,7 +8,7 @@
# #
# This program is free software; you can redistribute it and/or # This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as # modify it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2 of # published by the Free Software Foundation; either version 2 of
# the License, or (at your option) any later version. # the License, or (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
@ -36,24 +36,24 @@ def isCleanupOperation(env):
return env.GetOption('clean') return env.GetOption('clean')
def isHelpRequest(): def isHelpRequest():
''' this is a hack: SCons does all configure tests even if only """ this is a hack: SCons does all configure tests even if only
the helpmessage is requested. SCons doesn't export the the helpmessage is requested. SCons doesn't export the
help option for retrieval by env.GetOption(), help option for retrieval by env.GetOption(),
so we scan the commandline directly. so we scan the commandline directly.
''' """
return '-h' in sys.argv or '--help' in sys.argv return '-h' in sys.argv or '--help' in sys.argv
def srcSubtree(env,tree,isShared=False, **args): def srcSubtree(env,tree,isShared=False, **args):
''' convienience wrapper: scans the given subtree, which is """ convienience wrapper: scans the given subtree, which is
to be located within $SRCDIR, find all source files and to be located within $SRCDIR, find all source files and
declare them as Static or SharedObjects for compilation declare them as Static or SharedObjects for compilation
''' """
root = env.subst('$SRCDIR/%s' % tree) # expand $SRCDIR root = env.subst('$SRCDIR/%s' % tree) # expand $SRCDIR
if isShared: if isShared:
builder = lambda f: env.SharedObject(f, **args) builder = lambda f: env.SharedObject(f, **args)
else: else:
builder = lambda f: env.Object(f, **args) builder = lambda f: env.Object(f, **args)
return [builder(f) for f in scanSrcSubtree(root)] return [builder(f) for f in scanSrcSubtree(root)]
@ -63,9 +63,9 @@ def srcSubtree(env,tree,isShared=False, **args):
SRCPATTERNS = ['*.c','*.Cpp','*.cc'] SRCPATTERNS = ['*.c','*.Cpp','*.cc']
def scanSrcSubtree(root): def scanSrcSubtree(root):
''' scan the given subtree for source filesnames """ scan the given subtree for source filesnames
(python generator function) (python generator function)
''' """
for (dir,_,files) in os.walk(root): for (dir,_,files) in os.walk(root):
if dir.startswith('./'): if dir.startswith('./'):
dir = dir[2:] dir = dir[2:]
@ -77,7 +77,7 @@ def scanSrcSubtree(root):
def Tarball(env,location,dirs,suffix=''): def Tarball(env,location,dirs,suffix=''):
''' Custom Command: create Tarball of some subdirs """ Custom Command: create Tarball of some subdirs
location: where to create the tar (optionally incl. filename.tar.gz) location: where to create the tar (optionally incl. filename.tar.gz)
suffix: (optional) suffix to include in the tar name suffix: (optional) suffix to include in the tar name
dirs: directories to include in the tar dirs: directories to include in the tar
@ -87,7 +87,7 @@ def Tarball(env,location,dirs,suffix=''):
prior to compiling. Solution is prior to compiling. Solution is
- use the Command-Builder, but pass all target specifications as custom build vars - use the Command-Builder, but pass all target specifications as custom build vars
- create a pseudo-target located in the parent directory (not built by default) - create a pseudo-target located in the parent directory (not built by default)
''' """
targetID = '../extern-tar%s' % suffix targetID = '../extern-tar%s' % suffix
versionID = env['VERSION'] versionID = env['VERSION']
defaultName = 'cinelerra%s_%s' % (suffix, versionID) defaultName = 'cinelerra%s_%s' % (suffix, versionID)
@ -99,11 +99,11 @@ def Tarball(env,location,dirs,suffix=''):
def createTarball(target,source,env): def createTarball(target,source,env):
''' helper, builds the tar using the python2.3 tarfil lib. """ helper, builds the tar using the python2.3 tarfil lib.
This allows us to prefix all paths, thus moving the tree This allows us to prefix all paths, thus moving the tree
into a virtual subdirectory containing the Version number, into a virtual subdirectory containing the Version number,
as needed by common packaging systems. as needed by common packaging systems.
''' """
name = getTarName( location = env['location'] name = getTarName( location = env['location']
, defaultName = env['defaultName']) , defaultName = env['defaultName'])
targetspec = env['dirs'] targetspec = env['dirs']
@ -117,7 +117,7 @@ def createTarball(target,source,env):
tar.close() tar.close()
# #
# old version using shell command: # old version using shell command:
# #
# cmd = 'tar -czf %s %s' % (name,targetspec) # cmd = 'tar -czf %s %s' % (name,targetspec)
# print 'running ', cmd, ' ... ' # print 'running ', cmd, ' ... '
# pipe = os.popen (cmd) # pipe = os.popen (cmd)
@ -127,10 +127,10 @@ def createTarball(target,source,env):
def getTarName(location, defaultName): def getTarName(location, defaultName):
''' create a suitable name for the tarball. """ create a suitable name for the tarball.
- if location contains a name (*.tar.gz) then use this - if location contains a name (*.tar.gz) then use this
- otherwise append the defaultName to the specified dir - otherwise append the defaultName to the specified dir
''' """
spec = os.path.abspath(location) spec = os.path.abspath(location)
(head,tail) = os.path.split(spec) (head,tail) = os.path.split(spec)
if not os.path.isdir(head): if not os.path.isdir(head):