Пример #1
0
	def __init__(self, configFile):
		# attempt to read an existing progress file
		self.fileName = "progress_" + configFile
		data = io.readJSON(self.fileName)
		if data == None:
			data = {}

		# save it
		self.data = data
Пример #2
0
    def __init__(self, configFile):
        try:
            # Read the JSON, set basic attributes
            self.rawJSON = io.readJSON(configFile)
            self.corpusPath = self.rawJSON['corpusPath']

            # Make sure corpus path ends in '/'
            if self.corpusPath[-1] != '/':
                self.corpusPath = self.corpusPath + "/"

            # Process the jobs
            self.jobs = []
            for job in self.rawJSON['jobs']:
                self.jobs.append(Job(job))
        except:
            io.printErrorAndExit("Invalid configuration file.")
Пример #3
0
	def __init__(self, configFile):
		try:
			# Read the JSON, set basic attributes
			self.rawJSON = io.readJSON(configFile)
			self.corpusPath = self.rawJSON['corpusPath']
			
			# Make sure corpus path ends in '/'
			if self.corpusPath[-1] != '/':
				self.corpusPath = self.corpusPath + "/"
			
			# Process the jobs
			self.jobs = []
			for job in self.rawJSON['jobs']:
				self.jobs.append(Job(job))
		except:
			io.printErrorAndExit("Invalid configuration file.")