示例#1
0
 def parse_arguments(self):
     self.parser = ArgumentParser(
         prog='caloriestracker_init',
         description=self.tr('Create a new caloriestracker database'),
         epilog=self.epilog(),
         formatter_class=RawTextHelpFormatter)
     self.addCommonToArgParse(self.parser)
     argparse_connection_arguments_group(self.parser,
                                         default_db="caloriestracker")
     args = self.parser.parse_args()
     return args
示例#2
0
 def create_parser(self):
     self.parser = ArgumentParser(
         prog='caloriestracker_maintenance_products_system2personal',
         description=self.tr('Converts a system product in a personal one'),
         epilog=self.epilog(),
         formatter_class=RawTextHelpFormatter)
     self.addCommonToArgParse(self.parser)
     argparse_connection_arguments_group(self.parser,
                                         default_db="caloriestracker")
     group = self.parser.add_argument_group("Find parameters")
     group.add_argument('--system',
                        help=self.tr('System product'),
                        action="store",
                        required=True)
示例#3
0
 def create_parser(self):
     self.parser=ArgumentParser(prog='caloriestracker_console', description=self.tr('Report of calories'), epilog=self.epilog(), formatter_class=RawTextHelpFormatter)
     self. addCommonToArgParse(self.parser)
     argparse_connection_arguments_group(self.parser, default_db="caloriestracker")
     group = self.parser.add_argument_group("Find parameters")
     group.add_argument('--date', help=self.tr('Date to show'), action="store", default=str(date.today()))
     group.add_argument('--users_id', help=self.tr('User id'), action="store", default=1)
     group.add_argument('--find', help=self.tr('Find data'), action="store", default=None)
     group.add_argument('--add_company', help=self.tr("Adds a company"), action="store_true", default=False)
     group.add_argument('--add_product', help=self.tr("Adds a product"), action="store_true", default=False)
     group.add_argument('--add_meal', help=self.tr("Adds a company"), action="store_true", default=False)
     group.add_argument('--add_biometrics', help=self.tr("Adds biometric information"), action="store_true", default=False)
     group.add_argument('--contribution_dump', help=self.tr("Generate a dump to collaborate updating companies and products"), action="store_true", default=False)
     group.add_argument('--parse_contribution_dump', help=self.tr("Parses a dump and generates sql files for the package and for the dump owner"), action="store", default=None)
     group.add_argument('--update_after_contribution',  help=self.tr("Converts personal data to system data in the database using generated sql file of the dump owner"),  action="store", default=None)
     group.add_argument('--elaborated', help=self.tr("Show elaborated product"), action="store", default=None)