[gtk-doc] python: fix bugs reported by pyflakes



commit 678819b7a0912a72ee406e0e0d084681123d8c69
Author: Stefan Sauer <ensonic users sf net>
Date:   Thu Apr 13 10:06:52 2017 +0200

    python: fix bugs reported by pyflakes

 gtkdoc/check.py    |    3 +--
 gtkdoc/mkhtml.py   |    1 -
 gtkdoc/mkman.py    |   14 ++------------
 gtkdoc/rebase.py   |    5 ++---
 gtkdoc/scan.py     |    1 -
 gtkdoc/scangobj.py |    2 --
 6 files changed, 5 insertions(+), 21 deletions(-)
---
diff --git a/gtkdoc/check.py b/gtkdoc/check.py
index 14a3bc3..8552d89 100755
--- a/gtkdoc/check.py
+++ b/gtkdoc/check.py
@@ -30,7 +30,6 @@ from __future__ import print_function
 
 import os
 import re
-import subprocess
 from glob import glob
 
 
@@ -64,7 +63,7 @@ def check_includes(filename):
                 next(line for line in lines if include in line)
             except StopIteration:
                 num_missing += 1
-                print('%s:1:E: doesn\'t appear to include "%s"' % (filename, xml_file))
+                print('%s:1:E: doesn\'t appear to include "%s"' % (filename, include))
 
     return num_missing
 
diff --git a/gtkdoc/mkhtml.py b/gtkdoc/mkhtml.py
index c2d0037..cf1f226 100644
--- a/gtkdoc/mkhtml.py
+++ b/gtkdoc/mkhtml.py
@@ -23,7 +23,6 @@
 
 import os
 import sys
-import argparse
 import subprocess
 import shutil
 from glob import glob
diff --git a/gtkdoc/mkman.py b/gtkdoc/mkman.py
index 2a9ecb5..2658cf0 100644
--- a/gtkdoc/mkman.py
+++ b/gtkdoc/mkman.py
@@ -21,11 +21,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 #
 
-import os
-import sys
-import argparse
 import subprocess
-from glob import glob
 
 from . import config
 
@@ -38,18 +34,12 @@ def run(options):
     else:
         quiet = '1'
 
-    if options.uninstalled:
-        # TODO: this does not work from buiddir!=srcdir
-        gtkdocdir = os.path.split(sys.argv[0])[0]
-    else:
-        gtkdocdir = os.path.join(config.datadir, 'gtk-doc/data')
-
-    # we could do "$path_option $PWD " to avoid needing rewriting entities that
+    # we could do "--path $PWD " to avoid needing rewriting entities that
     # are copied from the header into docs under xml
     if options.path == '':
         path_arg = []
     else:
-        path_arg = [path_option, options.path]
+        path_arg = ['--path', options.path]
 
     # would it make sense to create man pages only for certain refentries
     # e.g. for tools
diff --git a/gtkdoc/rebase.py b/gtkdoc/rebase.py
index 51b200c..ed628cb 100755
--- a/gtkdoc/rebase.py
+++ b/gtkdoc/rebase.py
@@ -27,7 +27,6 @@ The rebase tool rewrites URI references in installed HTML documentation.
 from __future__ import print_function
 
 import os
-import sys
 import re
 
 from . import common
@@ -38,7 +37,7 @@ from . import common
 # LocalMap: package => local URI
 # This maps all seen URIs of a package to fix broken links in the process:
 # RevMap: URI => package
-OnLineMap = {}
+OnlineMap = {}
 LocalMap = {}
 RevMap = {}
 # Remember what mangling we did.
@@ -159,7 +158,7 @@ def ReadIndex(dir, file):
     return onlinedir
 
 
-def AddMap(dir, onlinerdir, options):
+def AddMap(dir, onlinedir, options):
     package = None
 
     package = os.path.split(dir)[1]
diff --git a/gtkdoc/scan.py b/gtkdoc/scan.py
index aaba23e..c325f71 100644
--- a/gtkdoc/scan.py
+++ b/gtkdoc/scan.py
@@ -36,7 +36,6 @@ organized into sections ready to output the XML pages.
 import logging
 import os
 import re
-import sys
 
 from . import common
 
diff --git a/gtkdoc/scangobj.py b/gtkdoc/scangobj.py
index 5261e01..f4ff9ed 100644
--- a/gtkdoc/scangobj.py
+++ b/gtkdoc/scangobj.py
@@ -27,10 +27,8 @@ appropriately before running this script.
 
 import logging
 import os
-import re
 import string
 import subprocess
-import sys
 
 from . import common, config
 


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