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


Python CUT.get_user_nicks方法代码示例

本文整理汇总了Python中Core.chanusertracker.CUT.get_user_nicks方法的典型用法代码示例。如果您正苦于以下问题:Python CUT.get_user_nicks方法的具体用法?Python CUT.get_user_nicks怎么用?Python CUT.get_user_nicks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Core.chanusertracker.CUT的用法示例。


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

示例1: robocop

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user_nicks [as 别名]
 def robocop(self, message, request_id, mode):
     request = Request.load(request_id, active=False)
     if request is None:
         return
     
     if mode == "cancel":
         reply = "Cancelled scan request %s" % (request.id,)
         message.privmsg(reply, self.scanchan())
         nicks = CUT.get_user_nicks(request.user.name)
         for nick in nicks:
             message.privmsg(reply, nick)
         return
     
     if mode == "block":
         reply = "Updated request %s dists to %s" % (request.id, request.dists,)
         message.privmsg(reply, self.scanchan())
         nicks = CUT.get_user_nicks(request.user.name)
         for nick in nicks:
             message.privmsg(reply, nick)
         return
     
     user = request.user
     planet = request.target
     
     requester = user.name if not Config.getboolean("Misc", "anonscans") else "Anon"
     dists_intel = planet.intel.dists if planet.intel else 0
     message.privmsg("[%s] %s requested a %s Scan of %s:%s:%s Dists(i:%s%s) " % (request.id, requester, request.type, planet.x,planet.y,planet.z, 
                                                     dists_intel, "/r:%s" % request.dists if request.dists > 0 else "") + request.link, self.scanchan())
开发者ID:davesherratt,项目名称:merlin,代码行数:30,代码来源:request.py

示例2: blocks

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user_nicks [as 别名]
    def blocks(self, message, user, params):
        id = params.group(1)
        dists = int(params.group(2)) + 1
        request = Request.load(id)
        if request is None:
            message.reply("No open request number %s exists (idiot)." % (id,))
            return
        if request.user is not user and not user.is_member() and not self.is_chan(message, self.scanchan()):
            message.reply("Scan request %s isn't yours and you're not a scanner!" % (id,))
            return

        # Update Intel
        planet = request.target
        if planet.intel is None:
            planet.intel = Intel()
        planet.intel.dists = max(planet.intel.dists, dists)

        request.dists = max(request.dists, dists)
        session.commit()

        reply = "Updated request %s dists to %s" % (id, request.dists)
        message.reply(reply)
        if message.get_chan() != self.scanchan():
            message.privmsg(reply, self.scanchan())

        nicks = CUT.get_user_nicks(request.user.name)
        if message.get_nick() not in nicks:
            for nick in nicks:
                message.privmsg(reply, nick)
开发者ID:liam-wiltshire,项目名称:merlin,代码行数:31,代码来源:request.py

示例3: admin_msg

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user_nicks [as 别名]
def admin_msg(message, priority=2):
    # Import these here or Core/connection.py will get upset.
    from Core.chanusertracker import CUT
    from Core.config import Config
    from Core.connection import Connection

    for a in Config.options("Admins"):
        for nick in CUT.get_user_nicks(a.lower()):
            Connection.write("PRIVMSG %s :%s" % (nick, message), priority)
开发者ID:JDD,项目名称:merlin,代码行数:11,代码来源:admintools.py

示例4: robocop

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user_nicks [as 别名]
 def robocop(self, message, scantype, pa_id, x, y, z, names):
     nicks = []
     reply = "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,)
     reply+= Config.get("URL","viewscan") % (pa_id,)
     
     for name in names.split(","):
         user = User.load(name)
         for nick in CUT.get_user_nicks(name):
             nicks.append(nick)
             message.privmsg(self.url(reply, user), nick)
     
     reply = "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,)
     reply+= "delivered to: "
     reply+= ", ".join(nicks) if not Config.getboolean("Misc", "anonscans") else "Anon"
     from Hooks.scans.request import request
     message.privmsg(reply, request().scanchan())
开发者ID:Hardware-Hacks,项目名称:merlin,代码行数:18,代码来源:scans.py

