Skip to content

Commit

Permalink
Modify to allow testing in IDLE
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbydurrett committed Jul 21, 2017
1 parent 9409a3f commit b14ca5e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
9 changes: 9 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,15 @@ Database name:user name:password
The output directory is where image files are written if you choose
"file" as the destination for the graph.

You can test these scripts interactively through IDLE by setting the arguments
at the top of the script. So, if you want to test ashonewait.py put these lines
at the top of the file:

import sys
sys.argv = ['x','screen','YOURDB','N','N']

Once you are done testing remove these lines and run the script from the command line.

Related blog posts:

http://www.bobbydurrettdba.com/?s=Python
Expand Down
8 changes: 7 additions & 1 deletion util.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import myplot
import db
import argparse
import locale

"""
Expand Down Expand Up @@ -191,9 +192,14 @@ def script_startup(script_description):

user=util.my_oracle_user
password=util.get_oracle_password(database)

# Set locale so we can test in IDLE

locale.setlocale(locale.LC_ALL, 'C')

return database,db.connection(user,password,database)

def exit_no_results(results):
if results == None:
print("No results returned")
sys.exit()
sys.exit()

0 comments on commit b14ca5e

Please sign in to comment.