Procházet zdrojové kódy

is not with literal

tBKwtWS před 6 roky
rodič
revize
5767c9ce01

+ 2 - 1
README.md

@@ -35,6 +35,7 @@ Fill in the passwords, don't change the database name, it's hardcoded in pyRot,
 1. `CREATE DATABASE website WITH OWNER = website;`
 1. `CREATE ROLE pyrot WITH LOGIN PASSWORD '';`
 1. `GRANT ALL ON DATABASE website TO pyrot;`
+1. `GRANT ALL PRIVILEGES ON ALL TABLES ON DATABASE website IN SCHEMA public TO pyrot;``
 
 ## DB authentication
 
@@ -61,7 +62,7 @@ exit 0
 ```
 Test with: `bin/uwsgi --emperor /etc/uwsgi/vassals/`
 TBD
-/etc/rc.local: 
+/etc/rc.local:
 
 ## Nginx configuration
 1. See if you to change `STATIC_ROOT` in `website/website/settings.py`.

+ 9 - 9
rotbot/commands/admin.py

@@ -66,7 +66,7 @@ def do_command(self, connection, event):
 
     elif one == 'quit':
         if cmdtype == 'help':    # Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Disconnect and terminate " + connection.get_nickname() + ". Optionally with reason.")
             connection.privmsg(replyto,  grey + "Usage: " + blue + "!quit " + font.reset + font.italic + "reason")
