1. Ronny Pfannschmidt
  2. couchdb-compose

Commits

Ronny Pfannschmidt  committed 9bbeefb

push_attachment->add_attachment

  • Participants
  • Parent commits dbd72f8
  • Branches default

Comments (0)

Files changed (2)

File couchdb_compose/attachments.py

View file
     for attachment in attachments:
         if isinstance(attachment, str):
             for path in composer.path.visit(attachment):
-                composer.push_attachment(path)
+                composer.add_attachment(path)
         else:
             for prefix, maybe_globs in attachment.items():
                 newpath = composer.path.join(prefix)
 
                 for glob in maybe_globs:
                     for path in newpath.visit(glob):
-                        composer.push_attachment(path)
+                        composer.add_attachment(path)

File couchdb_compose/composer.py

View file
             d = d.setdefault(attr, {})
         d[attrs[-1]] = data  #XXX: conflicts
 
-    def push_attachment(self, attachment_path):
+    def add_attachment(self, attachment_path):
         attachments = self.doc.setdefault('_attachments', {})
         content = attachment_path.read()
         name = self.path.bestrelpath(attachment_path)
 
-        attachments[name] = {'data': content, 'content-type': mimetypes.guess_type(name)[0]}
+        attachments[name] = {'data': content, 'content_type': mimetypes.guess_type(name)[0]}