summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-12-13 19:44:45 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-12-13 19:44:45 -0500
commit1bb94f6ca633f16d95866560799f191507036822 (patch)
tree583f78dd068420e99dbe24f4581d3ac150a66468
parent8e82e1cd922db2eb3f6c2b2e8d9b5106f482bf59 (diff)
`combox.gui.ComboxConfigDialog` accepts config_dir
-rw-r--r--ChangeLog7
-rw-r--r--combox/gui.py11
2 files changed, 16 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 44aac0e..9ddaaf6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-12-13 Siddharth Ravikumar <sravik@bgsu.edu>
+ * combox/gui.py (ComboxConfigDialog.__init__): accepts a new
+ argument called `condig_dir` that allows one to specify the combox
+ configuration directory
+ (ComboxConfigDialog.apply): passes the configuration directory
+ that it accepts in the `__init__` to the `config_cb` function.
+
2015-12-10 Siddharth Ravikumar <sravik@bgsu.edu>
* combox/gui.py (ComboxConfigDialog.apply): now writes the
diff --git a/combox/gui.py b/combox/gui.py
index a6630d9..2195ecb 100644
--- a/combox/gui.py
+++ b/combox/gui.py
@@ -21,6 +21,9 @@ import os
import tkFileDialog
+from os import path
+from os.path import expanduser
+
from Tkinter import *
from combox.config import config_cb
@@ -34,12 +37,15 @@ class ComboxConfigDialog(object):
"""
- def __init__(self, title=None):
+ def __init__(self, title=None,
+ config_dir=path.join(expanduser("~"), '.combox')):
self.root = Tk()
if title:
self.root.title(title)
+ self.config_dir = config_dir
+
self.result = None
self.body_frame = Frame(self.root)
@@ -292,7 +298,8 @@ class ComboxConfigDialog(object):
def_input = lambda(x): next(config_info_iter)
def_pass = lambda: passp
- config_cb(pass_func=def_pass, input_func=def_input)
+ config_cb(config_dir=self.config_dir,
+ pass_func=def_pass, input_func=def_input)
def create_askdirectory_button(self, entry, row):