Parcourir la source

banned warnings

tBKwtWS il y a 7 ans
Parent
commit
afa77eafb6
3 fichiers modifiés avec 26 ajouts et 4 suppressions
  1. 10 1
      .eric6project/pyRot.e6t
  2. 3 0
      common/log.py
  3. 13 3
      rotbot.py

+ 10 - 1
.eric6project/pyRot.e6t

@@ -1,7 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE Tasks SYSTEM "Tasks-6.0.dtd">
 <!-- eric6 tasks file for project pyRot -->
-<!-- Saved: 2018-01-27, 00:37:00 -->
+<!-- Saved: 2018-01-27, 10:45:12 -->
 <Tasks version="6.0">
   <ProjectScanFilter></ProjectScanFilter>
+  <Task priority="1" completed="False" type="2" uid="{18a4cff9-77ab-44ac-9bb4-74d878d83cbd}">
+    <Summary>WARNING: &quot; + str(message))</Summary>
+    <Description></Description>
+    <Created>2018-01-27, 10:45:09</Created>
+    <Resource>
+      <Filename>common/log.py</Filename>
+      <Linenumber>8</Linenumber>
+    </Resource>
+  </Task>
 </Tasks>

+ 3 - 0
common/log.py

@@ -4,5 +4,8 @@ def info(message):
 def notice(message):
     print("NOTICE: " + str(message))
 
+def warning(message):
+    print("WARNING: " + str(message))
+
 def error(message):
     print("ERROR: " + str(message))

+ 13 - 3
rotbot.py

@@ -116,12 +116,22 @@ class PyRot(irc.bot.SingleServerIRCBot):
         log.info(event)
     
     
-    def on_userhost(self, connection, event):
-        print(event)
-    
     def on_whoreply(self, connection, event):
         events.on_whoreply.process_event(self, connection, event)
     
+    def on_userhost(self, connection, event):
+        log.info(event)
+        
+    
+    def on_yourhost(self, connection, event):
+        log.info(event)
+    
+    def on_yourebannedcreep(self, connection, event):
+        log.warning(event)
+    
+    def on_youwillbebanned(selfself, connection, event):
+        log.warning(event)
+    
     
     # DCC stuff from originalexample file.
     def on_dccmsg(self, c, e):