129 |
129 |
130 def version(): |
130 def version(): |
131 """ |
131 """ |
132 Function to show the version information. |
132 Function to show the version information. |
133 """ |
133 """ |
134 print("""eric5_doc {0} |
134 print( |
135 |
135 """eric5_doc {0}\n""" |
136 Eric5 API documentation generator. |
136 """\n""" |
137 |
137 """Eric5 API documentation generator.\n""" |
138 Copyright (c) 2003-2013 Detlev Offenbach <detlev@die-offenbachs.de> |
138 """\n""" |
139 This is free software; see the LICENSE.GPL3 for copying conditions. |
139 """Copyright (c) 2003-2013 Detlev Offenbach""" |
140 There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A |
140 """ <detlev@die-offenbachs.de>\n""" |
141 PARTICULAR PURPOSE.""".format(Version)) |
141 """This is free software; see the LICENSE.GPL3 for copying""" |
|
142 """ conditions.\n""" |
|
143 """There is NO warranty; not even for MERCHANTABILITY or FITNESS""" |
|
144 """ FOR A\n""" |
|
145 """PARTICULAR PURPOSE.""".format(Version)) |
142 sys.exit(1) |
146 sys.exit(1) |
143 |
147 |
144 |
148 |
145 def main(): |
149 def main(): |
146 """ |
150 """ |
160 "cfheader-color=", "cfheader-background-color=", |
164 "cfheader-color=", "cfheader-background-color=", |
161 "link-color=", |
165 "link-color=", |
162 "create-qhp", "qhp-outdir=", "qhp-namespace=", |
166 "create-qhp", "qhp-outdir=", "qhp-namespace=", |
163 "qhp-virtualfolder=", "qhp-filtername=", "qhp-filterattribs=", |
167 "qhp-virtualfolder=", "qhp-filtername=", "qhp-filterattribs=", |
164 "qhp-title=", "create-qhc", |
168 "qhp-title=", "create-qhc", |
165 ]) |
169 ]) |
166 except getopt.error: |
170 except getopt.error: |
167 usage() |
171 usage() |
168 |
172 |
169 excludeDirs = ["CVS", ".svn", "_svn", ".ropeproject", "_ropeproject", |
173 excludeDirs = ["CVS", ".svn", "_svn", ".ropeproject", "_ropeproject", |
170 ".eric5project", "_eric5project", "dist", "build", "doc", |
174 ".eric5project", "_eric5project", "dist", "build", "doc", |
257 |
261 |
258 if not args: |
262 if not args: |
259 usage() |
263 usage() |
260 |
264 |
261 if qtHelpCreation and \ |
265 if qtHelpCreation and \ |
262 (qtHelpNamespace == "" or \ |
266 (qtHelpNamespace == "" or |
263 qtHelpFolder == "" or '/' in qtHelpFolder or \ |
267 qtHelpFolder == "" or '/' in qtHelpFolder or |
264 qtHelpTitle == ""): |
268 qtHelpTitle == ""): |
265 usage() |
269 usage() |
266 |
270 |
267 if qtHelpCreation: |
271 if qtHelpCreation: |
268 from PyQt4.QtCore import QCoreApplication |
272 from PyQt4.QtCore import QCoreApplication |
269 app = QCoreApplication(sys.argv) # __IGNORE_WARNING__ |
273 app = QCoreApplication(sys.argv) # __IGNORE_WARNING__ |
305 try: |
309 try: |
306 os.makedirs(qtHelpOutputDir) |
310 os.makedirs(qtHelpOutputDir) |
307 except EnvironmentError: |
311 except EnvironmentError: |
308 sys.stderr.write( |
312 sys.stderr.write( |
309 "Could not create QtHelp output directory {0}.".format( |
313 "Could not create QtHelp output directory {0}.".format( |
310 qtHelpOutputDir)) |
314 qtHelpOutputDir)) |
311 sys.exit(2) |
315 sys.exit(2) |
312 else: |
316 else: |
313 qtHelpOutputDir = os.getcwd() |
317 qtHelpOutputDir = os.getcwd() |
314 qtHelpOutputDir = os.path.abspath(qtHelpOutputDir) |
318 qtHelpOutputDir = os.path.abspath(qtHelpOutputDir) |
315 |
319 |