--- shell.py.orig 2008-07-16 23:10:37.000000000 +0200 +++ shell.py 2008-07-16 23:14:47.000000000 +0200 @@ -6,6 +6,7 @@ """ import cmd +import os from twill import commands, parse, __version__ import namespaces @@ -84,6 +85,9 @@ def get_command_shell(): return getattr(TwillCommandLoop, '__it__', None) +def history_file_name(): + return os.path.join(os.path.expanduser("~"), ".twill-history") + class TwillCommandLoop(Singleton, cmd.Cmd): """ Command-line interpreter for twill commands. Singleton object: you @@ -105,7 +109,7 @@ # import readline history, if available. if readline: try: - readline.read_history_file('.twill-history') + readline.read_history_file(history_file_name()) except IOError: pass @@ -237,7 +241,7 @@ def do_EOF(self, *args): "Exit on CTRL-D" if readline: - readline.write_history_file('.twill-history') + readline.write_history_file(history_file_name()) raise SystemExit()