当前位置: 首页>>代码示例>>Python>>正文


Python api.AnnouncementSystem类代码示例

本文整理汇总了Python中announcer.api.AnnouncementSystem的典型用法代码示例。如果您正苦于以下问题:Python AnnouncementSystem类的具体用法?Python AnnouncementSystem怎么用?Python AnnouncementSystem使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AnnouncementSystem类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ticket_changed

 def ticket_changed(self, ticket, comment, author, old_values):
     if old_values.keys() == ['cc'] and not comment and \
             self.ignore_cc_changes:
         return
     announcer = AnnouncementSystem(ticket.env)
     announcer.send(TicketChangeEvent('ticket', 'changed', ticket,
                                      comment, author, old_values))
开发者ID:aroth-arsoft,项目名称:trac-announcer,代码行数:7,代码来源:producers.py

示例2: ticket_created

 def ticket_created(self, ticket):
     announcer = AnnouncementSystem(ticket.env)
     announcer.send(
         TicketChangeEvent("ticket", "created", ticket,
             author=ticket['reporter']
         )
     )
开发者ID:lkraav,项目名称:trachacks,代码行数:7,代码来源:producers.py

示例3: wiki_page_added

 def wiki_page_added(self, page):
     history = list(page.get_history())[0]
     announcer = AnnouncementSystem(page.env)
     announcer.send(
         WikiChangeEvent("wiki", "created", page,
             author=history[2], version=history[0]
         )
     )
开发者ID:lkraav,项目名称:trachacks,代码行数:8,代码来源:producers.py

示例4: wiki_page_changed

 def wiki_page_changed(self, page, version, t, comment, author, ipnr):
     announcer = AnnouncementSystem(page.env)
     announcer.send(
         WikiChangeEvent("wiki", "changed", page,
             comment=comment, author=author, version=version,
             timestamp=t, remote_addr=ipnr
         )
     )
开发者ID:lkraav,项目名称:trachacks,代码行数:8,代码来源:producers.py

示例5: _notify

 def _notify(self, build, category):
     self.log.info("BittenAnnouncedEventProducer invoked for build %r", build)
     self.log.debug("build status: %s", build.status)
     self.log.info("Creating announcement for build %r", build)
     try:
         announcer = AnnouncementSystem(self.env)
         announcer.send(BittenAnnouncedEvent(build, category))
     except Exception, e:
         self.log.exception("Failure creating announcement for build " "%s: %s", build.id, e)
开发者ID:nyuhuhuu,项目名称:trachacks,代码行数:9,代码来源:announce.py

示例6: _notify

 def _notify(self, category, username, password=None, token=None):
     try:
         announcer = AnnouncementSystem(self.env)
         announcer.send(
             AccountChangeEvent(category, username, password, token)
         )
     except Exception, e:
         self.log.exception("Failure creating announcement for account "
                            "event %s: %s", username, category)
开发者ID:lkraav,项目名称:trachacks,代码行数:9,代码来源:announce.py

示例7: blog_comment_added

 def blog_comment_added(self, postname, number):
     """Called when Blog comment number N on post 'postname' is added."""
     blog_post = BlogPost(self.env, postname, 0)
     blog_comment = BlogComment(self.env, postname, number)
     announcer = AnnouncementSystem(self.env)
     announcer.send(
         BlogChangeEvent(
             blog_post,
             'comment created',
             self.env.abs_href.blog(blog_post.name),
             blog_comment
         )
     )
开发者ID:csnover,项目名称:TracAnnouncer,代码行数:13,代码来源:announce.py

示例8: SubscriptionTestSetup

class SubscriptionTestSetup(unittest.TestCase):
    def setUp(self):
        self.env = EnvironmentStub(enable=['trac.*'])
        self.env.path = tempfile.mkdtemp()
        self.db_mgr = DatabaseManager(self.env)
        self.db = self.env.get_db_cnx()
        # Setup current announcer db schema tables.
        self.an_sys = AnnouncementSystem(self.env)
        self.an_sys.upgrade_environment(self.db)

    def tearDown(self):
        self.db.close()
        # Really close db connections.
        self.env.shutdown()
        shutil.rmtree(self.env.path)
开发者ID:lkraav,项目名称:trachacks,代码行数:15,代码来源:model.py

示例9: setUp

 def setUp(self):
     self.env = EnvironmentStub(enable=['trac.*'])
     self.env.path = tempfile.mkdtemp()
     self.db_mgr = DatabaseManager(self.env)
     self.db = self.env.get_db_cnx()
     # Setup current announcer db schema tables.
     self.an_sys = AnnouncementSystem(self.env)
     self.an_sys.upgrade_environment(self.db)
开发者ID:lkraav,项目名称:trachacks,代码行数:8,代码来源:model.py

