diff --git a/tools/create_package.py b/tools/create_package.py index 8d33d12..fce22c9 100644 --- a/tools/create_package.py +++ b/tools/create_package.py @@ -4,7 +4,7 @@ import shutil import zipfile import json -from lib import tools_lib as Tools +from lib import utils as Utils def GetVersion (rootDir): packageJson = None @@ -57,7 +57,7 @@ def CreateWebsite (config, rootDir, websiteDir, version, testBuild): ] for htmlFileName in htmlFileNames: htmlFilePath = os.path.join (websiteDir, htmlFileName) - replacer = Tools.TokenReplacer (htmlFilePath, False) + replacer = Utils.TokenReplacer (htmlFilePath, False) replacer.ReplaceTokenFileLinks ('', '', websiteLibFiles, version) replacer.ReplaceTokenFileLinks ('', '', websiteFiles, version) replacer.ReplaceTokenFileLinks ('', '', pluginFiles, version) @@ -73,15 +73,15 @@ def CreateWebsite (config, rootDir, websiteDir, version, testBuild): replacer.ReplaceTokenContent ('', '', embedInitScriptContent) metaFile = os.path.join (rootDir, 'plugins', 'website_meta_data.txt') if os.path.exists (metaFile): - metaContent = Tools.GetFileContent (metaFile) + metaContent = Utils.GetFileContent (metaFile) replacer.ReplaceTokenContent ('', '', metaContent) analyticsFile = os.path.join (rootDir, 'plugins', 'website_analytics_data.txt') if os.path.exists (analyticsFile) and not testBuild: - analyticsContent = Tools.GetFileContent (analyticsFile) + analyticsContent = Utils.GetFileContent (analyticsFile) replacer.ReplaceTokenContent ('', '', analyticsContent) introFile = os.path.join (rootDir, 'plugins', 'website_intro_data.txt') if os.path.exists (introFile): - introContent = Tools.GetFileContent (introFile) + introContent = Utils.GetFileContent (introFile) replacer.ReplaceTokenContent ('', '', introContent) replacer.WriteToFile (htmlFilePath) @@ -116,7 +116,7 @@ def Main (argv): if len (argv) >= 2 and argv[1] == 'test': testBuild = True buildDir = os.path.join (rootDir, 'build', 'test') - Tools.PrintInfo ('Creating test build.') + Utils.PrintInfo ('Creating test build.') websiteDir = os.path.join (buildDir, 'website') packageDir = os.path.join (buildDir, 'package') @@ -128,13 +128,13 @@ def Main (argv): config = json.load (configJson) version = GetVersion (rootDir) - Tools.PrintInfo ('Create build directory') + Utils.PrintInfo ('Create build directory') CreateWebsite (config, rootDir, websiteDir, version, testBuild) - Tools.PrintInfo ('Create package.') + Utils.PrintInfo ('Create package.') packageResult = CreatePackage (rootDir, websiteDir, packageDir) if not packageResult: - Tools.PrintError ('Create package failed.') + Utils.PrintError ('Create package failed.') return 1 return 0 diff --git a/tools/generate_docs.py b/tools/generate_docs.py index bd93585..801c375 100644 --- a/tools/generate_docs.py +++ b/tools/generate_docs.py @@ -8,7 +8,7 @@ import platform import html import re -from lib import tools_lib as Tools +from lib import utils as Utils class HtmlGenerator: def __init__ (self, eol): @@ -362,7 +362,7 @@ def BuildHierarchy (doclets): def CreateFromTemplate (templateHtmlPath, resultHtmlPath, navigation, title, content, eol): shutil.copy (templateHtmlPath, resultHtmlPath) - Tools.ReplaceStringsInFile (resultHtmlPath, [ + Utils.ReplaceStringsInFile (resultHtmlPath, [ ('$$$TITLE$$$', title), ('$$$NAVIGATION$$$', navigation.GenerateHtml (eol)), ('$$$MAIN$$$', content) @@ -399,7 +399,7 @@ def BuildNavigation (pageGroups, hierarchy): def BuildDocumentationFiles (navigation, pageGroups, hierarchy, sourceDir, resultDir): templateHtmlPath = os.path.join (sourceDir, 'Template.html') - eol = Tools.GetEOLCharFromFile (templateHtmlPath) + eol = Utils.GetEOLCharFromFile (templateHtmlPath) for pageGroup in pageGroups: for page in pageGroup['pages']: @@ -407,7 +407,7 @@ def BuildDocumentationFiles (navigation, pageGroups, hierarchy, sourceDir, resul continue sourceHtmlPath = os.path.join (sourceDir, page['url']) pageHtmlPath = os.path.join (resultDir, page['url']) - pageContent = '