Exemplo n.º 1
0
def main():
    projectManager = ProjectManager()
    setupScript = imp.load_source('setup', './setup.py')
    verbose = projectManager.arg('-v')
    if projectManager.arg('build'):
        if verbose:
            print 'Building project \'{}\''.format(setupScript.projectName)
            importResolver = ImportResolver(projectManager.getProjectsDirectory() +
                                            '/{}'.format(setupScript.projectName))
            importResolver.resolve()
            os.removedirs('build')
            # os.makedirs('build')
            shutil.copytree(imp.find_module('lauescript')[1], './build/')
Exemplo n.º 2
0
def main():
    projectManager = ProjectManager(mode='create')
    projectPath = projectManager.getProjectsDirectory()
    if len(argv) < 2:
        print 'Please specify the name of the project.'
        exit(1)
    newName = argv[1]
    if projectManager.projectExists(newName):
        print 'Project files with this name already exist.'
        exit(2)
    projectPath += '/{}'.format(newName)
    makeFiles(projectPath, newName)
    print '****** Created project: \'{}\' ******'.format(argv[1])
    print 'Project files are located in \'{}\''.format(projectPath)
    print 'To execute your program you will have to add \'{}\'\nto your PYTHONPATH environment variable.' \
          ' The executable is located in the \'bin\' subdirectory.\n' \
          'To add code to your project edit the *.py file created in the \'source\' subdirectory.'.format(projectPath)
    print 'Have fun!'