Module precompile |
[hide private]
[frames] | no frames]

# Source Code for Module precompile

     1  #============================================================================
     2  #Name        : precompile.py
     3  #Part of     : Helium
     4
     5  #Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
     6  #All rights reserved.
     7  #This component and the accompanying materials are made available
     8  #under the terms of the License "Eclipse Public License v1.0"
     9  #which accompanies this distribution, and is available
    10  #at the URL "http://www.eclipse.org/legal/epl-v10.html".
    11  #
    12  #Initial Contributors:
    13  #Nokia Corporation - initial contribution.
    14  #
    15  #Contributors:
    16  #
    17  #Description:
    18  #===============================================================================
    19  import os
    20  import py_compile
    21  import sys
    22  from optparse import OptionParser
    23
    24  module_list = ['buildtools.py', 'CreateZipInput.py', 'fileutils.py', 'configuration.py', 'archive\\tools.py', 'archive\\selectors.py',
    25                                  'archive\\scanners.py', 'archive\\mappers.py', 'archive\\builders.py', 'archive\\__init__.py' ]
    26 -def main():
    27      """ The application main. """
    28      cli = OptionParser(usage="%prog [options]")
    29      cli.add_option("--modulepath", help="input text to display")
    30
    31      opts, dummy_args = cli.parse_args()
    32      if not opts.modulepath:
    33          cli.print_help()
    34          sys.exit(-1)
    35
    36      for module in module_list:
    37          py_compile.compile(os.path.join(opts.modulepath, module))
    38
    39
    40  if __name__ == "__main__":
    41      main()
    42