from data import * from request import CurrentRequests, SSHRequest from SimpleXMLRPCServer import * from SecureXMLRPCServer import SecureXMLRPCServer import socket, os, sys, xmlrpclib, time, optparse, os.path import traceback as tb import subprocess as sp from threading import RLock from myprint import * # handles the printing or logging opj = os.path.join sys.path.append( opj(os.environ["SAGE_DIRECTORY"], "bin" ) ) from sagePath import getUserPath, SAGE_DIR, getPath, getDefaultPath APP_CONFIG_FILE = getPath("applications", "applications.conf") print "AppConfigFile: ", APP_CONFIG_FILE TILE_CONFIG_FILE = None XMLRPC_PORT = 19010 SECURE_XMLRPC_PORT = XMLRPC_PORT+1 SAGE_SERVER_PORT = 8009 # sage server port for reporting to SAGE_SERVER = "localhost" #"sage.sl.startap.net" STOP_LAUNCHER = False #used for stopping the applauncher remotely DO_REPORT = True # for determining whether to report to the sage server or not REPORT_NAME = socket.gethostname() DEFAULT_SYSTEM_IP = None # for application pixel streaming DEFAULT_SYSTEM_PORT = None # change to the directory of this script os.chdir(sys.path[0])
result = config.getint(section, key) else: result = config.get(section, key) return result # shortcut opj = os.path.join sys.path.append( opj(os.environ["SAGE_DIRECTORY"], "bin" ) ) from sagePath import getUserPath, SAGE_DIR, getPath # commonly used paths SAVED_STATES_DIR = getUserPath("saved-states") FS_CONFIG_FILE = getPath("fsManager.conf") FILE_SERVER_PORT = "8800" # play sounds or not... CAN_PLAY_SOUND = False # types of overlay plugins UI_PLUGIN = 0 # contains multiple widgets... WIDGET_PLUGIN = 1 # a single widget, loaded automatically or through UI_PLUGIN # configuration file for DIM DIM_CONFIG = getPath("dim.conf")
# miscellaneous stuff (3rd party supporting tools) sys.path.append("misc") #so that we can import packages from "misc" folder from imsize import imagesize # reads the image header and gets the size from it import mmpython import countPDFpages # a shortcut opj = os.path.join # for loading the sagePath helper file sys.path.append(opj(os.environ["SAGE_DIRECTORY"], "bin")) from sagePath import getUserPath, getPath ## some globals defining the environment SCRIPT_PATH = sys.path[0] CONFIG_FILE = getPath("fileServer", "fileServer.conf") CACHE_DIR = getUserPath("fileServer", "file_server_cache") FILES_DIR = opj(SCRIPT_PATH, "file_library") REDIRECT = False THUMB_DIR = opj(FILES_DIR, "thumbnails") RUN_SERVER = True ## holds information about the types that we support (read from the config file) dirHash = {} viewers = {} types = {} def ParseConfigFile(): global FILES_DIR global THUMB_DIR
sys.path.append("misc") #so that we can import packages from "misc" folder from imsize import imagesize # reads the image header and gets the size from it import mmpython import countPDFpages # a shortcut opj = os.path.join # for loading the sagePath helper file sys.path.append( opj(os.environ["SAGE_DIRECTORY"], "bin" ) ) from sagePath import getUserPath, getPath ## some globals defining the environment SCRIPT_PATH = sys.path[0] CONFIG_FILE = getPath("fileServer", "fileServer.conf") CACHE_DIR = getUserPath("fileServer", "file_server_cache") FILES_DIR = opj(SCRIPT_PATH, "file_library") REDIRECT = False THUMB_DIR = opj(FILES_DIR, "thumbnails") RUN_SERVER = True ## holds information about the types that we support (read from the config file) dirHash = {} viewers = {} types = {} def ParseConfigFile(): global FILES_DIR global THUMB_DIR