mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2025-12-24 17:11:22 +00:00
More PEP8 Compliance
I wouldn't have to do this if people would just write their python properly ;-;
This commit is contained in:
@@ -3,29 +3,33 @@
|
|||||||
# Four arguments, password host channel and message.
|
# Four arguments, password host channel and message.
|
||||||
# EG: "ircbot_message.py hunter2 example.com #adminchannel ADMINHELP, people are killing me!"
|
# EG: "ircbot_message.py hunter2 example.com #adminchannel ADMINHELP, people are killing me!"
|
||||||
|
|
||||||
import sys,cPickle,socket,HTMLParser
|
import sys
|
||||||
|
import cPickle
|
||||||
|
import socket
|
||||||
|
import HTMLParser
|
||||||
|
|
||||||
|
|
||||||
def pack():
|
def pack():
|
||||||
ht = HTMLParser.HTMLParser()
|
ht = HTMLParser.HTMLParser()
|
||||||
|
|
||||||
passwd = sys.argv[1]
|
passwd = sys.argv[1]
|
||||||
ip = sys.argv[3]
|
ip = sys.argv[3]
|
||||||
try:
|
try:
|
||||||
data = []
|
data = []
|
||||||
for in_data in sys.argv[4:]: #The rest of the arguments is data
|
for in_data in sys.argv[4:]: #The rest of the arguments is data
|
||||||
data += {ht.unescape(in_data)}
|
data += {ht.unescape(in_data)}
|
||||||
except:
|
except:
|
||||||
data = "NO DATA SPECIFIED"
|
data = "NO DATA SPECIFIED"
|
||||||
dictionary = {"ip":ip,"data":[passwd] + data}
|
dictionary = {"ip": ip, "data": [passwd] + data}
|
||||||
pickled = cPickle.dumps(dictionary)
|
pickled = cPickle.dumps(dictionary)
|
||||||
nudge(pickled)
|
nudge(pickled)
|
||||||
def nudge(data):
|
def nudge(data):
|
||||||
HOST = sys.argv[2]
|
HOST = sys.argv[2]
|
||||||
PORT = 45678
|
PORT = 45678
|
||||||
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
s.connect((HOST,PORT))
|
s.connect((HOST, PORT))
|
||||||
s.send(data)
|
s.send(data)
|
||||||
s.close()
|
s.close()
|
||||||
|
|
||||||
if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument
|
if __name__ == "__main__" and len(sys.argv) > 1: # If not imported and more than one argument
|
||||||
pack()
|
pack()
|
||||||
|
|||||||
Reference in New Issue
Block a user