From 01609b54797434aea1993c4cb3accbe9ba21dbe4 Mon Sep 17 00:00:00 2001 From: Andrea Date: Wed, 2 Apr 2025 22:10:10 +0200 Subject: [PATCH] Remove old python files Remove not necessary python files --- src/Tools/MemoryLeaks.py | 30 ----- src/Tools/WinVersion.py | 49 ------- src/Tools/chm.css | 274 --------------------------------------- src/Tools/pythondoc.py | 91 ------------- src/Tools/updateppa.py | 51 -------- 5 files changed, 495 deletions(-) delete mode 100755 src/Tools/MemoryLeaks.py delete mode 100644 src/Tools/WinVersion.py delete mode 100644 src/Tools/chm.css delete mode 100644 src/Tools/pythondoc.py delete mode 100644 src/Tools/updateppa.py diff --git a/src/Tools/MemoryLeaks.py b/src/Tools/MemoryLeaks.py deleted file mode 100755 index c5417f9627..0000000000 --- a/src/Tools/MemoryLeaks.py +++ /dev/null @@ -1,30 +0,0 @@ -#! python -# -*- coding: utf-8 -*- -# (c) 2006 Werner Mayer LGPL -# FreeCAD report memory leaks script to get provide the log file of Visual Studio in more readable file. - -import string, re - -# Open the memory leak file -file = open("MemLog.txt") -lines = file.readlines() -file.close() - -d = dict() -l = list() -for line in lines: - r = re.search("\\(#\\s*\\d+\\)", line) - if r is not None: - s = line[r.start() : r.end()] - t = re.search("^Leak", line) - if t is not None: - m = d[s] - l.append(m) - else: - d[s] = line - -file = open("MemLog_leaks.txt", "w") -for line in l: - line = string.replace(line, "Alloc", "Leak") - file.write(line) -file.close() diff --git a/src/Tools/WinVersion.py b/src/Tools/WinVersion.py deleted file mode 100644 index bb3abc71b8..0000000000 --- a/src/Tools/WinVersion.py +++ /dev/null @@ -1,49 +0,0 @@ -#! python -# -*- coding: utf-8 -*- -# (c) 2012 Juergen Riegel LGPL -# -# Script to create files used in Windows build -# uses SubWCRev.py for version detection# - -import SubWCRev, getopt, sys, string - - -def main(): - - input = "" - output = "." - - try: - opts, args = getopt.getopt(sys.argv[1:], "dso:", ["dir=", "src=", "out="]) - except getopt.GetoptError: - pass - - for o, a in opts: - if o in ("-d", "--dir"): - print("The %s option is deprecated. Ignoring." % (o)) - if o in ("-s", "--src"): - input = a - if o in ("-o", "--out"): - output = a - git = SubWCRev.GitControl() - - if git.extractInfo(input, ""): - print(git.hash) - print(git.branch) - print(git.rev[0:4]) - print(git.date) - print(git.url) - print(input) - print(output) - - f = open(input, "r") - o = open(output, "w") - for line in f.readlines(): - line = string.replace(line, "$WCREV$", git.rev[0:4]) - line = string.replace(line, "$WCDATE$", git.date) - line = string.replace(line, "$WCURL$", git.url) - o.write(line) - - -if __name__ == "__main__": - main() diff --git a/src/Tools/chm.css b/src/Tools/chm.css deleted file mode 100644 index 10602b080e..0000000000 --- a/src/Tools/chm.css +++ /dev/null @@ -1,274 +0,0 @@ -a.new{ color:#ba0000; text-decoration:none; } - -#toc { - /*border:1px solid #2f6fab;*/ - border:1px solid #aaaaaa; - background-color:#f9f9f9; - padding:5px; -} -.tocindent { - margin-left: 2em; -} -.tocline { - margin-bottom: 0px; -} -.toctoggle, .editsection { - font-size: smaller; -} - -/* images */ -div.floatright { - float: right; - margin: 0; - position:relative; - border: 0.5em solid White; - border-width: 0.5em 0 0.8em 1.4em; -} -div.floatright p { font-style: italic;} -div.floatleft { - float: left; - margin: 0.3em 0.5em 0.5em 0; - position:relative; - border: 0.5em solid White; - border-width: 0.5em 1.4em 0.8em 0; -} -div.floatleft p { font-style: italic; } -/* thumbnails */ -div.thumb { - margin-bottom: 0.5em; - border-style: solid; border-color: White; - width: auto; - overflow: hidden; -} -div.thumb div { - border:1px solid #cccccc; - padding: 3px !important; - background-color:#f9f9f9; - font-size: 94%; - text-align: center; -} -div.thumb div a img { - border:1px solid #cccccc; -} -div.thumb div div.thumbcaption { - border: none; - padding: 0.3em 0 0.1em 0; -} -div.magnify { display: none; } -div.tright { - float: right; - border-width: 0.5em 0 0.8em 1.4em; -} -div.tleft { - float: left; - margin-right:0.5em; - border-width: 0.5em 1.4em 0.8em 0; -} - -/* table standards */ -table.rimage { - float:right; - width:1pt; - position:relative; - margin-left:1em; - margin-bottom:1em; - text-align:center; -} - -body { - background: White; - /*font-size: 11pt !important;*/ - color: Black; - margin: 0; - padding: 0; -} - -.noprint, -div#jump-to-nav, -div.top, -div#column-one, -#colophon, -.editsection, -.toctoggle, -.tochidden, -div#f-poweredbyico, -div#f-copyrightico, -div#footer, -li#f-viewcount, -li#f-about, -li#f-disclaimer, -h3#siteSub, -li#f-privacy { - /* Hides all the elements irrelevant for printing */ - display: none; -} - -ul { - list-style-type: square; -} - -#content { - background: none; - border: none ! important; - font-size: 11pt; - /*padding: 0 ! important; - margin: 0 ! important;*/ -} - -h1, h2, h3, h4, h5, h6 -{ - font-weight: bold; -} - -p, .documentDescription { - /*margin: 1em 0 ! important;*/ - line-height: 1.2em; -} - -.tocindent p { - margin: 0 0 0 0 ! important; -} - -pre { - border: 1px dashed #2F6FAB; - white-space: pre; - font-size: 95%; - overflow: auto; - padding: 5px; - background : #F9F9F9; - color : black; -} - -table.listing, -table.listing td { - border: 1pt solid black; - border-collapse: collapse; -} -/* -a { - color: Black !important; - padding: 0 !important -} - -a:link, a:visited { - color: #520; - background: transparent; - text-decoration: underline; -} -*/ -#content a.external.text:after, #content a.external.autonumber:after { - /* Expand URLs for printing */ - content: " (" attr(href) ") "; -} - -#globalWrapper { - width: 100% !important; - min-width: 0 !important; -} - -#content { - background : white; - color : black; -} - -#column-content { - margin: 0 !important; -} - -#column-content #content { - padding: 1em; - margin: 0 !important; -} -/* MSIE/Win doesn't understand 'inherit' */ -/*a, a.external, a.new, a.stub { - color: black ! important; - text-decoration: none ! important; -} -*/ -/* Continue ... */ -/*a, a.external, a.new, a.stub { - color: inherit ! important; - text-decoration: inherit ! important; -} -*/ -img { border: none; } -img.tex { vertical-align: middle; } -span.texhtml { font-family: serif; } - -div.townBox { - position:relative; - float:right; - background:White; - margin-left:1em; - border: 1px solid gray; - padding:0.3em; - width: 200px; - overflow: hidden; - clear: right; -} -div.townBox dl { - padding: 0; - margin: 0 0 0.3em 0; - font-size: 96%; -} -div.townBox dl dt { - background: none; - margin: 0.4em 0 0 0; -} -div.townBox dl dd { - margin: 0.1em 0 0 1.1em; - background-color: #f3f3f3; -} - -#siteNotice { display: none; } - -table.gallery { - border: 1px solid #cccccc; - margin: 2px; - padding: 2px; - background-color:#ffffff; -} - -table.gallery tr { - vertical-align:top; -} - -div.gallerybox { - border: 1px solid #cccccc; - margin: 2px; - background-color:#f9f9f9; - width: 150px; -} - -div.gallerybox div.thumb { - text-align: center; - border: 1px solid #cccccc; - margin: 2px; -} - -div.gallerytext { - font-size: 94%; - padding: 2px 4px; -} - -/* -** Diff rendering -*/ -table.diff { background:white; } -td.diff-otitle { background:#ffffff; } -td.diff-ntitle { background:#ffffff; } -td.diff-addedline { - background:#ccffcc; - font-size: smaller; - border: solid 2px black; -} -td.diff-deletedline { - background:#ffffaa; - font-size: smaller; - border: dotted 2px black; -} -td.diff-context { - background:#eeeeee; - font-size: smaller; -} -span.diffchange { color: silver; font-weight: bold; text-decoration: underline; } diff --git a/src/Tools/pythondoc.py b/src/Tools/pythondoc.py deleted file mode 100644 index 5e0547efab..0000000000 --- a/src/Tools/pythondoc.py +++ /dev/null @@ -1,91 +0,0 @@ -#! python -# -*- coding: utf-8 -*- -# (c) 2007 Werner Mayer LGPL -# Create HTML documentation from FreeCAD's Python modules and classes. - -import pydoc, pkgutil, sys, os, dircache, zipfile - - -def generateDoc(): - # Get the path to the FreeCAD module relative to this directory - toolspath = os.path.dirname(__file__) - homepath = toolspath + "/../../" - homepath = os.path.realpath(homepath) - binpath = os.path.join(homepath, "bin") - docpath = os.path.join(homepath, "doc") - modpath = os.path.join(homepath, "Mod") - - # Change to the doc directory - cwd = os.getcwd() - print("Change to " + docpath) - os.chdir(homepath) - if os.path.exists("doc") == False: - os.mkdir("doc") - os.chdir("doc") - - # Add the bin path to the system path - if os.name == "nt": - os.environ["PATH"] = os.environ["PATH"] + ";" + binpath - else: - os.environ["PATH"] = os.environ["PATH"] + ":" + binpath - - # Import FreeCAD module - sys.path.append(binpath) - print("Write documentation for module 'FreeCAD'") - pydoc.writedoc("FreeCAD") - print("") - - # Module directory - ModDirs = dircache.listdir(modpath) - - # Search for module paths and append them to Python path - # for Dir in ModDirs: - # if (Dir != '__init__.py'): - # sys.path.append( os.path.join(modpath,Dir) ) - - # Walk through the module paths again and try loading the modules to create HTML files - for Dir in ModDirs: - dest = os.path.join(modpath, Dir) - print("Write documentation for module '" + Dir + "'") - if Dir != "__init__.py": - writedocs(dest) - print("") - - # Now we must create a document and create instances of all Python classes which - # cannot be directly created by a module. - - # Create a ZIP archive from all HTML files - print("Creating ZIP archive 'docs.zip'...") - zip = zipfile.ZipFile("docs.zip", "w") - for file in os.listdir("."): - if not os.path.isdir(file): - if file.find(".html") > 0: - print(" Adding file " + file + " to archive") - zip.write(file) - - print("done.") - zip.close() - - # Remove all HTML files - print("Cleaning up HTML files...") - for file in os.listdir("."): - if not os.path.isdir(file): - if file.find(".html") > 0: - print(" Removing " + file) - os.remove(file) - - os.chdir(cwd) - print("done.") - - -def writedocs(dir, pkgpath=""): - """Write out HTML documentation for all modules in a directory tree.""" - for importer, modname, ispkg in pkgutil.walk_packages([dir], pkgpath): - # Ignore all debug modules - if modname[-2:] != "_d": - pydoc.writedoc(modname) - return - - -if __name__ == "__main__": - generateDoc() diff --git a/src/Tools/updateppa.py b/src/Tools/updateppa.py deleted file mode 100644 index db79afff92..0000000000 --- a/src/Tools/updateppa.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/python -# -*- coding: utf-8 -*- -# (c) 2012 Werner Mayer LGPL - -import sys -from os import path -from tempfile import gettempdir - -from bzrlib.branch import Branch -from bzrlib.workingtree import WorkingTree - - -def runUpdate(filename): - branch = "versioning.git" - REMOTE_URL = "bzr+ssh://bazaar.launchpad.net/~freecad-maintainers/freecad/%s" % (branch) - LOCAL_BRANCH = path.join(gettempdir(), branch) - - # Location of branch on Launchpad - remote_branch = Branch.open(REMOTE_URL) - - # Location of branch on local system - local_branch = remote_branch.bzrdir.sprout(LOCAL_BRANCH).open_branch() - ( - False if local_branch.__name__ else True - ) # "Use" to silence analyzers, pending PEP 640 or similar - - # Change a file in the local branch - try: - wf = open(LOCAL_BRANCH + "/src/Build/Version.h", "w") - rf = open(filename, "r") - except IOError as error: - raise error - else: - wf.write(rf.read()) - wf.close() - - # Commit the change - tree = WorkingTree.open(LOCAL_BRANCH) - tree.commit("Update version number") - - # Push back to Launchpad - # transport = get_transport(PUSHTO_URL) - # local_branch.create_clone_on_transport(transport) - - -def main(): - runUpdate(sys.argv[1]) - - -if __name__ == "__main__": - main()