Permalink
Browse files

Change opts to args, and passwd to passwd_path.

  • Loading branch information...
1 parent ec63bee commit 36301bf12d7e0a7f09ab95088e0eef538b9a6752 @dripton committed Aug 25, 2012
Showing with 13 additions and 13 deletions.
  1. +5 −5 slugathon/ai/AIClient.py
  2. +8 −8 slugathon/net/Server.py
View
@@ -681,11 +681,11 @@ def add_arguments(parser):
def main():
parser = argparse.ArgumentParser()
add_arguments(parser)
- opts, extras = parser.parse_known_args()
- aiclient = AIClient(opts.playername, opts.password, opts.server, opts.port,
- opts.delay, opts.game_name, opts.log_path, opts.ai_time_limit,
- opts.player_time_limit, opts.form_game, opts.min_players,
- opts.max_players)
+ args, extras = parser.parse_known_args()
+ aiclient = AIClient(args.playername, args.password, args.server, args.port,
+ args.delay, args.game_name, args.log_path, args.ai_time_limit,
+ args.player_time_limit, args.form_game, args.min_players,
+ args.max_players)
reactor.callWhenRunning(aiclient.connect)
reactor.run()
View
@@ -832,25 +832,25 @@ def processEnded(self, status):
def add_arguments(parser):
parser.add_argument("-p", "--port", action="store", type=int,
default=config.DEFAULT_PORT, help="listening TCP port")
- parser.add_argument("--passwd", "-a", action="store", type=str,
+ parser.add_argument("--passwd-path", action="store", type=str,
default=prefs.passwd_path(), help="path to passwd file")
- parser.add_argument("--no-passwd", "-n", action="store_true",
+ parser.add_argument("-n", "--no-passwd", action="store_true",
help="do not check passwords")
- parser.add_argument("--log-path", "-l", action="store", type=str,
+ parser.add_argument("-l", "--log-path", action="store", type=str,
help="path to logfile")
def main():
parser = argparse.ArgumentParser()
add_arguments(parser)
- opts, extras = parser.parse_known_args()
- port = opts.port
- server = Server(opts.no_passwd, opts.passwd, opts.port, opts.log_path)
+ args, extras = parser.parse_known_args()
+ port = args.port
+ server = Server(args.no_passwd, args.passwd_path, args.port, args.log_path)
realm = Realm.Realm(server)
- if opts.no_passwd:
+ if args.no_passwd:
checker = UniqueNoPassword(None, server=server)
else:
- checker = UniqueFilePasswordDB(opts.passwd, server=server)
+ checker = UniqueFilePasswordDB(args.passwd_path, server=server)
portal = Portal(realm, [checker])
pbfact = pb.PBServerFactory(portal, unsafeTracebacks=True)
reactor.listenTCP(port, pbfact)

0 comments on commit 36301bf

Please sign in to comment.