Exemplo n.º 1
0
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import threading
import logging
import xformplayer
import touchcare
import java.lang
import time
import urllib2
from optparse import OptionParser
from datetime import datetime, timedelta
import settings

from setup import init_classpath

init_classpath()
import com.xhaus.jyson.JysonCodec as json
from xcp import InvalidRequestException, TouchFormsUnauthorized, TouchFormsBadRequest, TouchFormsNotFound

logger = logging.getLogger("formplayer.xformserver")
DEFAULT_PORT = 4444
DEFAULT_STALE_WINDOW = 3.0  # hours


class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    pass


class XFormHTTPGateway(threading.Thread):
    def __init__(self, port, stale_window, extensions=[]):
        threading.Thread.__init__(self)
Exemplo n.º 2
0
import sys
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from SocketServer import ThreadingMixIn
import threading
import logging
import xformplayer
import touchcare
import java.lang
import time
import urllib2
from optparse import OptionParser
from datetime import datetime, timedelta
import settings

from setup import init_classpath
init_classpath()
import com.xhaus.jyson.JysonCodec as json
from xcp import (
    InvalidRequestException,
    TouchFormsUnauthorized,
    TouchFormsBadRequest,
    TouchFormsNotFound,
)

logger = logging.getLogger('formplayer.xformserver')
datadog_logger = logging.getLogger('datadog')
DEFAULT_PORT = 4444
DEFAULT_STALE_WINDOW = 3. #hours

class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
    pass