Mercurial > libervia-backend
comparison sat_frontends/jp/base.py @ 3481:7892585b7e17
core (setup), jp, primitivus: update console scripts + classifiers:
- console scripts have been updated following the renaming with:
- "libervia-cli" and "libervia-tui" for "jp" and "primitivus"
- "li" alias as a shortcut for libervia-cli
- "jp" and "primitivus" are kept as alias
- updated classifiers to reflect Python 3.9 support
author | Goffi <goffi@goffi.org> |
---|---|
date | Sat, 20 Mar 2021 20:42:07 +0100 |
parents | be6d91572633 |
children | c9703067c700 |
comparison
equal
deleted
inserted
replaced
3480:7550ae9cfbac | 3481:7892585b7e17 |
---|---|
82 | 82 |
83 def date_decoder(arg): | 83 def date_decoder(arg): |
84 return date_utils.date_parse_ext(arg, default_tz=date_utils.TZ_LOCAL) | 84 return date_utils.date_parse_ext(arg, default_tz=date_utils.TZ_LOCAL) |
85 | 85 |
86 | 86 |
87 class Jp(object): | 87 class LiberviaCli: |
88 """ | 88 """ |
89 This class can be use to establish a connection with the | 89 This class can be use to establish a connection with the |
90 bridge. Moreover, it should manage a main loop. | 90 bridge. Moreover, it should manage a main loop. |
91 | 91 |
92 To use it, you mainly have to redefine the method run to perform | 92 To use it, you mainly have to redefine the method run to perform |
667 self.quit(e.code, raise_exc=False) | 667 self.quit(e.code, raise_exc=False) |
668 return | 668 return |
669 except QuitException: | 669 except QuitException: |
670 return | 670 return |
671 | 671 |
672 def run(self, args=None, namespace=None): | 672 def _run(self, args=None, namespace=None): |
673 self.loop = JPLoop() | 673 self.loop = JPLoop() |
674 self.loop.run(self, args, namespace) | 674 self.loop.run(self, args, namespace) |
675 | |
676 @classmethod | |
677 def run(cls): | |
678 cls()._run() | |
675 | 679 |
676 def _read_stdin(self, stdin_fut): | 680 def _read_stdin(self, stdin_fut): |
677 """Callback called by ainput to read stdin""" | 681 """Callback called by ainput to read stdin""" |
678 line = sys.stdin.readline() | 682 line = sys.stdin.readline() |
679 if line: | 683 if line: |