def handle(self): create_or_append_config( os.path.join( package_directory, '../ding/snippets/configs/ding.py' ) )
def test_append_config(self): create_or_append_config(os.path.join(PACKAGE_DIRECTORY, 'testpackage/test-config.py')) create_or_append_config(os.path.join(PACKAGE_DIRECTORY, 'testpackage/test-config.py')) self.assertTrue(os.path.exists('config/test-config.py')) with open(os.path.join(PACKAGE_DIRECTORY, 'config/test-config.py')) as f: self.assertIn('ROUTES = []', f.read()) os.remove('config/test-config.py')
def test_append_config(): create_or_append_config( os.path.join(PACKAGE_DIRECTORY, 'testpackage/test-config.py')) create_or_append_config( os.path.join(PACKAGE_DIRECTORY, 'testpackage/test-config.py')) assert os.path.exists('config/test-config.py') with open(os.path.join(PACKAGE_DIRECTORY, 'config/test-config.py')) as f: assert 'ROUTES = []' in f.read() os.remove('config/test-config.py')
def handle(self): # Publish view create_view(os.path.join(package_directory, '../templates/index.html')) # Publish BrowserlogController => no need to publish it ? auto-import from package ? # Publish config file create_or_append_config( os.path.join(package_directory, '../config/mail_preview.py')) # Append route # with open('routes/web.py', 'a') as f: # f.write("\nROUTES += [ \n") # f.write(" Get('/emails', 'EmailsController@index').name('emails'),\n") # f.write(" Get('/emails/@name', 'EmailsController@detail').name('emails.detail'),\n") # f.write(" Post('/emails/@name/send', 'EmailsController@send').name('emails.send'),\n") # f.write(']\n') # OR append_web_routes(os.path.join('../routes/web.py'))
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 boot(): create_or_append_config( os.path.join(package_directory, 'snippets/configs/services.py'))
def test_create_config(): create_or_append_config( os.path.join(PACKAGE_DIRECTORY, 'testpackage/test-config.py')) assert os.path.exists('config/test-config.py') os.remove('config/test-config.py')
def handle(self): create_or_append_config( os.path.join(package_directory, '../snippets/authhub.py'))
def handle(self): create_or_append_config( os.path.join(package_directory, "../snippets/billing.py"))
def handle(self): create_or_append_config( os.path.join(package_directory, '../config/socialite.py'))
def handle(self): # publish config files create_or_append_config( os.path.join(package_directory, "config/demo_package.py"))