dbrtools/dbr.py
changeset 178 eab8a264a833
equal deleted inserted replaced
176:6d3c3db11e72 178:eab8a264a833
       
     1 # Copyright (c) 2009 Symbian Foundation Ltd
       
     2 # This component and the accompanying materials are made available
       
     3 # under the terms of the License "Eclipse Public License v1.0"
       
     4 # which accompanies this distribution, and is available
       
     5 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     6 #
       
     7 # Initial Contributors:
       
     8 # Symbian Foundation Ltd - initial contribution.
       
     9 #
       
    10 # Contributors:
       
    11 # mattd <mattd@symbian.org>
       
    12 #
       
    13 # Description:
       
    14 # DBR - the root DBR script that farms out the jobs to the other scripts
       
    15 
       
    16 import sys
       
    17 import os.path
       
    18 
       
    19 def main():
       
    20     print 'MattD: Need to fix the import path properly!'
       
    21     dbrpath = os.path.join(os.path.dirname(sys.argv[0]),'dbr')
       
    22     sys.path.append(dbrpath)
       
    23     args = sys.argv
       
    24     if(len(sys.argv)>1):
       
    25       cmd = sys.argv[1]
       
    26       args.pop(0)
       
    27       args.pop(0)
       
    28   
       
    29       if(cmd):
       
    30         try:
       
    31             command = __import__ (cmd)
       
    32             command.run(args)        
       
    33         except ImportError:
       
    34           help(args)
       
    35     else:
       
    36       help(args)
       
    37       
       
    38 def help(args):
       
    39   try:
       
    40     command = __import__ ('help')
       
    41     command.run(args)        
       
    42   except ImportError:
       
    43     print "error: Cannot find DBR tools help in %s" % dbrpath
       
    44                     
       
    45 main()
       
    46