diff options
| author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-09 14:05:09 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-05-11 10:34:30 +0100 |
| commit | 3795f4d6a69dc4ba5208f1d05b89e65bc11d8a10 (patch) | |
| tree | 363978673f3e06a03bc2f4a3cb629dd5011cf40a /bitbake/lib/toaster/toastermain | |
| parent | a9d90f74050e2129171da09ca3427720887f67ee (diff) | |
| download | poky-3795f4d6a69dc4ba5208f1d05b89e65bc11d8a10.tar.gz | |
bitbake: bin, toaster: Fix print and exception syntax
This updates the print "" syntax to print() and fixes some exception
handling syntax such that its compatible with python v2 and v3.
(Bitbake rev: 58304fcce9727fd89564436771356c033ecd22a3)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/toaster/toastermain')
5 files changed, 7 insertions, 7 deletions
diff --git a/bitbake/lib/toaster/toastermain/management/commands/builddelete.py b/bitbake/lib/toaster/toastermain/management/commands/builddelete.py index ff93e549df..0bef8d4103 100644 --- a/bitbake/lib/toaster/toastermain/management/commands/builddelete.py +++ b/bitbake/lib/toaster/toastermain/management/commands/builddelete.py | |||
| @@ -15,7 +15,7 @@ class Command(BaseCommand): | |||
| 15 | try: | 15 | try: |
| 16 | b = Build.objects.get(pk = bid) | 16 | b = Build.objects.get(pk = bid) |
| 17 | except ObjectDoesNotExist: | 17 | except ObjectDoesNotExist: |
| 18 | print 'build %s does not exist, skipping...' %(bid) | 18 | print('build %s does not exist, skipping...' %(bid)) |
| 19 | continue | 19 | continue |
| 20 | # theoretically, just b.delete() would suffice | 20 | # theoretically, just b.delete() would suffice |
| 21 | # however SQLite runs into problems when you try to | 21 | # however SQLite runs into problems when you try to |
diff --git a/bitbake/lib/toaster/toastermain/management/commands/buildslist.py b/bitbake/lib/toaster/toastermain/management/commands/buildslist.py index cad987fd93..8dfef0aa00 100644 --- a/bitbake/lib/toaster/toastermain/management/commands/buildslist.py +++ b/bitbake/lib/toaster/toastermain/management/commands/buildslist.py | |||
| @@ -10,4 +10,4 @@ class Command(NoArgsCommand): | |||
| 10 | 10 | ||
| 11 | def handle_noargs(self,**options): | 11 | def handle_noargs(self,**options): |
| 12 | for b in Build.objects.all(): | 12 | for b in Build.objects.all(): |
| 13 | print "%d: %s %s %s" % (b.pk, b.machine, b.distro, ",".join([x.target for x in b.target_set.all()])) | 13 | print("%d: %s %s %s" % (b.pk, b.machine, b.distro, ",".join([x.target for x in b.target_set.all()]))) |
diff --git a/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py b/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py index 22b3eb79ed..911296f714 100644 --- a/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py +++ b/bitbake/lib/toaster/toastermain/management/commands/get-dburl.py | |||
| @@ -6,4 +6,4 @@ class Command(NoArgsCommand): | |||
| 6 | help = "get database url" | 6 | help = "get database url" |
| 7 | 7 | ||
| 8 | def handle_noargs(self,**options): | 8 | def handle_noargs(self,**options): |
| 9 | print getDATABASE_URL() | 9 | print(getDATABASE_URL()) |
diff --git a/bitbake/lib/toaster/toastermain/management/commands/perf.py b/bitbake/lib/toaster/toastermain/management/commands/perf.py index 71a48e95d8..6b450bbdfc 100644 --- a/bitbake/lib/toaster/toastermain/management/commands/perf.py +++ b/bitbake/lib/toaster/toastermain/management/commands/perf.py | |||
| @@ -25,7 +25,7 @@ class Command(BaseCommand): | |||
| 25 | info = self.url_info(full_url) | 25 | info = self.url_info(full_url) |
| 26 | status_code = info[0] | 26 | status_code = info[0] |
| 27 | load_time = info[1] | 27 | load_time = info[1] |
| 28 | print 'Trying \'' + full_url + '\', ' + str(status_code) + ', ' + str(load_time) | 28 | print('Trying \'' + full_url + '\', ' + str(status_code) + ', ' + str(load_time)) |
| 29 | 29 | ||
| 30 | def get_full_url(self, url_patt, url_root_res): | 30 | def get_full_url(self, url_patt, url_root_res): |
| 31 | full_url = str(url_patt).split('^')[1].replace('$>', '').replace('(?P<file_path>(?:/[', '/bin/busybox').replace('.*', '') | 31 | full_url = str(url_patt).split('^')[1].replace('$>', '').replace('(?P<file_path>(?:/[', '/bin/busybox').replace('.*', '') |
| @@ -54,5 +54,5 @@ class Command(BaseCommand): | |||
| 54 | 54 | ||
| 55 | def error(self, *args): | 55 | def error(self, *args): |
| 56 | for arg in args: | 56 | for arg in args: |
| 57 | print >>sys.stderr, arg, | 57 | print(arg, end=' ', file=sys.stderr) |
| 58 | print >>sys.stderr | 58 | print(file=sys.stderr) |
diff --git a/bitbake/lib/toaster/toastermain/settings.py b/bitbake/lib/toaster/toastermain/settings.py index 74ab60462b..8662f393a9 100644 --- a/bitbake/lib/toaster/toastermain/settings.py +++ b/bitbake/lib/toaster/toastermain/settings.py | |||
| @@ -138,7 +138,7 @@ else: | |||
| 138 | try: | 138 | try: |
| 139 | if pytz.timezone(zonename) is not None: | 139 | if pytz.timezone(zonename) is not None: |
| 140 | zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename | 140 | zonefilelist[hashlib.md5(open(filepath).read()).hexdigest()] = zonename |
| 141 | except UnknownTimeZoneError, ValueError: | 141 | except UnknownTimeZoneError as ValueError: |
| 142 | # we expect timezone failures here, just move over | 142 | # we expect timezone failures here, just move over |
| 143 | pass | 143 | pass |
| 144 | except ImportError: | 144 | except ImportError: |
