Cleanup in doxygen stuff

This commit is contained in:
Yorik van Havre
2019-07-15 23:20:52 -03:00
parent f2fdc0fde7
commit a6334a4bfd
26 changed files with 141 additions and 152 deletions

View File

@@ -29,13 +29,13 @@ __title__="FreeCAD Addon Manager Module"
__author__ = "Yorik van Havre","Jonathan Wiedemann","Kurt Kremitzki"
__url__ = "http://www.freecadweb.org"
'''
"""
FreeCAD Addon Manager Module
It will fetch its contents from https://github.com/FreeCAD/FreeCAD-addons
You need a working internet connection, and optionally the GitPython package
installed.
'''
"""
import os
import re
@@ -51,10 +51,13 @@ from addonmanager_workers import *
def QT_TRANSLATE_NOOP(ctx,txt):
return txt
## \defgroup ADDONMANAGER AddonManager
# \ingroup ADDONMANAGER
# \brief The Addon Manager allows to install workbenches and macros made by users
# @{
class CommandAddonManager:
"The Addon Manager command"
"""The main Addon Manager class and FreeCAD command"""
def GetResources(self):
@@ -79,6 +82,8 @@ class CommandAddonManager:
def launch(self):
"""Shows the Addon Manager UI"""
import FreeCADGui
from PySide import QtGui
@@ -155,7 +160,7 @@ class CommandAddonManager:
def reject(self):
"called when the window has been closed"
"""called when the window has been closed"""
# save window geometry and splitter state for next use
pref = FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Addons")
@@ -200,7 +205,7 @@ class CommandAddonManager:
def update(self):
"updates the list of workbenches"
"""updates the list of workbenches"""
self.dialog.listWorkbenches.clear()
self.dialog.buttonExecute.setEnabled(False)
@@ -231,7 +236,7 @@ class CommandAddonManager:
def apply_updates(self):
"apply all available updates"
"""apply all available updates"""
if self.doUpdate:
self.install(self.doUpdate)
@@ -239,7 +244,7 @@ class CommandAddonManager:
def enable_updates(self,num):
"enables the update button"
"""enables the update button"""
if num:
self.dialog.buttonUpdateAll.setText(translate("AddonsInstaller","Apply")+" "+str(num)+" "+translate("AddonsInstaller","update(s)"))
@@ -250,7 +255,7 @@ class CommandAddonManager:
def add_addon_repo(self, addon_repo):
"adds a workbench to the list"
"""adds a workbench to the list"""
from PySide import QtGui
self.repos.append(addon_repo)
@@ -267,7 +272,7 @@ class CommandAddonManager:
def show_information(self, label):
"shows text in the information pane"
"""shows text in the information pane"""
self.dialog.description.setText(label)
if self.dialog.listWorkbenches.isVisible():
@@ -277,7 +282,7 @@ class CommandAddonManager:
def show(self,idx):
"loads information of a given workbench"
"""loads information of a given workbench"""
# this function is triggered also when the list is populated, prevent that here
if idx == 0 and self.firsttime:
@@ -300,7 +305,7 @@ class CommandAddonManager:
def show_macro(self,idx):
"loads information of a given macro"
"""loads information of a given macro"""
# this function is triggered when the list is populated, prevent that here
if idx == 0 and self.firstmacro:
@@ -328,7 +333,7 @@ class CommandAddonManager:
def switchtab(self,idx):
"does what needs to be done when switching tabs"
"""does what needs to be done when switching tabs"""
if idx == 1:
if not self.macros:
@@ -343,13 +348,13 @@ class CommandAddonManager:
def update_repos(self, repos):
"convenience function to update the internal list of workbenches"
"""convenience function to update the internal list of workbenches"""
self.repos = repos
def add_macro(self, macro):
"adds a macro to the list"
"""adds a macro to the list"""
if macro.name:
if macro in self.macros:
@@ -372,7 +377,7 @@ class CommandAddonManager:
def install(self,repos=None):
"installs a workbench or macro"
"""installs a workbench or macro"""
if self.dialog.tabWidget.currentIndex() == 0:
# Tab "Workbenches".
@@ -405,7 +410,7 @@ class CommandAddonManager:
def show_progress_bar(self, state):
"shows or hides the progress bar"
"""shows or hides the progress bar"""
if state == True:
self.dialog.tabWidget.setEnabled(False)
@@ -425,7 +430,7 @@ class CommandAddonManager:
def executemacro(self):
"executes a selected macro"
"""executes a selected macro"""
import FreeCADGui
if self.dialog.tabWidget.currentIndex() == 1:
@@ -446,14 +451,14 @@ class CommandAddonManager:
def remove_readonly(self, func, path, _):
"Remove a read-only file."
"""Remove a read-only file."""
os.chmod(path, stat.S_IWRITE)
func(path)
def remove(self):
"uninstalls a macro or workbench"
"""uninstalls a macro or workbench"""
if self.dialog.tabWidget.currentIndex() == 0:
# Tab "Workbenches".
@@ -479,7 +484,7 @@ class CommandAddonManager:
def mark_recompute(self,addon):
"marks an addon in the list as installed but needs recompute"
"""marks an addon in the list as installed but needs recompute"""
for i in range(self.dialog.listWorkbenches.count()):
txt = self.dialog.listWorkbenches.item(i).text().strip()
@@ -494,8 +499,8 @@ class CommandAddonManager:
def update_status(self,soft=False):
"""Updates the list of workbenches/macros.
If soft is true, items are not recreated (and therefore display text isn't triggered)"
"""Updates the list of workbenches/macros. If soft is true, items
are not recreated (and therefore display text isn't triggered)"
"""
moddir = FreeCAD.getUserAppDataDir() + os.sep + "Mod"
@@ -547,7 +552,7 @@ class CommandAddonManager:
def mark(self,repo):
"mark a workbench as updatable"
"""mark a workbench as updatable"""
from PySide import QtGui
for i in range(self.dialog.listWorkbenches.count()):
@@ -560,7 +565,7 @@ class CommandAddonManager:
def show_config(self):
"shows the configuration dialog"
"""shows the configuration dialog"""
import FreeCADGui
from PySide import QtGui
@@ -580,3 +585,5 @@ class CommandAddonManager:
# OK button has been pressed
pref.SetBool("AutoCheck",self.config.checkUpdates.isChecked())
pref.SetString("CustomRepositories",self.config.customRepositories.toPlainText())
## @}