Beispiel #1
0
    def app(cls):
        HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
        logger = HenriqueLogger.func_level2logger(cls.app, logging.DEBUG)
        logger.debug({"START": "START"})
        logging.getLogger('googleapicliet.discovery_cache').setLevel(
            logging.ERROR)  # quiet googleapiclient

        # WTForm
        WTFormsTool.json_init()

        # warmup
        from henrique.main.singleton.warmer.henrique_warmer import HenriqueWarmer
        HenriqueWarmer.warmup_all()

        application = connexion.FlaskApp(__name__, )
        # application.add_api('swagger.yaml', resolver=RestyResolver("ariana.main"))
        application.add_api('swagger.yaml')

        app = application.app
        app.static_folder = HenriqueFront.dirpath_static()
        app.config.update(HenriqueFlaskConfig.config())
        logger.debug({"app.secret_key": app.secret_key})

        # from henrique.singleton.auth0.henrique_auth0 import HenriqueAuth0
        # HenriqueAuth0.app2auth0(app)

        cls._load_urls2app(app)
        # raise Exception()

        logger.debug({"END": "END"})
        return app
Beispiel #2
0
def main():
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
    logger = HenriqueLogger.func_level2logger(main, logging.DEBUG)

    j_list = list(Porttradegoodstate2Markettrend.postgres2j_iter())
    logger.debug({"# j_list": len(j_list)})

    Porttradegoodstate2Markettrend.j_iter2mongodb(j_list)
Beispiel #3
0
def main():
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
    logger = HenriqueLogger.func_level2logger(main, logging.DEBUG)

    j_list = list(Tradegood2MongoDB.postgres2j_iter())
    logger.debug({"# j_list": len(j_list)})

    Tradegood2MongoDB.j_iter2mongodb(j_list)
Beispiel #4
0
def main():

    from henrique.main.singleton.logger.henrique_logger import HenriqueLogger

    # KhalaLogger.attach_stderr2loggers(logging.DEBUG)
    DiscordLogger.attach_stderr2loggers(logging.DEBUG)
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)

    start_discord()
Beispiel #5
0
        data = {
            "env": env,
            "uid": uid,
            "gid": gid,
            "uwsgi_mode": uwsgi_mode,
        }

        filepath = os.path.join(FILE_DIR, "conf",
                                "henrique.supervisord.{}.conf".format(env))
        utf8 = Jinja2Renderer.template2text(cls.template(), data=data)
        FileTool.utf82file(utf8, filepath)

        logger.debug({
            "filepath": filepath,
            "data": data,
        })

    @classmethod
    def compile_all(cls):
        for env in HenriqueEnv.Value.list():
            cls.env2compile(env)


def main():
    HenriqueSupervisord.compile_all()


if __name__ == "__main__":
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
    main()
Beispiel #6
0
 def setUpClass(cls):
     HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
Beispiel #7
0
def main():
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
    os.environ["SKIP_WARMUP"] = ""
    HenriqueWarmer.warmup_all()
Beispiel #8
0
def main():
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
    logger = HenriqueLogger.func_level2logger(main, logging.DEBUG)

    Porttradegoodstate2Marketprice.all()
Beispiel #9
0
def main():
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)

    print("\n".join(map(",".join, PortTable.codename_culture_iter())))
Beispiel #10
0
def main():
    HenriqueLogger.attach_stderr2loggers(logging.DEBUG)
    app.run()