diff --git a/www/html/app.py b/www/html/app.py index b2339b5..9d2ff46 100644 --- a/www/html/app.py +++ b/www/html/app.py @@ -310,15 +310,21 @@ def strips(req, cid=None, extent=None): # split up campaign ID [ptype,pname,cdate,cname] = util.parse_cid(cid) - # get shell commands and execute + # get shell commands cmds = util.get_lascopy_cmds(cid,extent) - req.write('
Shell-Befehle:\n\n') - for args in cmds: - req.write('%s\n' % ' '.join(args) ) - proc = Popen(args, stdout=PIPE, stderr=PIPE) - stdout, stderr = proc.communicate() - req.write('') + + if type(cmds) == str: + # show errors + req.write('ERROR: %s' % cmds) + else: + # execute commands and give feedback + req.write('
Shell-Befehle:\n\n') + for args in cmds: + req.write('%s\n' % ' '.join(args) ) + proc = Popen(args, stdout=PIPE, stderr=PIPE) + stdout, stderr = proc.communicate() + req.write('') # finish dbh.close() diff --git a/www/lib/Laser/Util/web.py b/www/lib/Laser/Util/web.py index aaea83a..02a7a32 100644 --- a/www/lib/Laser/Util/web.py +++ b/www/lib/Laser/Util/web.py @@ -89,7 +89,10 @@ def get_lascopy_cmds(self, cid=None, ext=None): ) cmds.append(['ln','-s',ipath,opath]) - return cmds + if len(cmds) == 0: + return "no lasfiles found that intersect the extent" + else: + return cmds def get_las2las_cmd(self, cid=None, ext=None): """ transform extent in latlng to extent of campaign, create list with lasfiles to process and return las commandline args """ @@ -121,8 +124,6 @@ def get_las2las_cmd(self, cid=None, ext=None): ptype,pname,cdate,cname ) ) - if self.base.dbh.rowcount() == 0: - return 'no lasfiles found' # loop through results and fill las2las args for row in self.base.dbh.fetchall():