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
1d3f925a
Commit
1d3f925a
authored
8 years ago
by
benjamin.jakimow@geo.hu-berlin.de
Browse files
Options
Downloads
Patches
Plain Diff
added DEBUG
added logging removed "findAbsolutePath"
parent
ae4143d9
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
timeseriesviewer/__init__.py
+25
-18
25 additions, 18 deletions
timeseriesviewer/__init__.py
timeseriesviewer/ui/__init__.py
+3
-2
3 additions, 2 deletions
timeseriesviewer/ui/__init__.py
with
28 additions
and
20 deletions
timeseriesviewer/__init__.py
+
25
−
18
View file @
1d3f925a
import
os
,
sys
,
fnmatch
,
site
import
os
,
sys
,
fnmatch
,
site
import
six
import
six
,
logging
logger
=
logging
.
getLogger
(
__name__
)
from
PyQt4.QtCore
import
QSettings
from
PyQt4.QtCore
import
QSettings
from
PyQt4.QtGui
import
QIcon
from
PyQt4.QtGui
import
QIcon
DEBUG
=
True
if
DEBUG
:
#initiate loggers for all pyfiles
import
pkgutil
DIR
=
os
.
path
.
dirname
(
__file__
)
for
m
,
name
,
ispkg
in
pkgutil
.
walk_packages
(
path
=
DIR
,
prefix
=
'
timeseriesviewer
'
):
logger
=
logging
.
getLogger
(
name
)
logger
.
setLevel
(
logging
.
DEBUG
)
fh
=
logging
.
StreamHandler
()
fh_formatter
=
logging
.
Formatter
(
'
%(levelname)s %(lineno)d:%(filename)s%(module)s %(funcName)s
\n\t
%(message)s
'
)
fh
.
setFormatter
(
fh_formatter
)
fh
.
addFilter
(
logging
.
Filter
(
name
))
logger
.
addHandler
(
fh
)
jp
=
os
.
path
.
join
jp
=
os
.
path
.
join
dn
=
os
.
path
.
dirname
dn
=
os
.
path
.
dirname
mkdir
=
lambda
p
:
os
.
makedirs
(
p
,
exist_ok
=
True
)
mkdir
=
lambda
p
:
os
.
makedirs
(
p
,
exist_ok
=
True
)
...
@@ -35,11 +53,6 @@ def icon():
...
@@ -35,11 +53,6 @@ def icon():
return
QIcon
(
'
:/timeseriesviewer/icons/icon.png
'
)
return
QIcon
(
'
:/timeseriesviewer/icons/icon.png
'
)
def
dprint
(
text
,
file
=
None
):
if
DEBUG
:
six
.
_print
(
'
DEBUG::{}
'
.
format
(
text
),
file
=
file
)
def
file_search
(
rootdir
,
wildcard
,
recursive
=
False
,
ignoreCase
=
False
):
def
file_search
(
rootdir
,
wildcard
,
recursive
=
False
,
ignoreCase
=
False
):
assert
rootdir
is
not
None
assert
rootdir
is
not
None
if
not
os
.
path
.
isdir
(
rootdir
):
if
not
os
.
path
.
isdir
(
rootdir
):
...
@@ -58,20 +71,14 @@ def file_search(rootdir, wildcard, recursive=False, ignoreCase=False):
...
@@ -58,20 +71,14 @@ def file_search(rootdir, wildcard, recursive=False, ignoreCase=False):
return
results
return
results
def
findAbsolutePath
(
file
):
filepath
,
attr
=
getFileAndAttributes
(
file
)
if
os
.
path
.
exists
(
filepath
):
return
file
possibleRoots
=
[
DIR_EXAMPLES
,
DIR_REPO
,
os
.
getcwd
()]
for
root
in
possibleRoots
:
tmp
=
jp
(
root
,
filepath
)
if
os
.
path
.
exists
(
tmp
):
return
tmp
+
attr
return
None
def
getFileAndAttributes
(
file
):
def
getFileAndAttributes
(
file
):
"""
splits a GDAL valid file path into
:param file:
:return:
"""
dn
=
os
.
path
.
dirname
(
file
)
dn
=
os
.
path
.
dirname
(
file
)
bn
=
os
.
path
.
basename
(
file
)
bn
=
os
.
path
.
basename
(
file
)
bnSplit
=
bn
.
split
(
'
:
'
)
bnSplit
=
bn
.
split
(
'
:
'
)
return
os
.
path
.
join
(
dn
,
bn
),
'
:
'
.
join
(
bnSplit
[
1
:])
return
os
.
path
.
join
(
dn
,
bnSplit
[
0
]),
'
:
'
.
join
(
bnSplit
[
1
:])
\ No newline at end of file
\ No newline at end of file
This diff is collapsed.
Click to expand it.
timeseriesviewer/ui/__init__.py
+
3
−
2
View file @
1d3f925a
import
os
,
sys
,
six
,
importlib
import
os
,
sys
,
six
,
importlib
,
logging
logger
=
logging
.
getLogger
(
__name__
)
from
PyQt4.QtCore
import
*
from
PyQt4.QtCore
import
*
from
PyQt4.QtXml
import
*
from
PyQt4.QtXml
import
*
from
PyQt4.QtGui
import
*
from
PyQt4.QtGui
import
*
...
@@ -8,7 +9,7 @@ from PyQt4 import uic
...
@@ -8,7 +9,7 @@ from PyQt4 import uic
#dictionary to store form classes. *.ui file name is key
#dictionary to store form classes. *.ui file name is key
FORM_CLASSES
=
dict
()
FORM_CLASSES
=
dict
()
from
timeseriesviewer
import
jp
,
DIR_UI
,
dprint
from
timeseriesviewer
import
jp
,
DIR_UI
def
loadUIFormClass
(
pathUi
,
from_imports
=
False
):
def
loadUIFormClass
(
pathUi
,
from_imports
=
False
):
...
...
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