summaryrefslogtreecommitdiff
path: root/zncparse.py
diff options
context:
space:
mode:
authordaniel-Jones <daniel@danieljon.es>2018-03-10 19:26:57 +1030
committerdaniel-Jones <daniel@danieljon.es>2018-03-10 19:26:57 +1030
commit928075c2bb2dbcd1a06838bba7e7cfc72cf2b1b0 (patch)
tree192cb3908a0b73093317012577a8567bd021ff73 /zncparse.py
parentb7302d9dee82ee9488a7421aa3be344cabeb3a87 (diff)
downloadzncparse-928075c2bb2dbcd1a06838bba7e7cfc72cf2b1b0.tar.gz
zncparse-928075c2bb2dbcd1a06838bba7e7cfc72cf2b1b0.zip
added GPL licence information
Diffstat (limited to 'zncparse.py')
-rw-r--r--zncparse.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/zncparse.py b/zncparse.py
index cc754d8..f80068b 100644
--- a/zncparse.py
+++ b/zncparse.py
@@ -1,4 +1,20 @@
#!/usr/bin/env python3
+'''
+Copyright Daniel Jones 2018
+
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see <http://www.gnu.org/licenses/>.
+'''
import os, json;
class Message:
@@ -26,7 +42,7 @@ class Message:
self.user = self.line.split("<", 1)[1].split(">", 1)[0];
except:
self.user = "ZNCLOG";
- self.line = "[99:99:99] <ZNCLOG> disregard message\n";
+ self.line = "[99:99:99] <ZNCLOG> name change or join/part, disregard.\n";
self.time = self.line.split(" <", 1)[0].replace("[", "").replace("]", "");
self.message = self.line.split("> ", 1)[1];
if self.message.endswith("\n"):
@@ -64,8 +80,6 @@ def getlogpaths():
if __name__ == "__main__":
debug = 1;
indir = "logs/parse";
- outdir = "out";
-
logfiles = [];
messages = [];
getlogpaths();
@@ -77,6 +91,6 @@ if __name__ == "__main__":
for x in range(len(messages)):
messages[x].parse();
tmpdata.append(messages[x].getstructuredmsg());
- json_data = json.dumps(tmpdata);
- print(json_data);
+ jsondata = json.dumps(tmpdata);
+ print(jsondata);