Commit ce4fbb4f authored by Klaatu's avatar Klaatu

incremental unnamed dirs failed after 9, fixed

parent fad930b4
......@@ -11,9 +11,9 @@ launch_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
# Update sys.path to include modules
d = 'planterlibs'
if d in os.listdir(launch_dir):
if d in os.listdir(launch_dir + '/usr/share/pyshared/'):
print("Running uninstalled...")
modules_path = launch_dir + "/planterlibs"
modules_path = launch_dir + "/usr/share/pyshared/planterlibs"
sys.path.insert(0, modules_path)
else:
print("Running from installation...")
......
......@@ -44,18 +44,17 @@ def getOptions():
try:
from PyQt4.QtGui import QApplication
except:
opts['gui'] = 0
opts['gui'] = 2
elif not opts.has_key('gui'):
opts['gui'] = 0
else:
import shell
shell.execute(opts)
if opts['gui'] == 0:
print('no GUI available, running in the shell.')
if ( opts['gui'] == 0) or (opts['gui'] == 2) :
import shell
shell.execute(opts)
else:
import gui
gui.execute(opts)
......@@ -17,7 +17,10 @@ def execute(opts):
try:
curlist = os.listdir(opts['location'])
matching = [s for s in curlist if opts['echo'] + "_" in s]
n = int(sorted(matching)[-1].split("_")[1]) +1
sortlist = []
for item in matching:
sortlist.append(int(item.split("_")[1]))
n = max(sortlist) +1
ARG = ARG + '_' + str(n)
except:
n = n + 1
......
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