def handle(self): # add demo routes append_web_routes(os.path.join(demo_path, "web.py")) # add demo view and controller self._add_view() create_controller(os.path.join(demo_path, "InertiaDemoController.py")) # scaffold app (.js and vue components) self._add_assets() # update dependencies self._update_packages() self._update_webpack_configuration() self.info("Inertia demo has been installed successfully.") self.comment( 'Please run "npm install && npm run dev" to compile your fresh scaffolding.' )
def handle(self): # Adding new files for the package for from_relative, to_location in self.files: from_location = os.path.abspath( os.path.join(package_directory, from_relative)) append_file(from_location=from_location, to_location=to_location) for from_relative, to_location in self.images: from_location = os.path.abspath( os.path.join(package_directory, from_relative)) append_image(from_location=from_location, to_location=to_location) # Adds new SwaggerUIController create_controller( os.path.abspath(os.path.join(package_directory, self.controller))) # Adds new webroute /docs for the SwaggerUIController@show to serve append_web_routes( os.path.abspath(os.path.join(package_directory, self.routes)))
def handle(self): module_path = os.path.dirname(os.path.realpath(__file__)) # Publish view create_view(os.path.join(package_directory, '../templates/index.html')) # Publish BrowserlogController create_controller( os.path.join(package_directory, '../controllers/BrowserlogController.py')) # # Publish Browserlog config file create_or_append_config( os.path.join(package_directory, '../config/browserlog.py')) # # Append route with open('routes/web.py', 'a') as f: f.write("\nROUTES += [ \n") f.write(" Get('/logs', 'BrowserlogController@index'),\n") f.write(']\n')
def test_create_controller(): create_controller( os.path.join(PACKAGE_DIRECTORY, 'testpackage/test-config.py')) assert os.path.exists('app/http/controllers/test-config.py') os.remove('app/http/controllers/test-config.py')