|
1 |
| -""" |
| 1 | +""" |
2 | 2 | @file
|
3 | 3 | @brief This file contains PyQt help functions, to translate the interface, load icons, and connect signals
|
4 | 4 | @author Noah Figg <[email protected]>
|
5 | 5 | @author Jonathan Thomas <[email protected]>
|
6 | 6 | @author Olivier Girard <[email protected]>
|
7 |
| - |
| 7 | +
|
8 | 8 | @section LICENSE
|
9 |
| - |
| 9 | +
|
10 | 10 | Copyright (c) 2008-2018 OpenShot Studios, LLC
|
11 | 11 | (http://www.openshotstudios.com). This file is part of
|
12 | 12 | OpenShot Video Editor (http://www.openshot.org), an open-source project
|
13 | 13 | dedicated to delivering high quality video editing and animation solutions
|
14 | 14 | to the world.
|
15 |
| - |
| 15 | +
|
16 | 16 | OpenShot Video Editor is free software: you can redistribute it and/or modify
|
17 | 17 | it under the terms of the GNU General Public License as published by
|
18 | 18 | the Free Software Foundation, either version 3 of the License, or
|
19 | 19 | (at your option) any later version.
|
20 |
| - |
| 20 | +
|
21 | 21 | OpenShot Video Editor is distributed in the hope that it will be useful,
|
22 | 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
23 | 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
24 | 24 | GNU General Public License for more details.
|
25 |
| - |
| 25 | +
|
26 | 26 | You should have received a copy of the GNU General Public License
|
27 | 27 | along with OpenShot Library. If not, see <http://www.gnu.org/licenses/>.
|
28 | 28 | """
|
29 | 29 |
|
30 | 30 | import os
|
31 |
| -import xml.etree.ElementTree |
32 | 31 | import time
|
33 | 32 |
|
| 33 | +# Try to get the security-patched XML functions from defusedxml |
| 34 | +try: |
| 35 | + from defusedxml import ElementTree |
| 36 | +except ImportError: |
| 37 | + from xml.etree import ElementTree |
| 38 | + |
34 | 39 | from PyQt5.QtCore import QDir, QLocale
|
35 | 40 | from PyQt5.QtGui import QIcon
|
36 | 41 | from PyQt5.QtWidgets import *
|
@@ -85,7 +90,7 @@ def load_ui(window, path):
|
85 | 90 | raise error
|
86 | 91 |
|
87 | 92 | # Save xml tree for ui
|
88 |
| - window.uiTree = xml.etree.ElementTree.parse(path) |
| 93 | + window.uiTree = ElementTree.parse(path) |
89 | 94 |
|
90 | 95 |
|
91 | 96 | def get_default_icon(theme_name):
|
|
0 commit comments