src/eric7/eric7_doc.py

branch
eric7
changeset 9211
99eb1cb030a5
parent 9209
b99e7fd55fd3
child 9221
bf71ee032bb4
--- a/src/eric7/eric7_doc.py	Thu Jul 07 15:02:00 2022 +0200
+++ b/src/eric7/eric7_doc.py	Thu Jul 07 16:38:26 2022 +0200
@@ -74,6 +74,8 @@
     print("        Generate files in the named directory.")
     print("  -R, -r or --recursive")
     print("        Perform a recursive search for Python files.")
+    print("  -s directory or --startdir=directory")
+    print("        Start the documentation generation in the given directory.")
     print("  -t ext or --extension=ext")
     print("        Add the given extension to the list of file extensions.")
     print("        This option may be given multiple times.")
@@ -151,9 +153,9 @@
 
     try:
         opts, args = getopt.getopt(
-            sys.argv[1:], "c:ehio:Rrt:Vx:",
+            sys.argv[1:], "c:ehio:Rrs:t:Vx:",
             ["exclude=", "extension=", "help", "noindex", "noempty", "outdir=",
-             "recursive", "style-sheet=", "version",
+             "recursive", "startdir=", "style-sheet=", "version",
              "exclude-file=", "eol=",
              "body-color=", "body-background-color=",
              "l1header-color=", "l1header-background-color=",
@@ -168,8 +170,9 @@
         usage()
 
     excludeDirs = [".svn", ".hg", ".git", ".ropeproject", ".eric7project",
-                   "dist", "build", "doc", "docs"]
+                   ".jedi", "dist", "build", "doc", "docs"]
     excludePatterns = []
+    startDir = ""
     outputDir = "doc"
     recursive = False
     doIndex = True
@@ -189,7 +192,9 @@
     qtHelpCreateCollection = False
     
     for k, v in opts:
-        if k in ["-o", "--outdir"]:
+        if k in ["-s", "--startdir"]:
+            startDir = v
+        elif k in ["-o", "--outdir"]:
             outputDir = v
         elif k in ["-R", "-r", "--recursive"]:
             recursive = True
@@ -321,6 +326,9 @@
                                           qtHelpFilterAttribs, qtHelpTitle,
                                           qtHelpCreateCollection)
     
+    if startDir:
+        os.chdir(os.path.abspath(startDir))
+    
     for arg in args:
         if os.path.isdir(arg):
             if os.path.exists(os.path.join(

eric ide

mercurial