[gtk-doc] check: move arg handling to launcher
- From: Stefan Sauer <stefkost src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk-doc] check: move arg handling to launcher
- Date: Fri, 31 Mar 2017 14:08:17 +0000 (UTC)
commit 2da413565d3fcdbf828af877976767bc1a63d702
Author: Stefan Sauer <ensonic users sf net>
Date: Fri Mar 31 15:51:36 2017 +0200
check: move arg handling to launcher
gtkdoc-check.in | 11 ++++++++---
gtkdoc/check.py | 10 ++--------
2 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/gtkdoc-check.in b/gtkdoc-check.in
index 59f5b63..0b9a944 100755
--- a/gtkdoc-check.in
+++ b/gtkdoc-check.in
@@ -20,10 +20,15 @@
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
-import sys
+import argparse, sys
sys.path.append('@PYTHON_PACKAGE_DIR@')
-from gtkdoc import check
+from gtkdoc import check, config
if __name__== '__main__':
- sys.exit(check.run())
\ No newline at end of file
+ parser = argparse.ArgumentParser(
+ description='gtkdoc-check version %s - run documentation unit tests' % config.version)
+ parser.add_argument('--version', action='version', version=config.version)
+ options = parser.parse_args()
+
+ sys.exit(check.run(options))
\ No newline at end of file
diff --git a/gtkdoc/check.py b/gtkdoc/check.py
index 298e35e..47586e8 100755
--- a/gtkdoc/check.py
+++ b/gtkdoc/check.py
@@ -29,11 +29,9 @@
# Support both Python 2 and 3
from __future__ import print_function
-import os, re, argparse, subprocess
+import os, re, subprocess
from glob import glob
-from . import config
-
class FileFormatError(Exception):
@@ -84,7 +82,7 @@ def read_file(filename):
return f.read().splitlines()
-def run():
+def run(options=None):
"""Runs the tests.
Returns:
@@ -92,10 +90,6 @@ def run():
"""
checks = 4
- parser = argparse.ArgumentParser(description='gtkdoc-check version %s - run documentation unit tests' %
config.version)
- parser.add_argument('--version', action='version', version=config.version)
- parser.parse_args()
-
# Get parameters from test env, if not there try to grab them from the makefile
# We like Makefile.am more but builddir does not necessarily contain one.
makefilename = 'Makefile.am'
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]