Skip to content

Commit

Permalink
Revert to 'os._exit(0)' call. Keep eyes open for issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
kadrlica committed Nov 25, 2015
1 parent 83a9847 commit bbb15f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ The query format is the same as the interpreter, SQL statement must end with ";"

### Configuration

The configuration file is located at $HOME/.easyaccess/config.ini but everything can be configured from inside easyaccess type:
The configuration file is located at ```$HOME/.easyaccess/config.ini``` but everything can be configured from inside easyaccess type:

DESDB ~> help config
Expand All @@ -92,11 +92,12 @@ and to see any particular option (e.g., timeout):

## Command-line usage

Much of the functionality provided through the interpreter is also available directly from the command line. To see a list of command-line options, use the "--help" option
Much of the functionality provided through the interpreter is also available directly from the command line. To see a list of command-line options, use the ```--help``` option

easyaccess --help

## TODO
- There is a bug with some versions of readline
- Other small changes when loading tables
- Self-upgrade
- Refactor the code so that it isn't in one huge file
10 changes: 5 additions & 5 deletions easyaccess.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def colored(line, color):

# check if old path is there
ea_path_old = os.path.join(os.environ["HOME"], ".easyacess/")
if os.path.exists(ea_path_old):
if os.path.exists(ea_path_old) and os.path.isdir(ea_path_old):
if not os.path.exists(history_file):
shutil.copy2(os.path.join(os.environ["HOME"], ".easyacess/history"), history_file)
if not os.path.exists(config_file):
Expand Down Expand Up @@ -2313,25 +2313,25 @@ def colored(line, color):
initial_message(args.quiet, clear=False)
cmdinterp = easy_or(conf, desconf, db, interactive=False, quiet=args.quiet)
cmdinterp.onecmd(args.command)
sys.exit(0) #os._exit(0)
os._exit(0)
elif args.loadsql is not None:
initial_message(args.quiet, clear=False)
cmdinterp = easy_or(conf, desconf, db, interactive=False, quiet=args.quiet)
linein = "loadsql " + args.loadsql
cmdinterp.onecmd(linein)
sys.exit(0) #os._exit(0)
os._exit(0)
elif args.loadtable is not None:
initial_message(args.quiet, clear=False)
cmdinterp = easy_or(conf, desconf, db, interactive=False, quiet=args.quiet)
linein = "load_table " + args.loadtable
cmdinterp.onecmd(linein)
sys.exit(0) #os._exit(0)
os._exit(0)
elif args.appendtable is not None:
initial_message(args.quiet, clear=False)
cmdinterp = easy_or(conf, desconf, db, interactive=False, quiet=args.quiet)
linein = "append_table " + args.appendtable
cmdinterp.onecmd(linein)
sys.exit(0) #os._exit(0)
os._exit(0)
else:
initial_message(args.quiet, clear=True)
easy_or(conf, desconf, db, quiet=args.quiet).cmdloop()

0 comments on commit bbb15f0

Please sign in to comment.