Esempio n. 1
0
from db import *
from pyextdirect.configuration import (create_configuration, expose, LOAD,
    STORE_READ, STORE_CUD, SUBMIT)
from validate import Validator
import os
import shutil
import subliminal
import subprocess
import tempfile



__all__ = ['Base', 'Directories', 'Subliminal']


Base = create_configuration()


class Directories(Base):
    def __init__(self):
        self.session = Session()

    @expose(kind=STORE_CUD)
    def create(self, data):
        results = []
        for record in data:
            directory = Directory(name=record['name'], path=record['path'])
            self.session.add(directory)
            self.session.commit()
            results.append({'id': directory.id, 'name': directory.name, 'path': directory.path})
        return results
Esempio n. 2
0
from babelfish import Language
from configobj import ConfigObj
from datetime import timedelta
from db import *
from pyextdirect.configuration import (create_configuration, expose, LOAD,
                                       STORE_READ, STORE_CUD, SUBMIT)
from validate import Validator
import os
import shutil
import subliminal
import subprocess
import tempfile

__all__ = ['Base', 'Directories', 'Subliminal']

Base = create_configuration()


class Directories(Base):
    def __init__(self):
        self.session = Session()

    @expose(kind=STORE_CUD)
    def create(self, data):
        results = []
        for record in data:
            directory = Directory(name=record['name'], path=record['path'])
            self.session.add(directory)
            self.session.commit()
            results.append({
                'id': directory.id,