Beispiel #1
0
def addadmin(user, channel, admin):
    """Add a user to the list of admins"""
    if admin in config.get("admins"):
        msg(channel, "%s already is an admin" % admin)
    else:
        config.set("admins", "%s,%s" % (config.get("admins"), admin))
        msg(channel,
            "%s has been added to the list of admins" % admin)
Beispiel #2
0
def addadmin(user, channel, text):
    """Add a user to the list of admins"""
    admin = text.split()[1]
    if is_admin(user):
        if admin in config.get("admins"):
            msg(channel, "%s already is an admin" % admin)
        else:
            config.set("admins", "%s,%s" % (config.get("admins"), admin))
            msg(channel,
                        "%s has been added to the list of admins" % admin)
Beispiel #3
0
def deladmin(user, channel, admin):
    """Remove a user from the list of admins"""
    if admin in config.get("admins"):
        admins = config.get("admins").split(",")
        admins.remove(admin)
        config.set("admins", ",".join(admins))
        msg(channel,
            "%s has been removed from the list of admins" %
            admin)
    else:
        msg(channel, "Sorry, %s is not even an admin" % admin)
Beispiel #4
0
 def test_exists(self):
     config.set("key", "value")
     self.assertEqual("value", config.get("key"))
Beispiel #5
0
 def test_converter_int_setandget(self):
     config.set("intkey", 2)
     self.assertTrue(isinstance(config.get_int("intkey"), int))
Beispiel #6
0
 def test_default_doesnt_overwrite(self):
     config.set("not_overwritten_key", 1)
     self._set_default_options(not_overwritten_key=2)
     self.assertEquals(config.get_int("not_overwritten_key"), 1)