Mercurial > libervia-backend
diff frontends/src/jp/jp @ 817:c39117d00f35
jp: refactoring:
- imports from sat_frontends.jp instead of local imports
- added __init__.py
- commands now inherits from a base class: each base.CommandBase instance is a subcommand
- new arguments are added in CommandBase.add_parser_options methods, starting point si CommandBase.run or CommandBase.connected if a profile connection is needed
- commands are exported using a __commands__ variable at the top of the module
- sub-subcommand are easily added by using an other CommandBase instance as parent instead of using a Jp instance. In this case, the parent subcommand must be the one exported, and have a subcommands iterable (see cmd_file or cmd_pipe for examples).
- options which are often used (like --profile) are automatically added on demand (use_profile=True, use_progress=True)
- commands are automatically loaded when there are in a module named cmd_XXX
- restored --connect option
- restored progress bar
- restored getVersion bridge call on jp --version
- fixed file and pipe commands
- fixed forgotten translations
- fixed non SàT compliant docstrings
- better about/version dialog
author | Goffi <goffi@goffi.org> |
---|---|
date | Mon, 10 Feb 2014 13:44:09 +0100 |
parents | f8d534ed1d1e |
children | 069ad98b360d |
line wrap: on
line diff
--- a/frontends/src/jp/jp Wed Feb 05 14:52:40 2014 +0100 +++ b/frontends/src/jp/jp Mon Feb 10 13:44:09 2014 +0100 @@ -17,13 +17,9 @@ # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. -import base -import message -import pipe -import profile -import file +from sat_frontends.jp import base if __name__ == "__main__": - args = base.parser.parse_args() - args.func(args) - + jp = base.Jp() + jp.import_commands() + jp.run()