From bee3d2bcc9dad855db8826b2e9c74ca36b3512bb Mon Sep 17 00:00:00 2001 From: Jerome Lebleu Date: Tue, 17 Dec 2013 16:30:21 +0100 Subject: [PATCH] Update YunoHost versioning --- action_map.yml | 2 +- yunohost | 19 ------------------- yunohost.py | 29 ++++++++++++++++++++++++++--- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/action_map.yml b/action_map.yml index ddb3dff2..4d565418 100644 --- a/action_map.yml +++ b/action_map.yml @@ -39,7 +39,7 @@ general_arguments: full: --version help: Display YunoHost version action: version - version: YunoHost 2.0 beta1 + version: YunoHost %version% ############################# # User # diff --git a/yunohost b/yunohost index e9933f84..5eebbe9b 100755 --- a/yunohost +++ b/yunohost @@ -1,25 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -__credits__ = """ - Copyright (C) 2012 YunoHost - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published - by the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Affero General Public License for more details. - - 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 - """ -__author__ = 'Kload ' -__version__ = '2.0 beta1' - import os import sys import argparse diff --git a/yunohost.py b/yunohost.py index 543b0d17..1bacf28f 100644 --- a/yunohost.py +++ b/yunohost.py @@ -22,6 +22,26 @@ """ YunoHost core classes & functions """ + +__credits__ = """ + Copyright (C) 2012 YunoHost + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + 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 + """ +__author__ = 'Kload ' +__version__ = '2.0-beta3' + import os import sys try: @@ -468,10 +488,13 @@ def parse_dict(action_map): # Add general arguments for arg_name, arg_params in action_map['general_arguments'].items(): + if 'version' in arg_params: + v = arg_params['version'] + arg_params['version'] = v.replace('%version%', __version__) if 'full' in arg_params: - arg_names = [arg_name, arg_params['full']] - arg_fullname = arg_params['full'] - del arg_params['full'] + arg_names = [arg_name, arg_params['full']] + arg_fullname = arg_params['full'] + del arg_params['full'] else: arg_names = [arg_name] parsers['general'].add_argument(*arg_names, **arg_params)