Ejemplo n.º 1
0
def _getUrlComponent(component, format):
    conf = instinctual.getConf()
    root = getServerRoot()
    component = conf.get('informer', component)

    if 'html' == format:
        url = "%s/%s" % (root, component)
    else:
        api = getApiFragment()
        url = "%s/%s/%s/%s" % (root, api, format, component)
    return url
Ejemplo n.º 2
0
    def __init__(self):
        conf = instinctual.getConf()
        thirdPartyBin = conf.get('informer', 'dir_third_party_bin')
        uploadDir = conf.get('informer', 'dir_uploads')

        self.pidfile = os.path.join(uploadDir, 'uploader.pid')
        self.frameGlob = os.path.join(uploadDir, '*', 'frame.pkl')
        self.convert = os.path.join(thirdPartyBin, 'convert')
        self.identify = os.path.join(thirdPartyBin, 'identify')

        self.maxWidth  = 1024
        self.maxHeight = 768
        self.identifyRegExp = re.compile(r'\s+(\d+)x(\d+)\s+')

        self.daemon = False
        self.flamePid = None

        for i in range(len(sys.argv)):
            if sys.argv[i] == '-P':
                self.flamePid = sys.argv[i+1]
            elif sys.argv[i] == '-D':
                self.daemon = True
Ejemplo n.º 3
0
def getApiFragment():
    conf = instinctual.getConf()
    return conf.get('informer', 'url_api')
Ejemplo n.º 4
0
def getServerRoot():
    conf = instinctual.getConf()
    return conf.get('informer', 'server')
Ejemplo n.º 5
0
import commands
from pprint import pprint

import instinctual
import instinctual.informer
from instinctual.parser.subject import Subject
from instinctual.parser.event import *
from instinctual.parser.observer import *

from instinctual.informer.frame import Frame, FRAME_UPLOAD
from instinctual.informer.spark import Spark, SparkDuplicateFrame
from instinctual.informer.client import Client, ClientConnectionError
from instinctual.informer.threads import LogfileThread, SchedulerThread, InformerThread

LOG = instinctual.getLogger(__name__)
CONF = instinctual.getConf()

uploadsDir = CONF.get('informer', 'dir_uploads')

def datetimeToSeconds(dt):
    inSeconds = time.mktime(dt.timetuple())
    return inSeconds + float(dt.microsecond) / (1 * 10**6)

# ------------------------------------------------------------------------------
class App(Subject):
    count = 0
    def __init__(self, program):
        Subject.__init__(self)

        self.program = program
        LOG.debug("The App program is: %s" % program)
Ejemplo n.º 6
0
from django.conf.urls.defaults import *

import instinctual
from instinctual import informer
from instinctual.settings import media_path
from instinctual.informer.models import Project
from instinctual.informer import relativeUrl as rel

conf = instinctual.getConf()
root = informer.getServerRoot()

pat_project = "(?P<project_name>[^/]+)"
pat_shot    = "(?P<shot_name>[^/]+)"

url_api = informer.getApiFragment()

url_projects              = rel(informer.getProjectsUrl(format='html'))
url_project_print         = rel(informer.getProjectPrintUrl(pat_project, format='html'))
url_project_shots         = rel(informer.getProjectShotsUrl(pat_project, format='html'))
url_project_shots_alt     = url_projects + pat_project + '/'
url_project_shot          = rel(informer.getProjectShotUrl(pat_project, pat_shot, format='html'))
url_project_shot_notes    = rel(informer.getProjectShotNotesUrl(pat_project, pat_shot, format='html'))
url_project_shot_elements = rel(informer.getProjectShotElementsUrl(pat_project, pat_shot, format='html'))
url_project_shot_renders  = rel(informer.getProjectShotRendersUrl(pat_project, pat_shot, format='html'))

# --------------------
# base patterns:
#
urlpatterns = patterns('',
    (r'^admin/', include('django.contrib.admin.urls')),
    (r'^' + url_api + '/', include('instinctual.informer.urls')),