twisted.application.twist._twist.Twist - python examples

Here are the examples of the python api twisted.application.twist._twist.Twist taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 View Complete Implementation : _twistmain.py
Copyright MIT License
Author : LeastAuthority
    def __call__(self):
        _options.getPlugins = lambda iface: [
            MainService(self.options, self._make_service),
        ]

        t = Twist()

        log_flag = u"--log-file"
        log_file = u"~/.kubetop.log"
        app_name = u"kubetop"
        if str is bytes:
            # sys.argv must be bytes Python 2
            log_flag = log_flag.encode("ascii")
            log_file = log_file.encode("ascii")
            app_name = app_name.encode("ascii")

        t.main([
            argv[0],
            log_flag, expanduser(log_file),
            app_name,
        ] + argv[1:])

        if self.exit_message:
            stdout.write(self.exit_message)
        raise SystemExit(self.exit_status)