From 9d94a01b631676b54f680c2571ae4dbba9ccd037 Mon Sep 17 00:00:00 2001 From: jantuomi Date: Tue, 19 Jul 2016 14:50:22 +0300 Subject: Restructure project --- jsonfactory.py | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 jsonfactory.py (limited to 'jsonfactory.py') diff --git a/jsonfactory.py b/jsonfactory.py deleted file mode 100644 index c57b430..0000000 --- a/jsonfactory.py +++ /dev/null @@ -1,27 +0,0 @@ -import json - - -class JSONFactory(object): - """Factory class to create JSON messages to be sent to the shoutbox API""" - running_id = 1 - - @staticmethod - def make_object(text, user, timestamp, ip): - """ - Create a JSON object from the passed parameters and - add a running id - """ - message = json.dumps({ - "id": JSONFactory.running_id, - "text": text, - "user": user, - "timestamp": timestamp, - "ip": ip - }) - JSONFactory.running_id += 1 - return message - - @staticmethod - def make_array(object_list): - """Create a JSON array from a list of JSON objects""" - return "[\n" + ",\n".join(object_list) + "\n]" -- cgit v1.3