示例#1
0
    def __init__(self):
        #Arguments for logging
        args = sys.argv[1:]
        otherargs = logging_startup(args)  # otherargs has commandspecific args
        logging.debug('hello from sync.py')

        confdir = findconffolder()
        conf = ConfigParser.ConfigParser()
        conf.read(join(confdir, 'config'))

        url = conf.get('resources', 'url')

        restful_factory = RestfulFactory(url)

        self.SimplifiedSubject = restful_factory.make(
            "/examiner/restfulsimplifiedsubject/")
        self.SimplifiedPeriod = restful_factory.make(
            "/examiner/restfulsimplifiedperiod/")
        self.SimplifiedAssignment = restful_factory.make(
            "/examiner/restfulsimplifiedassignment/")
        self.SimplifiedAssignmentGroup = restful_factory.make(
            "/examiner/restfulsimplifiedassignmentgroup/")
        self.SimplifiedDelivery = restful_factory.make(
            "/examiner/restfulsimplifieddelivery/")
        self.SimplifiedDeadline = restful_factory.make(
            "/examiner/restfulsimplifieddeadline/")
        self.SimplifiedStaticFeedback = restful_factory.make(
            "/examiner/restfulsimplifiedstaticfeedback/")
        self.SimplifiedFileMeta = restful_factory.make(
            "/examiner/restfulsimplifiedfilemeta/")

        self.root_dir = dirname(confdir) + sep
        self.metadata = {}
示例#2
0
    def __init__(self):
        #Arguments for logging
        args = sys.argv[1:]
        otherargs = logging_startup(args)  # otherargs has commandspecific args
        logging.debug('hello from sync.py')

        confdir = findconffolder()
        conf = ConfigParser.ConfigParser()
        conf.read(join(confdir, 'config'))

        url = conf.get('resources', 'url')

        restful_factory = RestfulFactory(url)

        self.SimplifiedSubject = restful_factory.make("/examiner/restfulsimplifiedsubject/")
        self.SimplifiedPeriod = restful_factory.make("/examiner/restfulsimplifiedperiod/")
        self.SimplifiedAssignment = restful_factory.make("/examiner/restfulsimplifiedassignment/")
        self.SimplifiedAssignmentGroup = restful_factory.make("/examiner/restfulsimplifiedassignmentgroup/")
        self.SimplifiedDelivery = restful_factory.make("/examiner/restfulsimplifieddelivery/")
        self.SimplifiedDeadline = restful_factory.make("/examiner/restfulsimplifieddeadline/")
        self.SimplifiedStaticFeedback = restful_factory.make("/examiner/restfulsimplifiedstaticfeedback/")
        self.SimplifiedFileMeta = restful_factory.make("/examiner/restfulsimplifiedfilemeta/")

        self.root_dir = dirname(confdir) + sep
        self.metadata = {}
示例#3
0
#!/usr/bin/env python

import sys
import os
import logging
import ConfigParser
from os.path import join
from devilryclient.utils import logging_startup

args = sys.argv[1:]
otherargs = logging_startup(args)  # otherargs has commandspecific args

if len(otherargs) < 2:
    logging.warning('Not enough input arguments!')
    logging.warning('Usage: init url filename')
    sys.exit(0)

url = otherargs[0]
#TODO check that url is gyldig devilry url

name = otherargs[1]

Config = ConfigParser.ConfigParser()

dirpath = join(os.getcwd(), name)
devdirpath = join(dirpath, '.devilry')
try:
    os.mkdir(dirpath)
    os.mkdir(devdirpath)
    cfgfile = open(join(devdirpath, 'config'), 'w')
except OSError:
示例#4
0
#!/usr/bin/env python

import sys
import os
import logging
import ConfigParser
from os.path import join
from devilryclient.utils import logging_startup

args = sys.argv[1:]
otherargs = logging_startup(args) # otherargs has commandspecific args

if len(otherargs) < 2:
    logging.warning('Not enough input arguments!')
    logging.warning('Usage: init url filename')
    sys.exit(0)

url = otherargs[0]
#TODO check that url is gyldig devilry url

name = otherargs[1]

Config = ConfigParser.ConfigParser()

dirpath = join(os.getcwd(), name)
devdirpath = join(dirpath, '.devilry')
try:
    os.mkdir(dirpath)
    os.mkdir(devdirpath)
    cfgfile = open(join(devdirpath, 'config'), 'w')
except OSError: