Permalink
Browse files

replaced optparse with argparse in install_sage_scripts

  • Loading branch information...
1 parent ffb8ce1 commit 2c3a6dd956e9abab1decdca0a3ae11d18e00b966 @sn6uv sn6uv committed Sep 7, 2012
Showing with 5 additions and 5 deletions.
  1. +5 −5 install_sage_scripts.py
View
@@ -6,18 +6,18 @@
import os
from os import path
-from optparse import OptionParser
+from argparse import ArgumentParser
from mathics import settings
def setup():
- parser = OptionParser(description="Sets up scripts to run mathics and mathicsserver when installed into Sage.")
- parser.add_option("-d", "--directory", dest="dir", metavar="DIR", default='/usr/local/bin',
+ parser = ArgumentParser(description="Sets up scripts to run mathics and mathicsserver when installed into Sage.")
+ parser.add_argument("-d", "--directory", dest="dir", metavar="DIR", default='/usr/local/bin',
help="install scripts into directory DIR")
- options, args = parser.parse_args()
+ args = parser.parse_args()
for cmd in ['mathics', 'mathicsserver']:
- filename = path.join(options.dir, cmd)
+ filename = path.join(args.dir, cmd)
with open(filename, 'w') as file:
file.write("""#!/usr/bin/env bash
sage -python -c "__requires__ = 'Mathics==%(version)s'; import sys; from pkg_resources import load_entry_point; sys.exit(load_entry_point('Mathics==%(version)s', 'console_scripts', '%(cmd)s')())" "$@"

0 comments on commit 2c3a6dd

Please sign in to comment.