Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
EO Time Series Viewer
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Benjamin Jakimow
EO Time Series Viewer
Commits
fdfb89af
Commit
fdfb89af
authored
8 years ago
by
benjamin.jakimow@geo.hu-berlin.de
Browse files
Options
Downloads
Patches
Plain Diff
ui package
parent
ba461ea7
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libs/pyqtgraph/util/colorama/__init__.py
+0
-0
0 additions, 0 deletions
libs/pyqtgraph/util/colorama/__init__.py
timeseriesviewer/ui/__init__.py
+62
-0
62 additions, 0 deletions
timeseriesviewer/ui/__init__.py
with
62 additions
and
0 deletions
libs/pyqtgraph/util/colorama/__init__.py
deleted
100644 → 0
+
0
−
0
View file @
ba461ea7
This diff is collapsed.
Click to expand it.
timeseriesviewer/ui/__init__.py
0 → 100644
+
62
−
0
View file @
fdfb89af
import
os
,
sys
,
six
from
PyQt4.QtCore
import
*
from
PyQt4.QtXml
import
*
from
PyQt4.QtGui
import
*
from
qgis.gui
import
*
from
qgis.core
import
*
from
PyQt4
import
uic
#dictionary to store form classes. *.ui file name is key
FORM_CLASSES
=
dict
()
from
timeseriesviewer
import
jp
,
DIR_UI
,
dprint
def
loadUIFormClass
(
pathUi
,
from_imports
=
False
):
"""
Load UI files and takes care on Qgs custom widgets
:param pathUi:
:param from_imports:
:return:
"""
RC_SUFFIX
=
'
_py3
'
if
six
.
PY3
else
'
_py2
'
dirUi
=
os
.
path
.
dirname
(
pathUi
)
assert
os
.
path
.
exists
(
pathUi
)
if
pathUi
not
in
FORM_CLASSES
.
keys
():
add_and_remove
=
dirUi
not
in
sys
.
path
if
add_and_remove
:
sys
.
path
.
append
(
dirUi
)
#replace for <customwidget> with <class>Qgs...</class>
# <header>qgscolorbutton.h</header>
# by <header>qgis.gui</header>
if
True
:
pathTmp
=
jp
(
os
.
path
.
dirname
(
pathUi
),
'
tmp.ui
'
)
doc
=
QDomDocument
()
doc
.
setContent
(
QFile
(
pathUi
))
elem
=
doc
.
elementsByTagName
(
'
customwidget
'
)
overwrite
=
False
for
child
in
[
elem
.
item
(
i
)
for
i
in
range
(
elem
.
count
())]:
child
=
child
.
toElement
()
className
=
str
(
child
.
firstChildElement
(
'
class
'
).
firstChild
().
nodeValue
())
if
className
.
startswith
(
'
Qgs
'
):
cHeader
=
child
.
firstChildElement
(
'
header
'
).
firstChild
()
cHeader
.
setNodeValue
(
'
qgis.gui
'
)
overwrite
=
True
if
overwrite
:
s
=
str
(
doc
.
toString
())
file
=
open
(
pathTmp
,
'
w
'
)
file
.
write
(
s
)
file
.
close
()
os
.
remove
(
pathTmp
)
pathUi
=
pathTmp
dprint
(
'
Load UI file: {}
'
.
format
(
pathUi
))
formClass
,
_
=
uic
.
loadUiType
(
pathUi
,
from_imports
=
from_imports
,
resource_suffix
=
RC_SUFFIX
)
if
add_and_remove
:
sys
.
path
.
remove
(
dirUi
)
FORM_CLASSES
[
pathUi
]
=
formClass
return
FORM_CLASSES
[
pathUi
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment