Commits

rjollos  committed 7b25fb2

1.1.2dev: Merged [12017] from 1.0-stable.

  • Participants
  • Parent commits c594ba7

Comments (0)

Files changed (2)

File trac/attachment.py

         attachment. Therefore, a return value of ``[]`` means
         everything is OK."""
 
+
 class ILegacyAttachmentPolicyDelegate(Interface):
-    """Interface that can be used by plugins to seemlessly participate
+    """Interface that can be used by plugins to seamlessly participate
        to the legacy way of checking for attachment permissions.
 
        This should no longer be necessary once it becomes easier to
         for listener in AttachmentModule(self.env).change_listeners:
             listener.attachment_added(self)
 
-
     @classmethod
     def select(cls, env, parent_realm, parent_id, db=None):
         """Iterator yielding all `Attachment` instances attached to
                 os.rmdir(attachment_dir)
             except OSError, e:
                 env.log.error("Can't delete attachment directory %s: %s",
-                    attachment_dir, exception_to_unicode(e, traceback=True))
+                              attachment_dir,
+                              exception_to_unicode(e, traceback=True))
 
     @classmethod
     def reparent_all(cls, env, parent_realm, parent_id, new_realm, new_id):
                 os.rmdir(attachment_dir)
             except OSError, e:
                 env.log.error("Can't delete attachment directory %s: %s",
-                    attachment_dir, exception_to_unicode(e, traceback=True))
+                              attachment_dir,
+                              exception_to_unicode(e, traceback=True))
 
     def open(self):
         path = self.path
             try:
                 old_attachment = Attachment(self.env,
                                             attachment.resource(id=filename))
-                if not (req.authname and req.authname != 'anonymous' \
+                if not (req.authname and req.authname != 'anonymous'
                         and old_attachment.author == req.authname) \
                    and 'ATTACHMENT_DELETE' \
                                         not in req.perm(attachment.resource):
                         "attachments requires ATTACHMENT_DELETE permission.",
                         name=filename))
                 if (not attachment.description.strip() and
-                    old_attachment.description):
+                        old_attachment.description):
                     attachment.description = old_attachment.description
                 old_attachment.delete()
             except TracError:
     def _render_form(self, req, attachment):
         req.perm(attachment.resource).require('ATTACHMENT_CREATE')
         return {'mode': 'new', 'author': get_reporter_id(req),
-            'attachment': attachment, 'max_size': self.max_size}
+                'attachment': attachment, 'max_size': self.max_size}
 
     def _download_as_zip(self, req, parent, attachments=None):
         if attachments is None:
         else:
             for d in self.delegates:
                 decision = d.check_attachment_permission(action, username,
-                        resource, perm)
+                                                         resource, perm)
                 if decision is not None:
                     return decision
 
             finally:
                 if destination is not None:
                     output.close()
-

File trac/wiki/web_ui.py

                9)
 
     def convert_content(self, req, mimetype, content, key):
-        return (content, 'text/plain;charset=utf-8')
+        return content, 'text/plain;charset=utf-8'
 
     # INavigationContributor methods
 
             if version and old_version and version > old_version + 1:
                 add_notice(req, _('The versions %(from_)d to %(to)d of the '
                                   'page %(name)s have been deleted.',
-                            from_=old_version + 1, to=version, name=page.name))
+                           from_=old_version + 1, to=version, name=page.name))
             else:
                 add_notice(req, _('The version %(version)d of the page '
                                   '%(name)s has been deleted.',
             template = self.PAGE_TEMPLATES_PREFIX + req.args.get('template')
             template_page = WikiPage(self.env, template)
             if template_page and template_page.exists and \
-                   'WIKI_VIEW' in req.perm(template_page.resource):
+                    'WIKI_VIEW' in req.perm(template_page.resource):
                 page.text = template_page.text
         elif 'version' in req.args:
             old_page = WikiPage(self.env, page.name,
             })
         data.update({'history': history, 'resource': page.resource})
         add_ctxtnav(req, _("Back to %(wikipage)s", wikipage=page.name),
-                           req.href.wiki(page.name))
+                    req.href.wiki(page.name))
         return 'history_view.html', data, None
 
     def _render_view(self, req, page):
                                                 format=conversion[0])
                 # or...
                 conversion_href = get_resource_url(self.env, page.resource,
-                                                req.href, format=conversion[0])
+                                                   req.href,
+                                                   format=conversion[0])
                 add_link(req, 'alternate', conversion_href, conversion[1],
                          conversion[3])
 
 
             # Attachments
             for event in AttachmentModule(self.env).get_timeline_events(
-                req, wiki_realm, start, stop):
+                    req, wiki_realm, start, stop):
                 yield event
 
     def render_timeline_event(self, context, field, event):
 
         # Attachments
         for result in AttachmentModule(self.env).get_search_results(
-            req, wiki_realm, terms):
+                req, wiki_realm, terms):
             yield result