summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPapoteur <papoteur@mageia.org>2024-02-08 22:06:54 +0100
committerPapoteur <papoteur@mageia.org>2024-02-08 22:06:54 +0100
commit05e57051fb6bf346da7e0700a1262579b346d827 (patch)
tree170f49b6d244fc6b7be685c7553f26bf6ad77724
parent86f71da21c6ad7e67b4d18d0d2349a3f33dff6d8 (diff)
downloadmga-advisor-05e57051fb6bf346da7e0700a1262579b346d827.tar
mga-advisor-05e57051fb6bf346da7e0700a1262579b346d827.tar.gz
mga-advisor-05e57051fb6bf346da7e0700a1262579b346d827.tar.bz2
mga-advisor-05e57051fb6bf346da7e0700a1262579b346d827.tar.xz
mga-advisor-05e57051fb6bf346da7e0700a1262579b346d827.zip
Typo
-rw-r--r--.gitignore74
-rw-r--r--.vscode/launch.json7
-rw-r--r--10090.adv19
-rwxr-xr-xMga Advisor.desktop17
-rw-r--r--mga-advisor.py2
-rw-r--r--mga-advisor.pyproject3
-rw-r--r--mga-advisor.pyproject.user168
-rw-r--r--test.py103
8 files changed, 392 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..4a0b530
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,74 @@
+# This file is used to ignore files which are generated
+# ----------------------------------------------------------------------------
+
+*~
+*.autosave
+*.a
+*.core
+*.moc
+*.o
+*.obj
+*.orig
+*.rej
+*.so
+*.so.*
+*_pch.h.cpp
+*_resource.rc
+*.qm
+.#*
+*.*#
+core
+!core/
+tags
+.DS_Store
+.directory
+*.debug
+Makefile*
+*.prl
+*.app
+moc_*.cpp
+ui_*.h
+qrc_*.cpp
+Thumbs.db
+*.res
+*.rc
+/.qmake.cache
+/.qmake.stash
+
+# qtcreator generated files
+*.pro.user*
+CMakeLists.txt.user*
+
+# xemacs temporary files
+*.flc
+
+# Vim temporary files
+.*.swp
+
+# Visual Studio generated files
+*.ib_pdb_index
+*.idb
+*.ilk
+*.pdb
+*.sln
+*.suo
+*.vcproj
+*vcproj.*.*.user
+*.ncb
+*.sdf
+*.opensdf
+*.vcxproj
+*vcxproj.*
+
+# MinGW generated files
+*.Debug
+*.Release
+
+# Python byte code
+*.pyc
+
+# Binaries
+# --------
+*.dll
+*.exe
+
diff --git a/.vscode/launch.json b/.vscode/launch.json
new file mode 100644
index 0000000..0a3214f
--- /dev/null
+++ b/.vscode/launch.json
@@ -0,0 +1,7 @@
+{
+ // Utilisez IntelliSense pour en savoir plus sur les attributs possibles.
+ // Pointez pour afficher la description des attributs existants.
+ // Pour plus d'informations, visitez : https://go.microsoft.com/fwlink/?linkid=830387
+ "version": "0.2.0",
+ "configurations": []
+} \ No newline at end of file
diff --git a/10090.adv b/10090.adv
new file mode 100644
index 0000000..8a59626
--- /dev/null
+++ b/10090.adv
@@ -0,0 +1,19 @@
+ID: MGASA-2013-0161
+pubtime: 1370521473
+type: security
+src:
+ 2:
+ core:
+ - krb5-1.9.2-2.6.mga2
+ 3:
+ core:
+ - krb5-1.11.1-1.2.mga3
+CVE:
+ - CVE-2002-2443
+subject: Updated krb5 packages fix security vulnerability
+description: |
+ The kpasswd service provided by kadmind was vulnerable to a UDP
+ ping-pong attack (CVE-2002-2443).
+references:
+- https://bugzilla.redhat.com/show_bug.cgi?id=962531
+- http://www.mandriva.com/en/support/security/advisories/mbs1/MDVSA-2013:166/
diff --git a/Mga Advisor.desktop b/Mga Advisor.desktop
new file mode 100755
index 0000000..4b8d60d
--- /dev/null
+++ b/Mga Advisor.desktop
@@ -0,0 +1,17 @@
+[Desktop Entry]
+Comment[fr_FR]=
+Comment=
+Exec=python /home/yves/dev/git-mga/mga-advisor/mga-advisor.py
+GenericName[fr_FR]=
+GenericName=
+Icon=mageia-menu
+MimeType=
+Name[fr_FR]=Mageia Advisor
+Name=Mageia Advisor
+Path=
+StartupNotify=true
+Terminal=false
+TerminalOptions=
+Type=Application
+X-KDE-SubstituteUID=false
+X-KDE-Username=
diff --git a/mga-advisor.py b/mga-advisor.py
index 4bf4d26..ef34888 100644
--- a/mga-advisor.py
+++ b/mga-advisor.py
@@ -262,7 +262,7 @@ class Widget(QWidget):
if self.ui.bug_le.text() != "":
filename = os.path.join(QDir().homePath()+ default_path, f"{self.ui.bug_le.text()}.adv")
if os.path.exists(filename):
- response = QMessageBox.question(self, 'File exists', f'The file {filename} already exists. Do you want to override it ?', QMessageBox.Yes | QMessageBox.No)
+ response = QMessageBox.question(self, 'File exists', f'The file {filename} already exists. Do you want to overwrite it ?', QMessageBox.Yes | QMessageBox.No)
if response == QMessageBox.No:
return
with open(filename, 'w') as f:
diff --git a/mga-advisor.pyproject b/mga-advisor.pyproject
new file mode 100644
index 0000000..aac4cd4
--- /dev/null
+++ b/mga-advisor.pyproject
@@ -0,0 +1,3 @@
+{
+ "files": ["form.ui","mga-advisor.py"]
+}
diff --git a/mga-advisor.pyproject.user b/mga-advisor.pyproject.user
new file mode 100644
index 0000000..0ca96ea
--- /dev/null
+++ b/mga-advisor.pyproject.user
@@ -0,0 +1,168 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE QtCreatorProject>
+<!-- Written by QtCreator 9.0.1, 2023-10-27T08:07:56. -->
+<qtcreator>
+ <data>
+ <variable>EnvironmentId</variable>
+ <value type="QByteArray">{8f18dd68-d96e-4e4b-962d-320345646bee}</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.ActiveTarget</variable>
+ <value type="qlonglong">0</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.EditorSettings</variable>
+ <valuemap type="QVariantMap">
+ <value type="bool" key="EditorConfiguration.AutoIndent">true</value>
+ <value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
+ <value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
+ <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
+ <value type="QString" key="language">Cpp</value>
+ <valuemap type="QVariantMap" key="value">
+ <value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
+ </valuemap>
+ </valuemap>
+ <valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
+ <value type="QString" key="language">QmlJS</value>
+ <valuemap type="QVariantMap" key="value">
+ <value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
+ </valuemap>
+ </valuemap>
+ <value type="qlonglong" key="EditorConfiguration.CodeStyle.Count">2</value>
+ <value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
+ <value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
+ <value type="int" key="EditorConfiguration.IndentSize">4</value>
+ <value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
+ <value type="int" key="EditorConfiguration.MarginColumn">80</value>
+ <value type="bool" key="EditorConfiguration.MouseHiding">true</value>
+ <value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
+ <value type="int" key="EditorConfiguration.PaddingMode">1</value>
+ <value type="bool" key="EditorConfiguration.PreferSingleLineComments">false</value>
+ <value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
+ <value type="bool" key="EditorConfiguration.ShowMargin">false</value>
+ <value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
+ <value type="bool" key="EditorConfiguration.SmartSelectionChanging">true</value>
+ <value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
+ <value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
+ <value type="int" key="EditorConfiguration.TabSize">8</value>
+ <value type="bool" key="EditorConfiguration.UseGlobal">true</value>
+ <value type="bool" key="EditorConfiguration.UseIndenter">false</value>
+ <value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
+ <value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
+ <value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
+ <value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
+ <value type="QString" key="EditorConfiguration.ignoreFileTypes">*.md, *.MD, Makefile</value>
+ <value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
+ <value type="bool" key="EditorConfiguration.skipTrailingWhitespace">true</value>
+ <value type="bool" key="EditorConfiguration.tintMarginArea">true</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.PluginSettings</variable>
+ <valuemap type="QVariantMap">
+ <valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
+ <value type="bool" key="AutoTest.Framework.Boost">true</value>
+ <value type="bool" key="AutoTest.Framework.CTest">false</value>
+ <value type="bool" key="AutoTest.Framework.Catch">true</value>
+ <value type="bool" key="AutoTest.Framework.GTest">true</value>
+ <value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
+ <value type="bool" key="AutoTest.Framework.QtTest">true</value>
+ </valuemap>
+ <valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
+ <value type="int" key="AutoTest.RunAfterBuild">0</value>
+ <value type="bool" key="AutoTest.UseGlobal">true</value>
+ <valuemap type="QVariantMap" key="ClangTools">
+ <value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
+ <value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
+ <value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
+ <value type="int" key="ClangTools.ParallelJobs">2</value>
+ <valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
+ <valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
+ <valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
+ <value type="bool" key="ClangTools.UseGlobalSettings">true</value>
+ </valuemap>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Target.0</variable>
+ <valuemap type="QVariantMap">
+ <value type="QString" key="DeviceType">Desktop</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.15.2 (qt5)</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.15.2 (qt5)</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{560b780a-6f8a-4679-b2bf-6014ad708986}</value>
+ <value type="qlonglong" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+ <value type="qlonglong" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
+ <value type="qlonglong" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
+ <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">/home/yves/dev/mga-advisor</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
+ <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Python.PysideBuildStep</value>
+ </valuemap>
+ <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Build</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
+ </valuemap>
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
+ <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Clean</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
+ <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
+ <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.CustomParsers"/>
+ <value type="bool" key="ProjectExplorer.BuildConfiguration.ParseStandardOutput">false</value>
+ <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">build</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Python.PySideBuildConfiguration</value>
+ </valuemap>
+ <value type="qlonglong" key="ProjectExplorer.Target.BuildConfigurationCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
+ <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
+ <value type="qlonglong" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Deploy</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
+ </valuemap>
+ <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.DeployConfiguration.CustomData"/>
+ <value type="bool" key="ProjectExplorer.DeployConfiguration.CustomDataEnabled">false</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
+ </valuemap>
+ <value type="qlonglong" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
+ <valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
+ <value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
+ <value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
+ <value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
+ <valuelist type="QVariantList" key="CustomOutputParsers"/>
+ <value type="int" key="PE.EnvironmentAspect.Base">2</value>
+ <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">mga-advisor.py</value>
+ <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">PythonEditor.RunConfiguration./home/yves/dev/mga-advisor/mga-advisor.py</value>
+ <value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">/home/yves/dev/mga-advisor/mga-advisor.py</value>
+ <value type="QString" key="PythonEditor.RunConfiguation.Interpreter">{50bd7459-8cb2-47c0-9c74-668b4f3fba0a}</value>
+ <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
+ <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
+ <value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
+ <value type="QString" key="RunConfiguration.WorkingDirectory">/home/yves/dev/git-mga/mga-advisor</value>
+ </valuemap>
+ <value type="qlonglong" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
+ </valuemap>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.TargetCount</variable>
+ <value type="qlonglong">1</value>
+ </data>
+ <data>
+ <variable>ProjectExplorer.Project.Updater.FileVersion</variable>
+ <value type="int">22</value>
+ </data>
+ <data>
+ <variable>Version</variable>
+ <value type="int">22</value>
+ </data>
+</qtcreator>
diff --git a/test.py b/test.py
new file mode 100644
index 0000000..fc85fff
--- /dev/null
+++ b/test.py
@@ -0,0 +1,103 @@
+import sys
+from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QLabel
+from PySide6.QtCore import QSettings, QFile
+
+class MainWindow(QWidget):
+ def __init__(self):
+ super().__init__()
+
+ self.init_ui()
+
+ def init_ui(self):
+ layout = QVBoxLayout()
+
+ self.lbl_path = QLabel()
+ self.update_path_label()
+
+ btn_browse = QPushButton('Parcourir')
+ btn_browse.clicked.connect(self.browse_file)
+
+ layout.addWidget(self.lbl_path)
+ layout.addWidget(btn_browse)
+
+ self.setLayout(layout)
+ self.setWindowTitle('Lecture de chemin depuis un fichier de configuration')
+
+ def browse_file(self):
+ settings_file = QFile('settings.ini')
+ settings = QSettings(settings_file, QSettings.IniFormat)
+ filepath, _ = QFileDialog.getOpenFileName(self, "Sélectionner un fichier de configuration", "", "Fichiers de configuration (*.ini)")
+ if filepath:
+ settings.setValue('Config/path', filepath)
+ self.update_path_label()
+
+ def update_path_label(self):
+ settings_file = QFile('settings.ini')
+ settings = QSettings(settings_file, QSettings.IniFormat)
+ filepath = settings.value('Config/path')
+ if filepath:
+ self.lbl_path.setText(f'Chemin actuel : {filepath}')
+ else:
+ self.lbl_path.setText('Aucun chemin défini dans le fichier de configuration')
+
+if __name__ == '__main__':
+ app = QApplication(sys.argv)
+ window = MainWindow()
+ window.show()
+ sys.exit(app.exec())
+
+
+####################
+# autre solution
+import sys
+from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QPushButton, QLabel, QFileDialog
+import configparser
+
+class MainWindow(QWidget):
+ def __init__(self):
+ super().__init__()
+
+ self.init_ui()
+
+ def init_ui(self):
+ layout = QVBoxLayout()
+
+ self.lbl_path = QLabel()
+ self.update_path_label()
+
+ btn_browse = QPushButton('Parcourir')
+ btn_browse.clicked.connect(self.browse_file)
+
+ layout.addWidget(self.lbl_path)
+ layout.addWidget(btn_browse)
+
+ self.setLayout(layout)
+ self.setWindowTitle('Lecture de chemin depuis un fichier de configuration')
+
+ def browse_file(self):
+ options = QFileDialog.Options()
+ file_dialog = QFileDialog()
+ file_dialog.setFileMode(QFileDialog.ExistingFile)
+ filepath, _ = file_dialog.getOpenFileName(self, "Sélectionner un fichier de configuration", "", "Fichiers de configuration (*.ini)", options=options)
+ if filepath:
+ config = configparser.ConfigParser()
+ config.read(filepath)
+ if 'Config' in config and 'path' in config['Config']:
+ path = config['Config']['path']
+ self.lbl_path.setText(f'Chemin actuel : {path}')
+
+ def update_path_label(self):
+ # Lecture du chemin à partir du fichier de configuration
+ config = configparser.ConfigParser()
+ config.read('config.ini') # Assurez-vous d'avoir un fichier config.ini avec la section [Config] et une clé 'path'
+ if 'Config' in config and 'path' in config['Config']:
+ path = config['Config']['path']
+ self.lbl_path.setText(f'Chemin actuel : {path}')
+ else:
+ self.lbl_path.setText('Aucun chemin défini dans le fichier de configuration')
+
+if __name__ == '__main__':
+ app = QApplication(sys.argv)
+ window = MainWindow()
+ window.show()
+ sys.exit(app.exec())