Skip to main content

This is the tools for python.

Project description

wd_pytools

Introduce

This is the tools for python.

wdcmd

import time

from wdcmd import Info, entity


class TestServer:
    config_path = 'config.yaml'
    status = True

    def info_run(self):
        return Info("run", "run application") \
                   .set_args("c", self.config_path, "閰嶇疆鏂囦欢鍦板潃"), self.run

    def run(self, ctx):
        print(f"閰嶇疆鏂囦欢鍦板潃锛歿ctx.get('c')}")
        while self.status:
            print("test run ....")
            time.sleep(1)

    def exit(self):
        self.status = False
        print("server stop over")


if __name__ == "__main__":
    server = TestServer()
    entity.register(*server.info_run()).on_exits(server.exit).launch()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wd_pytools-0.0.3.tar.gz (5.1 kB view hashes)

Uploaded Source

Built Distribution

wd_pytools-0.0.3-py3-none-any.whl (6.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page