[gnome-builder/wip/tingping/python-template] fixup! autotools-templates: Add Python Gnome project



commit ec86a6a886bdf60467b09041f538e5bf189d9452
Author: Patrick Griffis <tingping tingping se>
Date:   Mon Aug 22 14:29:41 2016 -0400

    fixup! autotools-templates: Add Python Gnome project

 .../autotools_templates/resources/Makefile.am      |   18 ++++++++++++++++++
 .../autotools_templates/resources/src/__main__.py  |    8 +++++++-
 2 files changed, 25 insertions(+), 1 deletions(-)
---
diff --git a/plugins/autotools-templates/autotools_templates/resources/Makefile.am 
b/plugins/autotools-templates/autotools_templates/resources/Makefile.am
index 3b48713..aa8ae22 100644
--- a/plugins/autotools-templates/autotools_templates/resources/Makefile.am
+++ b/plugins/autotools-templates/autotools_templates/resources/Makefile.am
@@ -19,6 +19,24 @@ AUTHORS:
 @GENERATE_CHANGELOG_RULES@
 dist-hook: dist-ChangeLog
 
+{{if enable_python}}
+pycheck_dirs = bin {{name_}}
+
+check-local:
+       @echo "  CHECK  Pyflakes" $(pycheck_dirs)
+       @if type pyflakes >/dev/null 2>&1; then \
+               (cd $(abs_top_srcdir) && pyflakes $(pycheck_dirs) ); \
+       else echo "skipped, pyflakes not installed"; \
+       fi
+       @if test -z "$$SKIP_PEP8"; then \
+               echo "  CHECK  PEP8"; \
+               if type pep8 >/dev/null 2>&1; then \
+                       (cd $(abs_top_srcdir) && pep8 --ignore=E501,E123,E124,E402,E731 --repeat 
--show-source $(pycheck_dirs) ); \
+               else echo "skipped, pep8 not installed"; \
+               fi; \
+       fi
+{{end}}
+
 GITIGNOREFILES = \
        **/*.swp \
        *.o \
diff --git a/plugins/autotools-templates/autotools_templates/resources/src/__main__.py 
b/plugins/autotools-templates/autotools_templates/resources/src/__main__.py
index 51a6916..4c8125c 100644
--- a/plugins/autotools-templates/autotools_templates/resources/src/__main__.py
+++ b/plugins/autotools-templates/autotools_templates/resources/src/__main__.py
@@ -19,7 +19,13 @@ class Application(Gtk.Application):
 
 def main():
     application = Application()
-    sys.exit(application.run(sys.argv))
+
+    try:
+        ret = application.run(sys.argv)
+    except SystemExit as e:
+        ret = e.code
+
+    sys.exit(ret)
 
 if __name__ == '__main__':
     main()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]