Merge lp:~alan-griffiths/miral/try-python3-pil into lp:miral

Proposed by Alan Griffiths
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
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!)

To post a comment you must log in.
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
579. By Alan Griffiths

Try incantation used by USC

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
580. By Alan Griffiths

Try incantations used by USC

581. By Alan Griffiths

Try incantations used by USC

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
582. By Alan Griffiths

Convert script to python3

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:582
https://mir-jenkins.ubuntu.com/job/miral-ci/69/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-miral/112
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5114
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5103
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5103
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5103
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/116/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/116
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/116/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/miral-ci/69/rebuild

review: Approve (continuous-integration)
583. By Alan Griffiths

2to3 scripts/process_doxygen_xml.py

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:583
https://mir-jenkins.ubuntu.com/job/miral-ci/70/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-miral/113
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5116
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5105
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5105
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5105
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/117
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/117/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/117
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/117/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/117
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/117/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/117
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/117/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/117
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/117/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/117
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/117/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/miral-ci/70/rebuild

review: Approve (continuous-integration)
584. By Alan Griffiths

Remove unnecessary build dep

Revision history for this message
Mir CI Bot (mir-ci-bot) wrote :

PASSED: Continuous integration, rev:584
https://mir-jenkins.ubuntu.com/job/miral-ci/71/
Executed test runs:
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-miral/114
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-0-fetch/5119
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=artful/5108
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=xenial/5108
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-1-sourcepkg/release=zesty/5108
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/118
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=artful/118/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/118
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=xenial/118/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/118
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=amd64,release=zesty/118/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/118
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=artful/118/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/118
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=xenial/118/artifact/output/*zip*/output.zip
    SUCCESS: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/118
        deb: https://mir-jenkins.ubuntu.com/job/build-2-binpkg-miral/arch=i386,release=zesty/118/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://mir-jenkins.ubuntu.com/job/miral-ci/71/rebuild

review: Approve (continuous-integration)
Revision history for this message
Gerry Boland (gerboland) wrote :