示例10: blog_post_deleted

    def blog_post_deleted(self, postname, version, fields):
        """Called when a blog post is deleted:

        version==0 means all versions (or last remaining) version is deleted.
        Any version>0 denotes a specific version only.
        Fields is a dict with the pre-existing values of the blog post.
        If all (or last) the dict will contain the 'current' version
        contents.
        """
        blog_post = BlogPost(self.env, postname, version)
        announcer = AnnouncementSystem(self.env)
        announcer.send(
            BlogChangeEvent(
                blog_post,
                'post deleted',
                self.env.abs_href.blog(blog_post.name)
            )
        )
开发者ID:csnover,项目名称:TracAnnouncer,代码行数:18,代码来源:announce.py

示例11: blog_post_changed

    def blog_post_changed(self, postname, version):
        """Called when a new blog post 'postname' with 'version' is added.

        version==1 denotes a new post, version>1 is a new version on existing
        post.
        """
        blog_post = BlogPost(self.env, postname, version)
        action = 'post created'
        if version > 1:
            action = 'post changed'
        announcer = AnnouncementSystem(self.env)
        announcer.send(
            BlogChangeEvent(
                blog_post,
                action,
                self.env.abs_href.blog(blog_post.name)
            )
        )
开发者ID:csnover,项目名称:TracAnnouncer,代码行数:18,代码来源:announce.py

示例12: blog_comment_deleted

    def blog_comment_deleted(self, postname, number, fields):
        """Called when blog post comment 'number' is deleted.

        number==0 denotes all comments is deleted and fields will be empty.
        (usually follows a delete of the blog post).

        number>0 denotes a specific comment is deleted, and fields will contain
        the values of the fields as they existed pre-delete.
        """
        blog_post = BlogPost(self.env, postname, 0)
        announcer = AnnouncementSystem(self.env)
        announcer.send(
            BlogChangeEvent(
                blog_post,
                'comment deleted',
                self.env.abs_href.blog(blog_post.name),
                fields
            )
        )
开发者ID:csnover,项目名称:TracAnnouncer,代码行数:19,代码来源:announce.py

示例13: verify

 def verify(self, repository_id, path, revision=None, start=None):
     """Run svnadmin verify against a repository.
     Pass revision as None or -1 to check all revisions.
     """
     if revision < 0:
         revision = None
     self.log.info("Verifying %s at %s", repository_id, path)
     if revision is not None:
         cmdline = ["svnadmin","verify","-r",str(int(revision)),path]
         level   = "revision"
     elif start is not None:
         cmdline = ["svnadmin","verify", "-r","%d:HEAD" % start,path]
         level   = "partial"
     else:
         cmdline = ["svnadmin","verify",path]
         level   = "full"
     self.log.debug(cmdline)
     child = Popen(cmdline, bufsize=-1, stdin=PIPE, stdout=PIPE,
                   stderr=PIPE)
     (out, err) = child.communicate()
     self.log.debug(out)
     if child.returncode == 0:
         self.log.debug(err)
     else:
         self.log.warning("Failed svnadmin of %s", path)
         self.log.warning(err)
     @self.env.with_transaction()
     def do_insert(db):
         cursor = db.cursor()
         cursor.execute("INSERT INTO svnverify_log (repository_id, type, result, log, time) VALUES (%s,%s,%s,%s,%s)",
                        (repository_id, level, child.returncode, err, to_utimestamp(datetime.now(utc))))
     
     if child.returncode == 0:
         return True
     else:
         announcer = AnnouncementSystem(self.env)
         announcer.send(SVNVerifyFailEvent("integrity", "verifyfail", path,
                                           log=err))
         return False
开发者ID:CGI-define-and-primeportal,项目名称:trac-plugin-svnverify,代码行数:39,代码来源:commands.py

示例14: attachment_added

 def attachment_added(self, attachment):
     parent = attachment.resource.parent
     if parent.realm == 'ticket':
         ticket = Ticket(self.env, parent.id)
         announcer = AnnouncementSystem(ticket.env)
         announcer.send(
             TicketChangeEvent('ticket', 'attachment added', ticket,
                               attachment=attachment,
                               author=attachment.author))
     elif parent.realm == 'wiki':
         page = WikiPage(self.env, parent.id)
         announcer = AnnouncementSystem(page.env)
         announcer.send(
             WikiChangeEvent('wiki', 'attachment added', page,
                             attachment=attachment,
                             author=attachment.author))
开发者ID:aroth-arsoft,项目名称:trac-announcer,代码行数:16,代码来源:producers.py

示例15: attachment_added

 def attachment_added(self, attachment):
     parent = attachment.resource.parent
     if parent.realm == "ticket":
         ticket = Ticket(self.env, parent.id)
         announcer = AnnouncementSystem(ticket.env)
         announcer.send(
             TicketChangeEvent("ticket", "attachment added", ticket,
                 attachment=attachment, author=attachment.author,
             )
         )
     elif parent.realm == "wiki":
         page = WikiPage(self.env, parent.id)
         announcer = AnnouncementSystem(page.env)
         announcer.send(
             WikiChangeEvent("wiki", "attachment added", page,
                 attachment=attachment, author=attachment.author,
             )
         )
开发者ID:lkraav,项目名称:trachacks,代码行数:18,代码来源:producers.py


注:本文中的announcer.api.AnnouncementSystem类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。