示例5: cancel

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user_nicks [as 别名]
    def cancel(self, message, user, params):
        cancel_ids = []
        reply_ids = []
        noexist = []
        noaccess = []

        for id in params.group(1).split():
            if ":" in id:
                [start, end] = id.split(":")
                cancel_ids += range(int(start), int(end) + 1)
            elif "-" in id:
                [start, end] = id.split("-")
                cancel_ids += range(int(start), int(end) + 1)
            else:
                cancel_ids.append(int(id))

        for id in cancel_ids:
            id = str(id)
            request = Request.load(id)
            if request is None:
                noexist.append(id)
                continue
            if request.user is not user and not user.is_member() and not self.is_chan(message, self.scanchan()):
                noaccess.append(id)
                continue

            request.active = False
            session.commit()

            reply = "Cancelled scan request %s" % (id)
            nicks = CUT.get_user_nicks(request.user.name)
            if message.get_nick() not in nicks:
                for nick in nicks:
                    message.privmsg(reply, nick)

            reply_ids.append(id)

        if len(noexist) > 0:
            message.reply("No open request number %s exists (idiot)." % (", ".join(noexist),))
        if len(noaccess) > 0:
            message.reply("Scan requests: %s aren't yours and you're not a scanner!" % (", ".join(noaccess),))
        if len(reply_ids) > 0:
            reply = "Cancelled scan request %s" % (", ".join(reply_ids))
            message.reply(reply)
            if message.get_chan() != self.scanchan():
                message.privmsg(reply, self.scanchan())
开发者ID:liam-wiltshire,项目名称:merlin,代码行数:48,代码来源:request.py

示例6: cancel

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user_nicks [as 别名]
    def cancel(self, message, user, params):
        id = params.group(1)
        request = Request.load(id)
        if request is None:
            message.reply("No open request number %s exists (idiot)." % (id,))
            return
        if request.user is not user and not user.is_member() and not self.is_chan(message, self.scanchan()):
            message.reply("Scan request %s isn't yours and you're not a scanner!" % (id,))
            return

        request.active = False
        session.commit()

        reply = "Cancelled scan request %s" % (id,)
        message.reply(reply)
        if message.get_chan() != self.scanchan():
            message.privmsg(reply, self.scanchan())

        nicks = CUT.get_user_nicks(request.user.name)
        if message.get_nick() not in nicks:
            for nick in nicks:
                message.privmsg(reply, nick)
开发者ID:ellonweb,项目名称:merlin,代码行数:24,代码来源:request.py

示例7: robocop

# 需要导入模块: from Core.chanusertracker import CUT [as 别名]
# 或者: from Core.chanusertracker.CUT import get_user_nicks [as 别名]
 def robocop(self, message, scantype, pa_id, x, y, z, names, scanner, reqs, old=False):
     nicks = []
     reply = "Old " if old else ""
     reply += "%s on %s:%s:%s " % (PA.get(scantype,"name"),x,y,z,)
     if ("showscanner" in Config.options("Misc") and Config.getboolean("Misc", "showscanner") and scanner != 'None'):
         reply+= "from %s " % (User.load(id=scanner).name) if User.load(id=scanner) not in (None, 'None') else ""
     reply += Config.get("URL","viewscan") % (pa_id,)
     if old:
         reply += " !request cancel %s if this is suitable." % (reqs)
     
     for name in names.split(","):
         user = User.load(name)
         for nick in CUT.get_user_nicks(name):
             nicks.append(nick)
             message.privmsg(self.url(reply, user), nick)
     
     if not old:
         reply = "[-%s] %s on %s:%s:%s " % (reqs,PA.get(scantype,"name"),x,y,z,)
         reply+= "delivered to: "
         reply+= ", ".join(nicks) if not Config.getboolean("Misc", "anonscans") else "Anon"
         if Config.getboolean("Misc", "showurls"):
             reply += " (%s)" % (Config.get("URL","viewscan") % (pa_id,))
         from Hooks.scans.request import request
         message.privmsg(reply, request().scanchan())
开发者ID:JDD,项目名称:merlin,代码行数:26,代码来源:scans.py


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