コード例 #1
0
 def handle(self):
     create_or_append_config(
         os.path.join(
             package_directory,
             '../ding/snippets/configs/ding.py'
         )
     )
コード例 #2
0
 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')
コード例 #3
0
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')
コード例 #4
0
    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'))
コード例 #5
0
    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')
コード例 #6
0
def boot():
    create_or_append_config(
        os.path.join(package_directory, 'snippets/configs/services.py'))
コード例 #7
0
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')
コード例 #8
0
 def handle(self):
     create_or_append_config(
         os.path.join(package_directory, '../snippets/authhub.py'))
コード例 #9
0
 def handle(self):
     create_or_append_config(
         os.path.join(package_directory, "../snippets/billing.py"))
コード例 #10
0
 def handle(self):
     create_or_append_config(
         os.path.join(package_directory, '../config/socialite.py'))
コード例 #11
0
 def handle(self):
     # publish config files
     create_or_append_config(
         os.path.join(package_directory, "config/demo_package.py"))