Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Yori Fournier
myplotlib
Commits
1cc0812f
Commit
1cc0812f
authored
Feb 03, 2017
by
Yori 'AGy' Fournier
Browse files
user can specify input and output path
parent
05c0eb08
Changes
1
Hide whitespace changes
Inline
Side-by-side
design/myDesignTool.py
View file @
1cc0812f
...
...
@@ -6,8 +6,11 @@ from .. import WARN, INFO
def
getSectionFromDesign
(
designFile
):
f
=
open
(
_D_PATH2_MYDESIGNS
+
str
(
designFile
))
if
'/'
in
str
(
designFile
):
f
=
open
(
str
(
designFile
))
else
:
f
=
open
(
_D_PATH2_MYDESIGNS
+
str
(
designFile
))
designSections
=
{}
...
...
@@ -85,7 +88,7 @@ def getSectionFromDesign(designFile):
return
(
designSections
)
def
savePlot
(
filename
):
def
savePlot
(
filename
,
path2myfigures
=
_D_PATH2_MYFIGURES
,
path2myaxes
=
_D_PATH2_MYAXES
):
designSections
=
getSectionFromDesign
(
filename
)
figureClassName
=
None
...
...
@@ -106,20 +109,17 @@ def savePlot(filename):
else
:
addAxesString
=
''
if
figureClassName
is
None
or
addAxesString
==
''
or
declareKeywordsString
==
''
:
print
(
"ERROROROROR!!!!!"
)
print
(
figureClassName
)
print
(
addAxesString
)
print
(
declareKeywordsString
)
if
figureClassName
is
None
or
addAxesString
==
''
:
print
(
WARN
+
"Either the clasName could not be found, either there is no axes..."
)
# PUT THEM INTO THE STRUCTURE
template
=
_CLASS_TEMPLATE
.
format
(
className
=
figureClassName
,
declareKeywords
=
declareKeywordsString
,
addAxes
=
addAxesString
)
# CREATE THE FIGURE FILE
f
=
open
(
_D_PATH2_MYFIGURES
+
str
(
figureClassName
)[
0
].
lower
()
+
str
(
figureClassName
)[
1
:]
+
'.py'
,
'w'
)
f
=
open
(
str
(
path2myfigures
)
+
str
(
figureClassName
)[
0
].
lower
()
+
str
(
figureClassName
)[
1
:]
+
'.py'
,
'w'
)
# WRITE THE FIGURE
f
.
writelines
(
template
)
...
...
@@ -140,7 +140,7 @@ def savePlot(filename):
plottingString
=
'
\t
'
.
join
(
designSections
[
axes
][
'plotting'
])
# OPEN THE FILE
f
=
open
(
_D_PATH2_MYAXES
+
str
(
axesClassName
)[
0
].
lower
()
+
str
(
axesClassName
)[
1
:]
+
'.py'
,
'w'
)
f
=
open
(
path2myaxes
+
str
(
axesClassName
)[
0
].
lower
()
+
str
(
axesClassName
)[
1
:]
+
'.py'
,
'w'
)
template
=
_AXES_TEMPLATE
.
format
(
axesName
=
axesClassName
,
formatRawData
=
formatRawDataString
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment