Commit eac1aa5f821cf94e1d89863df523c2378220fdb9

Authored by Paulo Henrique Junqueira Amorim
1 parent 110416af
Exists in master

Fixed problem on open project with .inv3

Showing 1 changed file with 23 additions and 5 deletions   Show diff stats
app.py
... ... @@ -345,12 +345,30 @@ def use_cmd_optargs(options, args):
345 345 # In case there is, try opening as it was a inv3
346 346 else:
347 347 for arg in reversed(args):
348   - if os.path.isfile(arg):
349   - path_ = os.path.abspath(arg.decode(sys.stdin.encoding))
350   - Publisher.sendMessage('Open project', path_)
351 348  
352   - check_for_export(options)
353   - return True
  349 + try:
  350 + file = arg
  351 + if os.path.isfile(file):
  352 + path = os.path.abspath(file)
  353 + Publisher.sendMessage('Open project', path)
  354 + check_for_export(options)
  355 + return True
  356 + except:
  357 +
  358 + file = arg.decode(sys.stdin.encoding)
  359 + if os.path.isfile(file):
  360 + path = os.path.abspath(file)
  361 + Publisher.sendMessage('Open project', path)
  362 + check_for_export(options)
  363 + return True
  364 +
  365 + file = arg.decode(FS_ENCODE)
  366 + if os.path.isfile(file):
  367 + path = os.path.abspath(file)
  368 + Publisher.sendMessage('Open project', path)
  369 + check_for_export(options)
  370 + return True
  371 +
354 372 return False
355 373  
356 374  
... ...