Corrected bug with looking for excitation file in same directory as input file.

这个提交包含在:
Craig Warren
2016-02-22 10:49:10 +00:00
父节点 81a927b2d9
当前提交 09154edcbf
共有 2 个文件被更改,包括 6 次插入2 次删除

查看文件

@@ -666,7 +666,7 @@ If there are less amplitude values than the number of iterations that are going
#excitation_file: file1
``str1`` is the name of the ASCII file containing the specified waveform. It should be located in the same directory as the input file.
``str1`` is the name (and optionally full path) of the ASCII file containing the specified waveform. ``str1`` will first be tested as the full path to the file, and if it does not exist it will look for ``str1`` in the same directory as the input file.
For example, to specify the file ``my_waves.txt``, which contains two custom waveform shapes, use: ``#excitation_file: my_waves.txt``. The contents of the file ``my_waves.txt`` would take the form:

查看文件

@@ -221,7 +221,11 @@ def process_singlecmds(singlecmds, multicmds, G):
raise CmdInputError(cmd + ' requires exactly one parameter')
excitationfile = tmp[0]
# Open file and get waveform names
# See if file exists at specified path and if not try input file directory
if not os.path.isfile(excitationfile):
excitationfile = os.path.join(G.inputdirectory, excitationfile)
# Get waveform names
with open(excitationfile, 'r') as f:
waveformIDs = f.readline().split()