@@ -86,7 +86,7 @@ def do_command(self, connection, event):
             connection.privmsg(replyto, "Denied, you need to have operator status or higher in " + font.font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    # Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Reconnect " + connection.get_nickname() + ". Reason optional.")
             connection.privmsg(replyto,  grey + "Usage: " + blue + "!reconnect " + font.reset + font.italic + "reason")
@@ -101,7 +101,7 @@ def do_command(self, connection, event):
             connection.privmsg(replyto, "Denied, you need to have voiced status or higher in " + font.font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    # Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Let " + connection.get_nickname() + " try to recover " + connection.nickname + " as nickname.")
         elif cmdtype == "cmd":
@@ -116,7 +116,7 @@ def do_command(self, connection, event):
             connection.privmsg(replyto, "Denied, you need to have operator status or higher in " + font.font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Make " + connection.get_nickname() + " join a channel. Password optional.")
             connection.privmsg(replyto, grey + "Usage: " + blue + self.cmdchar + "join " + font.font.red + font.italic + "channel " + font.reset + font.italic + "password")
@@ -135,7 +135,7 @@ def do_command(self, connection, event):
 
     elif one == "part":
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Make " + connection.get_nickname() + " part a channel. Reason optional.")
             connection.privmsg(replyto, grey + "Usage: " + blue + self.cmdchar + "join " + font.font.red + font.italic + "channel " + font.reset + font.italic + "password")
@@ -177,7 +177,7 @@ def do_command(self, connection, event):
 
     elif one == "msg" or  command.split(maxsplit=1)[0] == "act":
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             if command.split(maxsplit=1)[0] == "act":
                 message = "Let " + connection.get_nickname() + " send an action to a channel."
@@ -232,7 +232,7 @@ def do_command(self, connection, event):
 
     # elif one == "channelfunctions":
     #     if cmdtype == "help":    #Display help text. # Help code block first, as it is impossible to predict for what channel a later command is going to be issued. Rights filtering after help test.
-    #         if len(command.split()) is not 1:
+    #         if len(command.split()) != 1:
     #             return
     #         connection.privmsg(replyto, "Display or toggle the status channel functions. Channel, function and value optional. Get a description of a functio via the help argument.")
     #         connection.privmsg(replyto, grey + "Usage: " + blue + "!channelfunctions " + font.red + font.italic + "channel " + font.reset + font.italic + "function value")
@@ -316,7 +316,7 @@ def do_command(self, connection, event):
             connection.privmsg(replyto, "Denied, you need to be the owner of " + font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    # Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Register with NickServ.")
             connection.privmsg(replyto, grey + "Usage: " + blue + self.cmdchar + "registernick " + font.reset + font.italic + "email")
@@ -339,7 +339,7 @@ def do_command(self, connection, event):
             connection.privmsg(replyto, "Denied, you need to be the owner of " + font.red + self.network.home_channel  + font.reset + ".")
             return
         if cmdtype == "help":    # Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Ban all nicknames and usernames for a host in all channels.")
             connection.privmsg(replyto, grey + "Example: " + blue + self.cmdchar + "banall " + font.reset + font.italic + "host")

+ 1 - 1
rotbot/commands/games.py

@@ -70,7 +70,7 @@ def do_command(self, connection, event):
 
     elif command.split()[0] == "dice":
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Rolls multiple dices of chosen type. Specifying type or amount is optional.")
             connection.privmsg(replyto, font.grey + "Usage: " + blue + self.cmdchar + "dice " + font.reset + font.italic + "amount type")

+ 5 - 5
rotbot/commands/public.py

@@ -22,7 +22,7 @@ def do_command(self, connection, event):
     # The actual commands:
     # if command == "test":
     #     if cmdtype == "help":    #Display help text.
-    #         if len(command.split()) is not 1:
+    #         if len(command.split()) != 1:
     #             return
     #         connection.privmsg(replyto, "Strictly for testing purposes only!")
     #     elif cmdtype == "cmd":
@@ -31,7 +31,7 @@ def do_command(self, connection, event):
 
     if command == "cmd" or command == "cmds" or command == "commands":
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Displays a list of commands.")
         elif cmdtype == "cmd":
@@ -42,7 +42,7 @@ def do_command(self, connection, event):
 
     elif command == "help":
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Explains how to get help on any specific command and hints the user to the commandlist.")
         elif cmdtype == "cmd":
@@ -52,7 +52,7 @@ def do_command(self, connection, event):
 
     # elif one == "stopgreet":
     #     if cmdtype == "help":    #Display help text.
-    #         if len(command.split()) is not 1:
+    #         if len(command.split()) != 1:
     #             return
     #         connection.privmsg(replyto, "Stops the bot from greeting you or a specific user. Channel, user and option to resume optional.")
     #         connection.privmsg(replyto, grey + "Usage: " + blue + "!stopgreet " + reset + font.italic + "resume " + font.red + "channel user")
@@ -125,7 +125,7 @@ def do_command(self, connection, event):
     #
     # elif one == "away":
     #     if cmdtype == "help":    #Display help text.
-    #         if len(command.split()) is not 1:
+    #         if len(command.split()) != 1:
     #             return
     #         connection.privmsg(replyto, "Sets you away, optionally with reason. This affects the !seen command and the game.")
     #         connection.privmsg(replyto, grey + "Usage: " + blue + "!away " + reset + font.italic + "reason")

+ 2 - 2
rotbot/commands/statistics.py

@@ -31,7 +31,7 @@ def do_command(self, connection, event):
 
     elif command.split()[0] == "joins" or command.split()[0] == "kicks" or command.split()[0] == "messages" or command.split()[0] == "actions" or command.split()[0] == "notices":
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Display amount of " + command.split()[0] + " of user and channel. Channel and user optional.")
             connection.privmsg(replyto, grey + "Usage: " + blue + self.cmdchar + command.split()[0] + " " + font.reset + font.italic + "channel user")
@@ -147,7 +147,7 @@ def do_command(self, connection, event):
 
     elif command.split()[0] == "seen":
         if cmdtype == "help":    #Display help text.
-            if len(command.split()) is not 1:
+            if len(command.split()) != 1:
                 return
             connection.privmsg(replyto, "Report the last sighting of a user.")
             connection.privmsg(replyto, grey + "Usage: " + blue + self.cmdchar + command.split()[0] + " " + font.reset + font.italic + "user")