diff --git a/python/couchapp/app.py b/python/couchapp/app.py index 829bf4ec..c3065133 100755 --- a/python/couchapp/app.py +++ b/python/couchapp/app.py @@ -72,7 +72,7 @@ def initialize(self, default_conf=None, verbose=False): else: message = "CouchApp already initialized in %s." % app_dir return error(message, verbose) - return ok() + return is_ok() def generate(self, verbose=False): """ Generates a CouchApp in app_dir @@ -122,6 +122,8 @@ def clone(self, design_doc, verbose=None): app_name = get_appname(design_doc['_id']) + self.app_dir = os.path.join(self.app_dir, app_name) + if not os.path.isdir(self.app_dir): os.makedirs(self.app_dir) @@ -462,4 +464,4 @@ def attachments(self, doc, attach_dir, docid, verbose=False, vendor=None): doc['couchapp']['signatures'] = {} doc['_attachments'].update(_attachments) - doc['couchapp']['signatures'].update(_signatures) \ No newline at end of file + doc['couchapp']['signatures'].update(_signatures) diff --git a/python/couchapp/ui.py b/python/couchapp/ui.py index 5bce41f3..cc27f137 100644 --- a/python/couchapp/ui.py +++ b/python/couchapp/ui.py @@ -70,7 +70,7 @@ class ui(object): def __init__(self, app_dir): self.app_dir = app_dir - self.app = Couchapp(app_dir=app_dir) + self.app = Couchapp(app_dir=self.app_dir) # load conf self.conf = get_config(app_dir) @@ -298,4 +298,4 @@ def make_index_url(self, uri, app_name, attach_dir, index): if os.path.isfile(index_fpath): return "%s/%s/%s/%s" % (uri, '_design', app_name, 'index.html') else: - return False \ No newline at end of file + return False diff --git a/python/couchapp/utils.py b/python/couchapp/utils.py index fd32f031..79fc1d50 100755 --- a/python/couchapp/utils.py +++ b/python/couchapp/utils.py @@ -21,7 +21,7 @@ __all__ = ['_md5', '_popen3', 'in_couchapp', 'parse_uri', 'parse_auth', 'get_appname', 'to_bytestring', 'read_file', 'sign_file', - 'write_content', 'write_json', 'read_json', 'ok', 'error'] + 'write_content', 'write_json', 'read_json', 'is_ok', 'error'] # compatibility with python 2.4 try: @@ -47,7 +47,7 @@ def error(message, verbose=False): print >>sys.stderr, message return { 'ok': False, 'error': message } -def ok(): +def is_ok(): return { 'ok': True } def in_couchapp():