4grab/util.py

14 lines
318 B
Python
Raw Normal View History

import os
import sys
homedir = os.getenv("HOME")
if homedir is None:
homedir = os.path.dirname(sys.argv[0])
confdir = os.path.join(homedir, ".4grab")
def raw_input_with_default(default, prompt):
inp = raw_input("%s (default=%s): " % (prompt, default))
if inp == "":
return default
return inp