~ubuntu-branches/debian/sid/checkbox-ng/sid

« back to all changes in this revision

Viewing changes to checkbox_ng/commands/submit.py

  • Committer: Package Import Robot
  • Author(s): Zygmunt Krynicki
  • Date: 2015-07-21 13:21:12 UTC
  • mfrom: (1.1.5)
  • Revision ID: package-import@ubuntu.com-20150721132112-amf111h2y2vfv9q8
Tags: 0.20-1
* New upstream release 
* debian/control: Use the new email address for the team
  (checkbox-devel@lists.ubuntu.com). 
* debian/patches/documentation-theme: refresh
* debian/patches/fix-tests-on-python35: drop (applied upstream)
* debian/control: require plainbox 0.22 or more recent (new APIs and fixes) 

Show diffs side-by-side

added added

removed removed

Lines of Context:
94
94
        return SubmitInvocation(ns).run()
95
95
 
96
96
    def register_parser(self, subparsers):
97
 
        parser = subparsers.add_parser("submit", help=_("submit test results to the Canonical certification website"))
 
97
        parser = subparsers.add_parser("submit", help=_(
 
98
            "submit test results to the Canonical certification website"))
98
99
        self.register_arguments(parser)
99
100
 
100
101
    def register_arguments(self, parser):
101
102
        parser.set_defaults(command=self)
102
 
        parser.add_argument('submission',
103
 
            help=_("The path to the results xml file"))
 
103
        parser.add_argument(
 
104
            'submission', help=_("The path to the results xml file"))
104
105
        self.register_optional_arguments(parser, required=True)
105
106
 
106
107
    def register_optional_arguments(self, parser, required=False):
127
128
        # After Interpret the setting,
128
129
        # self.config.submit_to_c3 should has value or be Unset.
129
130
        try:
130
 
            if self.config.submit_to_c3 and \
131
 
               (self.config.submit_to_c3.lower() in ('yes', 'true') or
132
 
               int(self.config.submit_to_c3) == 1):
133
 
                # self.config.c3_url has a default value written in config.py 
 
131
            if (self.config.submit_to_c3 and
 
132
                (self.config.submit_to_c3.lower() in ('yes', 'true') or
 
133
                    int(self.config.submit_to_c3) == 1)):
 
134
                # self.config.c3_url has a default value written in config.py
134
135
                parser.set_defaults(url=self.config.c3_url)
135
136
            else:
136
137
                # if submit_to_c3 is castable to int but not 1