Commit 1cc0812f authored by Yori 'AGy' Fournier's avatar Yori 'AGy' Fournier
Browse files

user can specify input and output path

parent 05c0eb08
......@@ -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,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment