~vomun-developers/anonplus/vomun-trunk

« back to all changes in this revision

Viewing changes to src/libs/morado/morado.py

  • Committer: AJ00200
  • Date: 2011-11-25 21:24:46 UTC
  • mfrom: (158.1.2)
  • Revision ID: git-v1:49f3402d2806f0bf05cba20d985a005227e14638
Fixed merge conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
63
63
                length = len(retjson)
64
64
                self.push("%4i%s" % (length, retjson))
65
65
 
66
 
                print "api returned", retjson
 
66
                #print "api returned", retjson
67
67
                self.data = 0
68
68
                self.buffer = ""
69
69
                self.size = -1
91
91
                                            # make a dict
92
92
 
93
93
        except Exception as ex:
94
 
            print libs.globals.global_vars["apifunctions"]
 
94
            #print libs.globals.global_vars["apifunctions"]
95
95
            ex = traceback.format_exc()
96
 
            print ex
 
96
            #print ex
97
97
            return {"error2": ex}
98
98
 
99
99
 
112
112
            pass
113
113
        else:
114
114
            sock, addr = pair
115
 
            print 'Incoming connection from %s' % repr(addr)
 
115
            #print 'Incoming connection from %s' % repr(addr)
116
116
            handler = APIHandler(sock)
117
117
 
118
118
#class APIServer(SocketServer.ThreadingMixIn, SocketServer.TCPServer):
134
134
class APIServerThead(libs.threadmanager.Thread):
135
135
 
136
136
    def run(self):
137
 
        libs.globals.global_vars["apiserver"] = APIServer('localhost', 9999)
138
 
        while libs.globals.global_vars["running"]:
 
137
        libs.globals.global_vars["apiserver"] = APIServer('localhost', 3451)
 
138
        print('API-server running on port 3451 : Started')
 
139
        while not self._stop.isSet():
139
140
            asyncore.loop(timeout = 5, count = 1)
140
141
 
141
142
def start():