From e4ca01c88d893f18984f8ee6301b75a31df9221f Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Fri, 9 Mar 2018 15:18:11 -0300 Subject: [PATCH] Tools: fixes in wiki download scripts --- src/Tools/offlinedoc/buildqhelp.py | 11 ++++++----- src/Tools/offlinedoc/downloadwiki.py | 6 +++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/Tools/offlinedoc/buildqhelp.py b/src/Tools/offlinedoc/buildqhelp.py index 0cf174b551..0310a54821 100755 --- a/src/Tools/offlinedoc/buildqhelp.py +++ b/src/Tools/offlinedoc/buildqhelp.py @@ -40,7 +40,7 @@ INDEX = "Online_Help_Toc" # the start page from where to crawl the wiki VERBOSE = True # to display what's going on. Otherwise, runs totally silent. QHELPCOMPILER = 'qhelpgenerator' QCOLLECTIOMGENERATOR = 'qcollectiongenerator' -RELEASE = '0.16' +RELEASE = '0.17' # END CONFIGURATION ############################################## @@ -62,6 +62,7 @@ def crawl(): qhp = buildtoc() qhcp = createCollProjectFile() + shutil.copy("../../Gui/Icons/freecad-icon-64.png","localwiki/freecad-icon-64.png") if generate(qhcp) or compile(qhp): print "Error at compiling" return 1 @@ -100,7 +101,7 @@ def createCollProjectFile(): FreeCAD User Manual - 64px-FreeCAD05.svg.png + freecad-icon-64.png freecad/freecad qthelp://org.freecad.usermanual/doc/Online_Help_Startpage.html @@ -111,7 +112,7 @@ def createCollProjectFile(): - 64px-FreeCAD05.svg.png + freecad-icon-64.png true true @@ -122,8 +123,8 @@ def createCollProjectFile(): freecad.qhp freecad.qch - - + + freecad.qch diff --git a/src/Tools/offlinedoc/downloadwiki.py b/src/Tools/offlinedoc/downloadwiki.py index e2004ccca6..f48c319d56 100755 --- a/src/Tools/offlinedoc/downloadwiki.py +++ b/src/Tools/offlinedoc/downloadwiki.py @@ -35,7 +35,7 @@ from urllib2 import urlopen, HTTPError # CONFIGURATION ################################################# -DEFAULTURL = "https://www.freecadweb.org/wiki" #default URL if no URL is passed +DEFAULTURL = "https://www.freecadweb.org" #default URL if no URL is passed INDEX = "Online_Help_Toc" # the start page from where to crawl the wiki NORETRIEVE = ['Manual','Developer_hub','Power_users_hub','Users_hub','Source_documentation', 'User_hub','Main_Page','About_this_site','FreeCAD:General_disclaimer','FreeCAD:About','FreeCAD:Privacy_policy','Introduction_to_python'] # pages that won't be fetched (kept online) GETTRANSLATIONS = False # Set true if you want to get the translations too. @@ -47,7 +47,7 @@ VERBOSE = True # to display what's going on. Otherwise, runs totally silent. FOLDER = "./localwiki" LISTFILE = "wikifiles.txt" URL = DEFAULTURL -wikiindex = "/index.php?title=" +wikiindex = "/wiki/index.php?title=" defaultfile = " " css = """/* Basic CSS for offline wiki rendering */ @@ -289,7 +289,7 @@ def fetchimage(imagelink): while failcount < MAXFAIL: try: if VERBOSE: print " fetching " + filename - data = (urlopen(webroot(URL) + imagelink).read()) + data = (urlopen(URL + imagelink).read()) path = local(filename,image=True) file = open(path,'wb') file.write(data)