diff options
author | Eduardo Silva <edsiper@gmail.com> | 2007-12-07 01:38:46 (GMT) |
---|---|---|
committer | Eduardo Silva <edsiper@gmail.com> | 2007-12-07 01:38:46 (GMT) |
commit | 05bc15a46b5ef8174a2516b740cc88476e8edc74 (patch) | |
tree | b1d3c083bbadd3b07a704854fc581641b447bdb0 | |
parent | 15259257e3558b6da605e818796e32538caeab25 (diff) |
No more configuraton files
-rw-r--r-- | purk/conf.py | 28 | ||||
-rw-r--r-- | purk/ui.py | 14 |
2 files changed, 3 insertions, 39 deletions
diff --git a/purk/conf.py b/purk/conf.py index 9cae512..9730d04 100644 --- a/purk/conf.py +++ b/purk/conf.py @@ -7,22 +7,6 @@ def path(filename=""): else: return urkpath -if os.access(path('profile'),os.F_OK) or os.path.expanduser("~") == "~": - userpath = path('profile') - if not os.access(userpath,os.F_OK): - os.mkdir(userpath) - if not os.access(os.path.join(userpath,'scripts'),os.F_OK): - os.mkdir(os.path.join(userpath,'scripts')) -else: - userpath = os.path.join(os.path.expanduser("~"), ".urk") - if not os.access(userpath,os.F_OK): - os.mkdir(userpath, 0700) - if not os.access(os.path.join(userpath,'scripts'),os.F_OK): - os.mkdir(os.path.join(userpath,'scripts'), 0700) - -CONF_FILE = os.path.join(userpath,'urk.conf') - - def pprint(obj, depth=-2): depth += 2 @@ -56,7 +40,7 @@ def pprint(obj, depth=-2): else: string.append('%s,\n' % (repr(obj),)) - + if depth: return string else: @@ -74,13 +58,7 @@ def save(*args): #events.register('Exit', 'post', save) -try: - conf = eval(file(CONF_FILE, "U").read().strip()) -except IOError, e: - if e.args[0] == 2: - conf = {} - else: - raise - +conf = {} + if __name__ == '__main__': print pprint(conf) @@ -36,20 +36,6 @@ PRIORITY_DEFAULT_IDLE = gobject.PRIORITY_DEFAULT_IDLE PRIORITY_LOW = gobject.PRIORITY_LOW -if os.access(path('profile'),os.F_OK) or os.path.expanduser("~") == "~": - userpath = path('profile') - if not os.access(userpath,os.F_OK): - os.mkdir(userpath) - if not os.access(os.path.join(userpath,'scripts'),os.F_OK): - os.mkdir(os.path.join(userpath,'scripts')) -else: - userpath = os.path.join(os.path.expanduser("~"), ".urk") - if not os.access(userpath,os.F_OK): - os.mkdir(userpath, 0700) - if not os.access(os.path.join(userpath,'scripts'),os.F_OK): - os.mkdir(os.path.join(userpath,'scripts'), 0700) - - def set_clipboard(text): gtk.clipboard_get(gtk.gdk.SELECTION_CLIPBOARD).set_text(text) gtk.clipboard_get(gtk.gdk.SELECTION_PRIMARY).set_text(text) |