コード例 #1
0
 def _popcon(self, irc, msg, args, package):
     try:
         msg = popcon(package)
         if msg:
             irc.reply(colourise(msg.for_irc()), prefixNick=False)
     except Exception, e:
         irc.reply("Error: unable to obtain popcon data for %s" % package)
コード例 #2
0
 def _popcon(self, irc, msg, args, package):
     try:
         msg = popcon(package)
         if msg:
             irc.reply(colourise(msg.for_irc()), prefixNick=False)
     except Exception, e:
         irc.reply("Error: unable to obtain popcon data for %s" % package)
コード例 #3
0
 def _popcon(self, irc, msg, args, package):
     """Get popcon data."""
     try:
         msg = popcon(package, self.requests_session)
         if msg:
             irc.reply(colourise(msg.for_irc()), prefixNick=False)
     except Exception as e:
         irc.reply("Error: unable to obtain popcon data for %s" % package)
コード例 #4
0
 def _popcon(self, irc, msg, args, package):
     """Get popcon data."""
     try:
         msg = popcon(package, self.requests_session)
         if msg:
             irc.reply(colourise(msg.for_irc()), prefixNick=False)
     except Exception as e:
         irc.reply("Error: unable to obtain popcon data for %s" % package)
コード例 #5
0
    def _test(self, package='haskell-devscripts'):
        fixture = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                               'fixtures', 'popcon', package)
        with io.open(fixture, encoding='utf-8') as f:
            data = f.read()

        self.mocker.register_uri('GET', 'https://qa.debian.org/popcon.php',
                                 text=data)

        return popcon(package, self.session)
コード例 #6
0
    def _test(self, package='haskell-devscripts'):
        fixture = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                               'fixtures', 'popcon', package)
        with io.open(fixture, encoding='utf-8') as f:
            data = f.read()

        self.mocker.register_uri('GET',
                                 'https://qa.debian.org/popcon.php',
                                 text=data)

        return popcon(package, self.session)
コード例 #7
0
    def _test(self, package="haskell-devscripts"):
        fixture = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                               "fixtures", "popcon", package)
        with io.open(fixture, encoding="utf-8") as f:
            data = f.read()

        self.mocker.register_uri("GET",
                                 "https://qa.debian.org/popcon.php",
                                 text=data)

        return popcon(package, self.session)
コード例 #8
0
 def _test(self, package='haskell-devscripts'):
     return popcon(package, open(os.path.join(os.path.dirname(os.path.abspath(__file__)), \
         'fixtures', 'popcon', package)))