Skip to content

Commit

Permalink
madupload now requires a filename
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Smith committed Feb 4, 2015
1 parent 3c0bd88 commit 77d9ddf
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions misc/madupload.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,19 +34,27 @@


upload_url = 'http://www.davek.com.au/td/uploaddata.asp'
upfile = "updated.prices"
if len(sys.argv) > 1:
upfile = sys.argv[1]

if len(sys.argv) != 2:
raise SystemExit(
"Usage: {} <filename>\n"
"Uploads 'filename' to Maddavo's site, where filename should be "
"a .prices or Station.csv file.\n"
"\n"
"NOTE to OCR USERS:\n"
"Please upload the .prices file from your OCR DIRECTLY before "
"importing it into TD, not after... We look fo rward to receiving "
"y0uh fxcitirg nevv oata :).\n" . format(
sys.argv[0]
))

upfile = sys.argv[1]

############################################################################


if not pathlib.Path(upfile).is_file():
raise SystemExit("ERROR: File not found: {}".format(upfile))

files = {
}
r = requests.post(
upload_url,
files={
Expand Down

0 comments on commit 77d9ddf

Please sign in to comment.