ocarina/libsaria/path.py

20 lines
299 B
Python

# Bryan Schumaker (8/7/2010)
import os
exists = os.path.exists
expand = os.path.expanduser
join = os.path.join
mkdir = os.mkdir
rm = os.remove
dir = None
def sariadir():
global dir
if dir == None:
dir = join(expand("~"), ".saria")
if exists(dir) == False:
mkdir(dir)
return dir