Tools: fixes in wiki download scripts
This commit is contained in:
@@ -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():
|
||||
<QHelpCollectionProject version="1.0">
|
||||
<assistant>
|
||||
<title>FreeCAD User Manual</title>
|
||||
<applicationIcon>64px-FreeCAD05.svg.png</applicationIcon>
|
||||
<applicationIcon>freecad-icon-64.png</applicationIcon>
|
||||
<cacheDirectory>freecad/freecad</cacheDirectory>
|
||||
<startPage>qthelp://org.freecad.usermanual/doc/Online_Help_Startpage.html</startPage>
|
||||
<aboutMenuText>
|
||||
@@ -111,7 +112,7 @@ def createCollProjectFile():
|
||||
<!--
|
||||
<icon>images/icon.png</icon>
|
||||
-->
|
||||
<icon>64px-FreeCAD05.svg.png</icon>
|
||||
<icon>freecad-icon-64.png</icon>
|
||||
</aboutDialog>
|
||||
<enableDocumentationManager>true</enableDocumentationManager>
|
||||
<enableAddressBar>true</enableAddressBar>
|
||||
@@ -122,8 +123,8 @@ def createCollProjectFile():
|
||||
<file>
|
||||
<input>freecad.qhp</input>
|
||||
<output>freecad.qch</output>
|
||||
</file>
|
||||
</generate>
|
||||
</file>
|
||||
</generate>
|
||||
<register>
|
||||
<file>freecad.qch</file>
|
||||
</register>
|
||||
|
||||
@@ -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 = "<html><head><link type='text/css' href='wiki.css' rel='stylesheet'></head><body> </body></html>"
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user