lgtm

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'cmake/FindPIL.cmake'
--- cmake/FindPIL.cmake 2016-04-08 16:32:03 +0000
+++ cmake/FindPIL.cmake 2017-08-23 15:36:18 +0000
@@ -1,5 +1,5 @@
1execute_process(1execute_process(
2 COMMAND python -c "from PIL import Image"2 COMMAND python3 -c "from PIL import Image"
3 RESULT_VARIABLE HAVE_PIL3 RESULT_VARIABLE HAVE_PIL
4)4)
55
66
=== modified file 'debian/control'
--- debian/control 2017-06-16 11:20:59 +0000
+++ debian/control 2017-08-23 15:36:18 +0000
@@ -11,9 +11,9 @@
11 xsltproc,11 xsltproc,
12 graphviz,12 graphviz,
13 pkg-config,13 pkg-config,
14 python-pil,
15 google-mock (>= 1.6.0+svn437),14 google-mock (>= 1.6.0+svn437),
16 python3:any,15 python3:any,
16 python3-pil,
17 libmirserver-dev (>= 0.26),17 libmirserver-dev (>= 0.26),
18 libmirclient-dev (>= 0.26),18 libmirclient-dev (>= 0.26),
19 mirtest-dev (>= 0.26),19 mirtest-dev (>= 0.26),
2020
=== modified file 'miral-shell/spinner/CMakeLists.txt'
--- miral-shell/spinner/CMakeLists.txt 2017-04-28 09:07:43 +0000
+++ miral-shell/spinner/CMakeLists.txt 2017-08-23 15:36:18 +0000
@@ -24,7 +24,7 @@
24function(png2header png header varname)24function(png2header png header varname)
25 add_custom_command(25 add_custom_command(
26 OUTPUT ${header}26 OUTPUT ${header}
27 COMMAND python ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py ${png} ${varname} > ${header}27 COMMAND python3 ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py ${png} ${varname} > ${header}
28 DEPENDS ${png} ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py28 DEPENDS ${png} ${CMAKE_CURRENT_SOURCE_DIR}/png2header.py
29 )29 )
30endfunction()30endfunction()
3131
=== modified file 'miral-shell/spinner/png2header.py'
--- miral-shell/spinner/png2header.py 2017-08-10 16:59:22 +0000
+++ miral-shell/spinner/png2header.py 2017-08-23 15:36:18 +0000
@@ -37,7 +37,7 @@
37 if line_chars == 0:37 if line_chars == 0:
38 result += ' "'38 result += ' "'
3939
40 s = '\\%o' % ord(c)40 s = '\\%o' % c
41 result += s41 result += s
42 line_chars += len(s)42 line_chars += len(s)
4343
@@ -60,19 +60,19 @@
6060
61def export(image, variable_name):61def export(image, variable_name):
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))
63 print "static const struct {"63 print("static const struct {")
64 print " unsigned int width;"64 print(" unsigned int width;")
65 print " unsigned int height;"65 print(" unsigned int height;")
66 print " unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */"66 print(" unsigned int bytes_per_pixel; /* 3:RGB, 4:RGBA */")
67 print " unsigned char pixel_data[%d * %d * %d + 1];" % image_info67 print(" unsigned char pixel_data[%d * %d * %d + 1];" % image_info)
68 print "} %s = {" % variable_name68 print("} %s = {" % variable_name)
69 print " %d, %d, %d," % image_info69 print(" %d, %d, %d," % image_info)
70 print tocstring(image.tobytes())70 print(tocstring(image.tobytes()))
71 print "};"71 print("};")
7272
73def show_usage():73def show_usage():
74 print >>sys.stderr, "Usage: ./png2header.py PNGFILE VARNAME > HEADER_FILE"74 print("Usage: ./png2header.py PNGFILE VARNAME > HEADER_FILE", file=sys.stderr)
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)
7676
77if len(sys.argv) < 3:77if len(sys.argv) < 3:
78 show_usage()78 show_usage()
7979
=== modified file 'scripts/process_doxygen_xml.py'
--- scripts/process_doxygen_xml.py 2017-07-12 13:24:16 +0000
+++ scripts/process_doxygen_xml.py 2017-08-23 15:36:18 +0000
@@ -32,7 +32,7 @@
32 if node.nodeType == node.ELEMENT_NODE and node.tagName == 'location':32 if node.nodeType == node.ELEMENT_NODE and node.tagName == 'location':
33 return node.attributes['file'].value33 return node.attributes['file'].value
34 if DEBUG:34 if DEBUG:
35 print 'no location in:', node35 print('no location in:', node)
36 return None36 return None
3737
38def _has_element(node, tagname):38def _has_element(node, tagname):
@@ -43,7 +43,7 @@
4343
44def _print_attribs(node, attribs):44def _print_attribs(node, attribs):
45 for attrib in attribs:45 for attrib in attribs:
46 print ' ', attrib, '=', node.attributes[attrib].value46 print(' ', attrib, '=', node.attributes[attrib].value)
4747
48def _concat_text_from_tags(parent, tagnames):48def _concat_text_from_tags(parent, tagnames):
49 substrings = []49 substrings = []
@@ -54,7 +54,7 @@
54 return ''.join(substrings)54 return ''.join(substrings)
5555
56def _print_location(node):56def _print_location(node):
57 print ' ', 'location', '=', _get_file_location(node)57 print(' ', 'location', '=', _get_file_location(node))
5858
59def _get_attribs(node):59def _get_attribs(node):
60 kind = node.attributes['kind'].value60 kind = node.attributes['kind'].value
@@ -77,9 +77,9 @@
77 return77 return
7878
79 if publish:79 if publish:
80 print ' PUBLISH: {}'.format(symbol)80 print(' PUBLISH: {}'.format(symbol))
81 else:81 else:
82 print 'NOPUBLISH: {}'.format(symbol)82 print('NOPUBLISH: {}'.format(symbol))
8383
84OLD_STANZAS = '''MIRAL_1.0 {84OLD_STANZAS = '''MIRAL_1.0 {
85global:85global:
@@ -514,17 +514,17 @@
514} MIRAL_1.4.0;'''514} MIRAL_1.4.0;'''
515515
516def _print_report():516def _print_report():
517 print OLD_STANZAS517 print(OLD_STANZAS)
518 for symbol in sorted(SYMBOLS['public']):518 for symbol in sorted(SYMBOLS['public']):
519 formatted_symbol = ' {};'.format(symbol)519 formatted_symbol = ' {};'.format(symbol)
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:
521 print formatted_symbol521 print(formatted_symbol)
522 print END_NEW_STANZA522 print(END_NEW_STANZA)
523523
524def _print_debug_info(node, attributes):524def _print_debug_info(node, attributes):
525 if not DEBUG:525 if not DEBUG:
526 return526 return
527 print527 print()
528 _print_attribs(node, attributes)528 _print_attribs(node, attributes)
529 _print_location(node)529 _print_location(node)
530530
@@ -540,7 +540,7 @@
540540
541 if name in ['__attribute__']:541 if name in ['__attribute__']:
542 if DEBUG:542 if DEBUG:
543 print ' ignoring doxygen mis-parsing:', _concat_text_from_tags(node, ['argsstring'])543 print(' ignoring doxygen mis-parsing:', _concat_text_from_tags(node, ['argsstring']))
544 return544 return
545545
546 if name.startswith('operator'):546 if name.startswith('operator'):
@@ -559,7 +559,7 @@
559 _print_debug_info(node, ['kind', 'prot', 'static'])559 _print_debug_info(node, ['kind', 'prot', 'static'])
560560
561 if DEBUG:561 if DEBUG:
562 print ' is_class:', is_class562 print(' is_class:', is_class)
563563
564 publish = _should_publish(is_class, is_function, node)564 publish = _should_publish(is_class, is_function, node)
565565
@@ -614,7 +614,7 @@
614 filename = _get_file_location(node)614 filename = _get_file_location(node)
615615
616 if DEBUG:616 if DEBUG:
617 print ' from file:', filename617 print(' from file:', filename)
618618
619 if ('/examples/' in filename or '/test/' in filename or '[generated]' in filename619 if ('/examples/' in filename or '/test/' in filename or '[generated]' in filename
620 or '[STL]' in filename or _has_element(node, ['templateparamlist'])):620 or '[STL]' in filename or _has_element(node, ['templateparamlist'])):
@@ -638,18 +638,18 @@
638638
639if __name__ == "__main__":639if __name__ == "__main__":
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:
641 print HELPTEXT641 print(HELPTEXT)
642 exit()642 exit()
643643
644 for arg in argv[1:]:644 for arg in argv[1:]:
645 try:645 try:
646 if DEBUG:646 if DEBUG:
647 print 'Processing:', arg647 print('Processing:', arg)
648 _parse_compound_defs(minidom.parse(arg))648 _parse_compound_defs(minidom.parse(arg))
649 except Exception as error:649 except Exception as error:
650 print 'Error:', arg, error650 print('Error:', arg, error)
651651
652 if DEBUG:652 if DEBUG:
653 print 'Processing complete'653 print('Processing complete')
654654
655 _print_report()655 _print_report()

Subscribers

People subscribed via source and target branches