]> code.delx.au - dotfiles/blobdiff - .pythonrc.py
gitconfig: added expire-prune
[dotfiles] / .pythonrc.py
index 6ffe0b2a1bc54a0fd57eb1a02fed22f551b4fa41..28b66f3e27c55d8ee23ec1a40defb9b06481ca9c 100644 (file)
@@ -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):
-       if text.strip() == "":
-               if state == 0:
-                       return text + "\t"
-               else:
-                       return None
-       else:
-               return defaultCompleter.complete(text, state)
+def my_completer(text, state):
+    if text.strip() == "":
+        if state == 0:
+            return text + "\t"
+        else:
+            return None
+    else:
+        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)