Skip to content

Commit

Permalink
fix regression discovered via rake test which hopefully worked on
Browse files Browse the repository at this point in the history
openbsd.
  • Loading branch information
benoitc committed May 27, 2009
1 parent 287119c commit 8fa7187
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 4 additions & 2 deletions python/couchapp/app.py
Expand Up @@ -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
Expand Down Expand Up @@ -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)

Expand Down Expand Up @@ -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)
doc['couchapp']['signatures'].update(_signatures)
4 changes: 2 additions & 2 deletions python/couchapp/ui.py
Expand Up @@ -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)
Expand Down Expand Up @@ -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
return False
4 changes: 2 additions & 2 deletions python/couchapp/utils.py
Expand Up @@ -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:
Expand All @@ -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():
Expand Down

0 comments on commit 8fa7187

Please sign in to comment.