Permalink
Browse files

added some comments

  • Loading branch information...
1 parent f964776 commit 83dd9ace582755f73273276d71a2d86f53df30b5 @Marthyn Marthyn committed May 12, 2011
Showing with 7 additions and 3 deletions.
  1. +7 −3 TuxNotifier/src/action/printAction.py
@@ -10,7 +10,7 @@ class PrintAction():
def __init__(self, text, type):
- self.connect()
+ self.connect("mongo.wtstest.com", 27017)
self.date = strftime("%Y-%m-%d")
self.time = strftime("%H:%M:%S")
@@ -23,6 +23,7 @@ def __init__(self, text, type):
self.tux_speak_msg(text)
print text
+ """Function to put a system message into the MongoDB"""
def system_msg(self, text):
tabel = self.db.system_messages
text = text.replace("\n", " ")
@@ -32,6 +33,7 @@ def system_msg(self, text):
"Message": text}
tabel.insert(record)
+ """Function to put a job status into the MongoDB"""
def job_status_msg(self, text):
tabel = self.db.jobs
textArray = text.split("\n")
@@ -42,6 +44,7 @@ def job_status_msg(self, text):
"Status": textArray[2].split(" ")[1]}
tabel.insert(record)
+ """Function to put a line of text that tux says into the MongoDB"""
def tux_speak_msg(self, text):
tabel = self.db.tuxSpeak
text = text.replace("\n", " ")
@@ -51,8 +54,9 @@ def tux_speak_msg(self, text):
"Message": text}
tabel.insert(record)
- def connect(self):
- connection = Connection('mongo.wtstest.com', 27017)
+ """Connect to the MongoDB"""
+ def connect(self, url, port):
+ connection = Connection(url, port)
self.db=connection.tuxdroid

0 comments on commit 83dd9ac

Please sign in to comment.