Merge lp:~alan-griffiths/miral/try-python3-pil into lp:miral
- try-python3-pil
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Gerry Boland |
Approved revision: | 584 |
Merged at revision: | 579 |
Proposed branch: | lp:~alan-griffiths/miral/try-python3-pil |
Merge into: | lp:miral |
Diff against target: |
197 lines (+31/-31) 5 files modified
cmake/FindPIL.cmake (+1/-1) debian/control (+1/-1) miral-shell/spinner/CMakeLists.txt (+1/-1) miral-shell/spinner/png2header.py (+12/-12) scripts/process_doxygen_xml.py (+16/-16) |
To merge this branch: | bzr merge lp:~alan-griffiths/miral/try-python3-pil |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Gerry Boland (community) | Approve | ||
Mir CI Bot | continuous-integration | Approve | |
Review via email: mp+329438@code.launchpad.net |
Commit message
Migrate to python3
Description of the change
Migrate to python3
This is a good idea anyway, but especially as using pil on python2 breaks on armhf. (As I found when trying to merge MirAL into Mir!)
Mir CI Bot (mir-ci-bot) wrote : | # |
- 579. By Alan Griffiths
-
Try incantation used by USC
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:579
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 580. By Alan Griffiths
-
Try incantations used by USC
- 581. By Alan Griffiths
-
Try incantations used by USC
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:580
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Mir CI Bot (mir-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:581
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
- 582. By Alan Griffiths
-
Convert script to python3
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:582
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 583. By Alan Griffiths
-
2to3 scripts/
process_ doxygen_ xml.py
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:583
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
- 584. By Alan Griffiths
-
Remove unnecessary build dep
Mir CI Bot (mir-ci-bot) wrote : | # |
PASSED: Continuous integration, rev:584
https:/
Executed test runs:
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
Click here to trigger a rebuild:
https:/
Preview Diff
1 | === modified file 'cmake/FindPIL.cmake' | |||
2 | --- cmake/FindPIL.cmake 2016-04-08 16:32:03 +0000 | |||
3 | +++ cmake/FindPIL.cmake 2017-08-23 15:36:18 +0000 | |||
4 | @@ -1,5 +1,5 @@ | |||
5 | 1 | execute_process( | 1 | execute_process( |
7 | 2 | COMMAND python -c "from PIL import Image" | 2 | COMMAND python3 -c "from PIL import Image" |
8 | 3 | RESULT_VARIABLE HAVE_PIL | 3 | RESULT_VARIABLE HAVE_PIL |
9 | 4 | ) | 4 | ) |
10 | 5 | 5 | ||
11 | 6 | 6 | ||
12 | === modified file 'debian/control' | |||
13 | --- debian/control 2017-06-16 11:20:59 +0000 | |||
14 | +++ debian/control 2017-08-23 15:36:18 +0000 | |||
15 | @@ -11,9 +11,9 @@ | |||
16 | 11 | xsltproc, | 11 | xsltproc, |
17 | 12 | graphviz, | 12 | graphviz, |
18 | 13 | pkg-config, | 13 | pkg-config, |
19 | 14 | python-pil, | ||
20 | 15 | google-mock (>= 1.6.0+svn437), | 14 | google-mock (>= 1.6.0+svn437), |
21 | 16 | python3:any, | 15 | python3:any, |
22 | 16 | python3-pil, | ||
23 | 17 | libmirserver-dev (>= 0.26), | 17 | libmirserver-dev (>= 0.26), |
24 | 18 | libmirclient-dev (>= 0.26), | 18 | libmirclient-dev (>= 0.26), |
25 | 19 | mirtest-dev (>= 0.26), | 19 | mirtest-dev (>= 0.26), |
26 | 20 | 20 | ||
27 | === modified file 'miral-shell/spinner/CMakeLists.txt' | |||
28 | --- miral-shell/spinner/CMakeLists.txt 2017-04-28 09:07:43 +0000 | |||
29 | +++ miral-shell/spinner/CMakeLists.txt 2017-08-23 15:36:18 +0000 | |||
30 | @@ -24,7 +24,7 @@ | |||
31 | 24 | function(png2header png header varname) | 24 | function(png2header png header varname) |
32 | 25 | add_custom_command( | 25 | add_custom_command( |
33 | 26 | OUTPUT ${header} | 26 | OUTPUT ${header} |
35 | 27 | COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py ${png} ${varname} > ${header} | 27 | COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py ${png} ${varname} > ${header} |
36 | 28 | DEPENDS ${png} ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py | 28 | DEPENDS ${png} ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py |
37 | 29 | ) | 29 | ) |
38 | 30 | endfunction() | 30 | endfunction() |
39 | 31 | 31 | ||
40 | === modified file 'miral-shell/spinner/png2header.py' | |||
41 | --- miral-shell/spinner/png2header.py 2017-08-10 16:59:22 +0000 | |||
42 | +++ miral-shell/spinner/png2header.py 2017-08-23 15:36:18 +0000 | |||
43 | @@ -37,7 +37,7 @@ | |||
44 | 37 | if line_chars == 0: | 37 | if line_chars == 0: |
45 | 38 | result += ' "' | 38 | result += ' "' |
46 | 39 | 39 | ||
48 | 40 | s = '\\%o' % ord(c) | 40 | s = '\\%o' % c |
49 | 41 | result += s | 41 | result += s |
50 | 42 | line_chars += len(s) | 42 | line_chars += len(s) |
51 | 43 | 43 | ||
52 | @@ -60,19 +60,19 @@ | |||
53 | 60 | 60 | ||
54 | 61 | def export(image, variable_name): | 61 | def export(image, variable_name): |
55 | 62 | image_info = (image.size[0], image.size[1], bytes_per_pixel(image)) | 62 | image_info = (image.size[0], image.size[1], bytes_per_pixel(image)) |
65 | 63 | print "static const struct {" | 63 | print("static const struct {") |
66 | 64 | print " unsigned int width;" | 64 | print(" unsigned int width;") |
67 | 65 | print " unsigned int height;" | 65 | print(" unsigned int height;") |
68 | 66 | print " unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */" | 66 | print(" unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */") |
69 | 67 | print " unsigned char pixel_data[%d * %d * %d + 1];" % image_info | 67 | print(" unsigned char pixel_data[%d * %d * %d + 1];" % image_info) |
70 | 68 | print "} %s = {" % variable_name | 68 | print("} %s = {" % variable_name) |
71 | 69 | print " %d, %d, %d," % image_info | 69 | print(" %d, %d, %d," % image_info) |
72 | 70 | print tocstring(image.tobytes()) | 70 | print(tocstring(image.tobytes())) |
73 | 71 | print "};" | 71 | print("};") |
74 | 72 | 72 | ||
75 | 73 | def show_usage(): | 73 | def show_usage(): |
78 | 74 | print >>sys.stderr, "Usage: ./png2header.py PNGFILE VARNAME > HEADER_FILE" | 74 | print("Usage: ./png2header.py PNGFILE VARNAME > HEADER_FILE", file=sys.stderr) |
79 | 75 | print >>sys.stderr, "Convert a PNG image to an embeddable C/C++ header file" | 75 | print("Convert a PNG image to an embeddable C/C++ header file", file=sys.stderr) |
80 | 76 | 76 | ||
81 | 77 | if len(sys.argv) < 3: | 77 | if len(sys.argv) < 3: |
82 | 78 | show_usage() | 78 | show_usage() |
83 | 79 | 79 | ||
84 | === modified file 'scripts/process_doxygen_xml.py' | |||
85 | --- scripts/process_doxygen_xml.py 2017-07-12 13:24:16 +0000 | |||
86 | +++ scripts/process_doxygen_xml.py 2017-08-23 15:36:18 +0000 | |||
87 | @@ -32,7 +32,7 @@ | |||
88 | 32 | if node.nodeType == node.ELEMENT_NODE and node.tagName == 'location': | 32 | if node.nodeType == node.ELEMENT_NODE and node.tagName == 'location': |
89 | 33 | return node.attributes['file'].value | 33 | return node.attributes['file'].value |
90 | 34 | if DEBUG: | 34 | if DEBUG: |
92 | 35 | print 'no location in:', node | 35 | print('no location in:', node) |
93 | 36 | return None | 36 | return None |
94 | 37 | 37 | ||
95 | 38 | def _has_element(node, tagname): | 38 | def _has_element(node, tagname): |
96 | @@ -43,7 +43,7 @@ | |||
97 | 43 | 43 | ||
98 | 44 | def _print_attribs(node, attribs): | 44 | def _print_attribs(node, attribs): |
99 | 45 | for attrib in attribs: | 45 | for attrib in attribs: |
101 | 46 | print ' ', attrib, '=', node.attributes[attrib].value | 46 | print(' ', attrib, '=', node.attributes[attrib].value) |
102 | 47 | 47 | ||
103 | 48 | def _concat_text_from_tags(parent, tagnames): | 48 | def _concat_text_from_tags(parent, tagnames): |
104 | 49 | substrings = [] | 49 | substrings = [] |
105 | @@ -54,7 +54,7 @@ | |||
106 | 54 | return ''.join(substrings) | 54 | return ''.join(substrings) |
107 | 55 | 55 | ||
108 | 56 | def _print_location(node): | 56 | def _print_location(node): |
110 | 57 | print ' ', 'location', '=', _get_file_location(node) | 57 | print(' ', 'location', '=', _get_file_location(node)) |
111 | 58 | 58 | ||
112 | 59 | def _get_attribs(node): | 59 | def _get_attribs(node): |
113 | 60 | kind = node.attributes['kind'].value | 60 | kind = node.attributes['kind'].value |
114 | @@ -77,9 +77,9 @@ | |||
115 | 77 | return | 77 | return |
116 | 78 | 78 | ||
117 | 79 | if publish: | 79 | if publish: |
119 | 80 | print ' PUBLISH: {}'.format(symbol) | 80 | print(' PUBLISH: {}'.format(symbol)) |
120 | 81 | else: | 81 | else: |
122 | 82 | print 'NOPUBLISH: {}'.format(symbol) | 82 | print('NOPUBLISH: {}'.format(symbol)) |
123 | 83 | 83 | ||
124 | 84 | OLD_STANZAS = '''MIRAL_1.0 { | 84 | OLD_STANZAS = '''MIRAL_1.0 { |
125 | 85 | global: | 85 | global: |
126 | @@ -514,17 +514,17 @@ | |||
127 | 514 | } MIRAL_1.4.0;''' | 514 | } MIRAL_1.4.0;''' |
128 | 515 | 515 | ||
129 | 516 | def _print_report(): | 516 | def _print_report(): |
131 | 517 | print OLD_STANZAS | 517 | print(OLD_STANZAS) |
132 | 518 | for symbol in sorted(SYMBOLS['public']): | 518 | for symbol in sorted(SYMBOLS['public']): |
133 | 519 | formatted_symbol = ' {};'.format(symbol) | 519 | formatted_symbol = ' {};'.format(symbol) |
134 | 520 | if formatted_symbol not in OLD_STANZAS and 'mir::client::' not in formatted_symbol: | 520 | if formatted_symbol not in OLD_STANZAS and 'mir::client::' not in formatted_symbol: |
137 | 521 | print formatted_symbol | 521 | print(formatted_symbol) |
138 | 522 | print END_NEW_STANZA | 522 | print(END_NEW_STANZA) |
139 | 523 | 523 | ||
140 | 524 | def _print_debug_info(node, attributes): | 524 | def _print_debug_info(node, attributes): |
141 | 525 | if not DEBUG: | 525 | if not DEBUG: |
142 | 526 | return | 526 | return |
144 | 527 | 527 | print() | |
145 | 528 | _print_attribs(node, attributes) | 528 | _print_attribs(node, attributes) |
146 | 529 | _print_location(node) | 529 | _print_location(node) |
147 | 530 | 530 | ||
148 | @@ -540,7 +540,7 @@ | |||
149 | 540 | 540 | ||
150 | 541 | if name in ['__attribute__']: | 541 | if name in ['__attribute__']: |
151 | 542 | if DEBUG: | 542 | if DEBUG: |
153 | 543 | print ' ignoring doxygen mis-parsing:', _concat_text_from_tags(node, ['argsstring']) | 543 | print(' ignoring doxygen mis-parsing:', _concat_text_from_tags(node, ['argsstring'])) |
154 | 544 | return | 544 | return |
155 | 545 | 545 | ||
156 | 546 | if name.startswith('operator'): | 546 | if name.startswith('operator'): |
157 | @@ -559,7 +559,7 @@ | |||
158 | 559 | _print_debug_info(node, ['kind', 'prot', 'static']) | 559 | _print_debug_info(node, ['kind', 'prot', 'static']) |
159 | 560 | 560 | ||
160 | 561 | if DEBUG: | 561 | if DEBUG: |
162 | 562 | print ' is_class:', is_class | 562 | print(' is_class:', is_class) |
163 | 563 | 563 | ||
164 | 564 | publish = _should_publish(is_class, is_function, node) | 564 | publish = _should_publish(is_class, is_function, node) |
165 | 565 | 565 | ||
166 | @@ -614,7 +614,7 @@ | |||
167 | 614 | filename = _get_file_location(node) | 614 | filename = _get_file_location(node) |
168 | 615 | 615 | ||
169 | 616 | if DEBUG: | 616 | if DEBUG: |
171 | 617 | print ' from file:', filename | 617 | print(' from file:', filename) |
172 | 618 | 618 | ||
173 | 619 | if ('/examples/' in filename or '/test/' in filename or '[generated]' in filename | 619 | if ('/examples/' in filename or '/test/' in filename or '[generated]' in filename |
174 | 620 | or '[STL]' in filename or _has_element(node, ['templateparamlist'])): | 620 | or '[STL]' in filename or _has_element(node, ['templateparamlist'])): |
175 | @@ -638,18 +638,18 @@ | |||
176 | 638 | 638 | ||
177 | 639 | if __name__ == "__main__": | 639 | if __name__ == "__main__": |
178 | 640 | if len(argv) == 1 or '-h' in argv or '--help' in argv: | 640 | if len(argv) == 1 or '-h' in argv or '--help' in argv: |
180 | 641 | print HELPTEXT | 641 | print(HELPTEXT) |
181 | 642 | exit() | 642 | exit() |
182 | 643 | 643 | ||
183 | 644 | for arg in argv[1:]: | 644 | for arg in argv[1:]: |
184 | 645 | try: | 645 | try: |
185 | 646 | if DEBUG: | 646 | if DEBUG: |
187 | 647 | print 'Processing:', arg | 647 | print('Processing:', arg) |
188 | 648 | _parse_compound_defs(minidom.parse(arg)) | 648 | _parse_compound_defs(minidom.parse(arg)) |
189 | 649 | except Exception as error: | 649 | except Exception as error: |
191 | 650 | print 'Error:', arg, error | 650 | print('Error:', arg, error) |
192 | 651 | 651 | ||
193 | 652 | if DEBUG: | 652 | if DEBUG: |
195 | 653 | print 'Processing complete' | 653 | print('Processing complete') |
196 | 654 | 654 | ||
197 | 655 | _print_report() | 655 | _print_report() |
FAILED: Continuous integration, rev:578 /mir-jenkins. ubuntu. com/job/ miral-ci/ 65/ /mir-jenkins. ubuntu. com/job/ build-miral/ 108/console /mir-jenkins. ubuntu. com/job/ build-0- fetch/5108 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= artful/ 5097 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= xenial/ 5097 /mir-jenkins. ubuntu. com/job/ build-1- sourcepkg/ release= zesty/5097 /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= artful/ 112/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= xenial/ 112/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= amd64,release= zesty/112/ console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= artful/ 112/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= xenial/ 112/console /mir-jenkins. ubuntu. com/job/ build-2- binpkg- miral/arch= i386,release= zesty/112/ console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /mir-jenkins. ubuntu. com/job/ miral-ci/ 65/rebuild
https:/