Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions couchdbkit/designer/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def _compare_with_current_version(self, db, doc):
def attachment_stub(self, name, filepath):
att = {}
with open(filepath, "rb") as f:
re_sp = re.compile('\s')
re_sp = re.compile(r'\s')
att = {
"data": re_sp.sub('',base64.b64encode(f.read())),
"content_type": ';'.join(filter(None,
Expand Down Expand Up @@ -258,9 +258,10 @@ def check_ignore(self, item):
return False

def dir_to_fields(self, current_dir='', depth=0,
manifest=[]):
manifest=None):
""" process a directory and get all members """

if manifest is None:
manifest = []
fields={}
if not current_dir:
current_dir = self.docdir
Expand Down
4 changes: 2 additions & 2 deletions couchdbkit/designer/macros.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ def rreq(mo):
"Processing code: No file matching '%s'" % mo.group(2))
return library

re_code = re.compile('(\/\/|#)\ ?!code (.*)')
re_code = re.compile(r'(//|#) ?!code (.*)')
return re_code.sub(rreq, f_string)

def run_json_macros(doc, f_string, app_dir):
Expand Down Expand Up @@ -150,7 +150,7 @@ def rjson(mo):
def rjson2(mo):
return '\n'.join(varstrings)

re_json = re.compile('(\/\/|#)\ ?!json (.*)')
re_json = re.compile(r'(//|#) ?!json (.*)')
re_json.sub(rjson, f_string)

if not included:
Expand Down
2 changes: 1 addition & 1 deletion couchdbkit/ext/django/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(self, meta, app_label=None):

def contribute_to_class(self, cls, name):
cls._meta = self
self.installed = re.sub('\.models$', '', cls.__module__) in settings.INSTALLED_APPS
self.installed = re.sub(r'\.models$', '', cls.__module__) in settings.INSTALLED_APPS
# First, construct the default values for these options.
self.object_name = cls.__name__
self.module_name = self.object_name.lower()
Expand Down
2 changes: 1 addition & 1 deletion couchdbkit/resource.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def escape_docid(docid):
docid = url_quote(docid, safe='')
return docid

re_sp = re.compile('\s')
re_sp = re.compile(r'\s')
def encode_attachments(attachments):
for k, v in six.iteritems(attachments):
if v.get('stub', False):
Expand Down