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
This commit is contained in:
parent
119ce72819
commit
7ca3c657f4
1 changed files with 662 additions and 590 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue