def __init__(self): self.api_pid_file = os.path.join(MONITOR_ROOT, "frontend.pid.txt") self.api_log_file = os.path.join(MONITOR_ROOT, "frontend.log.txt") self.reserved_routes = ["frontend", "web", "files", "statuses"] self.routes = [ (r"/web/([a-zA-Z0-9\-\._/]+)", self.WebAssetHandler), (r"/auth/(user|annex|drive)/", self.AuthHandler), (r"/files/(.+)", self.FileHandler), (r"/task/", self.TaskHandler)] self.default_on_loads = [ "/web/js/lib/sockjs-0.3.min.js", "/web/js/models/unveillance_notifier.js", "/web/js/models/unveillance_document.js" ] self.on_loads_by_status = [[] for i in range(4)] self.restricted_routes_by_status = [[] for i in range(4)] self.restricted_mime_types_by_status = [[] for i in range(4)] self.restrict_source_files = {} self.on_loads = {} self.get_page_load_extras = {} from conf import buildServerURL, SERVER_PORT, SHA1_INDEX from vars import MIME_TYPES, ASSET_TAGS, MIME_TYPE_TASKS self.init_vars = { 'MIME_TYPES' : MIME_TYPES, 'ASSET_TAGS' : ASSET_TAGS, 'MIME_TYPE_TASKS' : MIME_TYPE_TASKS, 'SHA1_INDEX' : 32 if not SHA1_INDEX else 40 } UnveillanceAPI.__init__(self)
def __init__(self): self.api_pid_file = os.path.join(MONITOR_ROOT, "frontend.pid.txt") self.api_log_file = os.path.join(MONITOR_ROOT, "frontend.log.txt") self.reserved_routes = ["frontend", "web", "files", "statuses"] self.routes = [(r"/web/([a-zA-Z0-9\-\._/]+)", self.WebAssetHandler), (r"/auth/(user|annex|drive)/", self.AuthHandler), (r"/files/(.+)", self.FileHandler), (r"/task/", self.TaskHandler)] self.default_on_loads = [ "/web/js/lib/sockjs-0.3.min.js", "/web/js/models/unveillance_notifier.js", "/web/js/models/unveillance_document.js" ] self.on_loads_by_status = [[] for i in range(4)] self.restricted_routes_by_status = [[] for i in range(4)] self.restricted_mime_types_by_status = [[] for i in range(4)] self.restrict_source_files = {} self.on_loads = {} self.get_page_load_extras = {} from conf import buildServerURL, SERVER_PORT, SHA1_INDEX from vars import MIME_TYPES, ASSET_TAGS, MIME_TYPE_TASKS self.init_vars = { 'MIME_TYPES': MIME_TYPES, 'ASSET_TAGS': ASSET_TAGS, 'MIME_TYPE_TASKS': MIME_TYPE_TASKS, 'SHA1_INDEX': 32 if not SHA1_INDEX else 40 } UnveillanceAPI.__init__(self)
def __init__(self): self.api_pid_file = os.path.join(MONITOR_ROOT, "api.pid.txt") self.api_log_file = os.path.join(MONITOR_ROOT, "api.log.txt") self.reserved_routes = ["files", "sync", "task"] self.routes = [ (r"/files/(\S+)", self.FileHandler), (r"/sync/(.+)", self.SyncHandler), (r"/task/", self.TaskHandler)] UnveillanceAPI.__init__(self)
def __init__(self): self.api_pid_file = os.path.join(MONITOR_ROOT, "frontend.pid.txt") self.api_log_file = os.path.join(MONITOR_ROOT, "frontend.log.txt") self.reserved_routes = ["frontend", "web", "files", "statuses"] self.routes = [ (r"/web/([a-zA-Z0-9\-\._/]+)", self.WebAssetHandler), (r"/files/(.+)", self.FileHandler), (r"/task/", self.TaskHandler)] self.default_on_loads = [ "/web/css/bootstrap.min.css", "/web/js/lib/sockjs.min.js", "/web/js/unveillance.js", "/web/js/conf.js", "/web/js/models/unveillance_messenger.js", "/web/js/lib/bootstrap.min.js" ] self.on_loads_by_status = [[] for i in range(4)] self.restricted_routes_by_status = [[] for i in range(4)] self.restricted_mime_types_by_status = [[] for i in range(4)] self.restrict_source_files = {} self.on_loads = { "main" : [ '/web/css/main.css', '/web/css/visualsearch-datauri.css', '/web/css/visualsearch.css', '/web/css/search.css', '/web/css/messenger_tray.css', '/web/js/lib/visualsearch.js', '/web/js/models/unveillance_search.js', '/web/js/models/unveillance_list.js', '/web/js/models/unveillance_document_list.js', '/web/js/models/unveillance_document.js', '/web/js/models/unveillance_messenger_list.js', '/web/js/modules/main.js' ], "unveil" : [ '/web/css/unveil.css', '/web/css/visualsearch-datauri.css', '/web/css/visualsearch.css', '/web/css/search.css', '/web/js/lib/visualsearch.js', '/web/js/models/unveillance_search.js', '/web/js/models/unveillance_document.js', '/web/js/modules/unveil.js', ], "queue" : [ '/web/css/queue.css', '/web/js/models/unveillance_list.js', '/web/js/models/unveillance_queue_list.js', '/web/js/models/unveillance_queue.js', '/web/js/modules/queue.js' ], "asset" : [ '/web/css/asset.css', '/web/js/models/unveillance_document.js', '/web/js/modules/asset.js' ] } self.get_page_load_extras = { "body_classes" : self.get_browser_from_user_agent } from conf import buildServerURL, SERVER_PORT, SHA1_INDEX from vars import MIME_TYPES, ASSET_TAGS, MIME_TYPE_TASKS, TASK_REQUIREMENTS self.init_vars = { 'SHA1_INDEX' : 32 if not SHA1_INDEX else 40, 'MIME_TYPES' : MIME_TYPES, 'ASSET_TAGS' : ASSET_TAGS, 'MIME_TYPE_TASKS' : MIME_TYPE_TASKS, 'TASK_REQUIREMENTS' : TASK_REQUIREMENTS, 'TASK_POOL' : self.get_task_pool() } UnveillanceAPI.__init__(self)