'''
Created on 16 Dec 2014

@author: gustavo
'''

import threading 
import time

class Server(threading.Thread):
    USER_IDS = ['5352b590-05ac-11e3-9923-c3e7d8408f3a', 'f85f124a-05cd-11e3-8a11-a8206608c529', '5352b590-05cd-11e3-8a11-9923-c3e7d84005cd']
    INPUT = '177.126.180.83 - - [15/Aug/2013:13:54:38 -0300] \"GET /meme.jpg HTTP/1.1\" 200 2148 \"-\"\"userid='
    identificador = 0;
    def __init__(self, id):
        threading.Thread.__init__(self)
        self.identificador = id;

    def run(self):
        while(True):
            print "thread "  + str(self.identificador)
            time.sleep(2)



s1 = Server(1);
s2 = Server(2);
s1.start();
s2.start();

s1.join();
s2.join();





@@ -72,16 +72,53 @@
 ort time
+%0Aimport os%0Afrom random import randint
 %0A%0Aclass 
@@ -296,16 +296,17 @@
 INPUT = 
+%5B
 '177.126
@@ -401,253 +401,1054 @@
 id='
-%0A    identificador = 0;%0A    def __init__(self, id):%0A        threading.Thread.__init__(self)%0A        self.identificador = id;%0A%0A    def run(self):%0A        while(True):%0A            print %22thread %22  + str(self.identificador)%0A            time.sleep(2
+,'177.126.180.83 - - %5B15/Aug/2013:13:54:38 -0300%5D %5C%22GET /teste.jpg HTTP/1.1%5C%22 200 2148 %5C%22-%5C%22%5C%22userid=','127.0.0.1 - - %5B15/Aug/2013:13:54:38 -0300%5D %5C%22GET /meme.jpg HTTP/1.1%5C%22 200 2148 %5C%22-%5C%22%5C%22userid='%5D%0A    identificador = 0%0A    file_to_write = None%0A    filename = None%0A    def __init__(self, id):%0A        threading.Thread.__init__(self)%0A        self.identificador = id%0A        path = 'server_'+ str(self.identificador)%0A        f = 'server_' + str(self.identificador)+'.log'%0A        if not os.path.exists(path):%0A            os.makedirs(path)%0A        self.filename = os.path.join(path, f)%0A        self.file_to_write= open(self.filename, 'w')%0A%0A    def run(self):%0A        while(True):%0A            user_index = randint(0,2)%0A            input_index = randint(0,2)%0A            self.file_to_write= open(self.filename, 'w')%0A            log_input = self.INPUT%5Binput_index%5D + self.USER_IDS%5Buser_index%5D + '%5C%22'%0A            self.file_to_write.write(log_input)%0A            self.file_to_write.close()%0A            print log_input%0A            time.sleep(randint(2,9)
 )%0A%0A%0A
@@ -1480,16 +1480,49 @@
 ver(2);%0A
+s3 = Server(3);%0As4 = Server(4);%0A%0A
 s1.start
@@ -1541,31 +1541,31 @@
 ();%0A
-%0As1.join();%0As2.join
+s3.start();%0As4.start
 ();%0A%0A%0A%0A
-%0A

add some data in the server class