def create_app(argv): """ Check if an app name and the domain were specified and whether the skeleton project exists. If so, create the new project, else print an error message. """ if len(argv) != 2: print "Error: Invalid argument count: got %d instead of 2." % len(argv) print "Syntax: ./pydroid app_name domain" sys.exit(1) elif not os.path.exists(skeleton_dir()): print "Error: Could not find the template for creating the project." print "Expected the template at:", skeleton_dir() sys.exit(1) else: create_example.create_example_project(EXAMPLE_NAME, argv[0], argv[1])
def hello_world(show_log=False): """ Remove the previous project if any. Create, deploy and run the new one. """ # Remove the previous project and possible corresponding build directories for dir_ in [EXAMPLE_APP_NAME, "%s-build-fc1cb9-Release" % EXAMPLE_APP_NAME]: try: shutil.rmtree(dir_) except OSError: pass # Create the new test project create_example.create_example_project( example_name=EXAMPLE_APP_NAME, app_name=EXAMPLE_APP_NAME, domain=create_example.DOMAIN, override_existing=True ) # Run it complete_deploy.complete_deploy(show_log)
def hello_world(show_log=False): """ Remove the previous project if any. Create, deploy and run the new one. """ # Remove the previous project and possible corresponding build directories for dir_ in [EXAMPLE_APP_NAME, "%s-build-fc1cb9-Release" % EXAMPLE_APP_NAME]: try: shutil.rmtree(dir_) except OSError: pass # Create the new test project create_example.create_example_project(example_name=EXAMPLE_APP_NAME, app_name=EXAMPLE_APP_NAME, domain=create_example.DOMAIN, override_existing=True) # Run it complete_deploy.complete_deploy(show_log)