X-Git-Url: https://code.delx.au/dotfiles/blobdiff_plain/fc6814be8f52c34705d000045a4527a67551f1de..ba50c87297ef6372551e0b3d1db1b9a6cc480209:/.pythonrc.py diff --git a/.pythonrc.py b/.pythonrc.py index 5d8a274..28b66f3 100644 --- a/.pythonrc.py +++ b/.pythonrc.py @@ -33,28 +33,28 @@ except ImportError: # Readline completion of everything :) import rlcompleter, readline, atexit -defaultCompleter = rlcompleter.Completer() +default_completer = rlcompleter.Completer() -historyPath = os.path.expanduser("~/.pyhistory") +history_path = os.path.expanduser("~/.python_history") -def myCompleter(text, state): +def my_completer(text, state): if text.strip() == "": if state == 0: return text + "\t" else: return None else: - return defaultCompleter.complete(text, state) + return default_completer.complete(text, state) -def save_history(historyPath=historyPath): +def save_history(history_path=history_path): import readline - readline.write_history_file(historyPath) + readline.write_history_file(history_path) -readline.set_completer(myCompleter) +readline.set_completer(my_completer) readline.parse_and_bind("tab: complete") -if os.path.exists(historyPath): - readline.read_history_file(historyPath) +if os.path.exists(history_path): + readline.read_history_file(history_path) atexit.register(save_history)