コード例 #1
0
 def __init__(self, path):
     factors = {}
     self.path = path
     ar = open_rikf_ar(path)
     for line in ar:
         factor = Factor.from_line(line)
         handle = factor.handle
         if handle in factors:
             raise ValueError("factor handle appears " "twice: %s" % (handle,))
         factors[handle] = factor
     self.factors = factors
コード例 #2
0
ファイル: weight.py プロジェクト: spr3nk3ls/koert
	def __init__(self, path, boozedir):
		weights = {}
		self.boozedir = boozedir
		self.path = path
		ar = open_rikf_ar(path)
		for line in ar:
			weight = Weight.from_line(line, boozedir.productdir)
			product = weight.product
			if product in weights:
				raise ValueError("weight of product appears "
					"twice: %s" % (product,))
			weights[product] = weight
			product.weight = weight
		self.weights = weights
コード例 #3
0
 def __init__(self, path, boozedir):
     errors = []
     products = {}
     self.boozedir = boozedir
     self.path = path
     ar = open_rikf_ar(path)
     for line in ar:
         try:
             product = Product.from_line(line, self.boozedir)
         except MildErr as e:
             errors.append(LoadErr("product", line, e))
             continue
         handle = product.handle
         if handle in products:
             errors.append(DoubleErr("product handle", handle))
             continue
         products[handle] = product
     self.products = products
     if len(errors) > 0:
         warn("Errors when loading the product directory: %s" % ManyMildErrs(errors))
コード例 #4
0
ファイル: event.py プロジェクト: spr3nk3ls/koert
	def from_path(cls, path, code, boozedir, board):
		return cls.from_array(open_rikf_ar(path), code, boozedir, board)
コード例 #5
0
ファイル: event.py プロジェクト: spr3nk3ls/koert
	def from_path(cls, path, number, boozedir):
		ar = open_rikf_ar(path)
		return cls.from_array(ar, number, boozedir)
コード例 #6
0
ファイル: event.py プロジェクト: spr3nk3ls/koert
	def _load_btc_from_path(cls, path, boozedir):
		return cls._load_btc_from_array(open_rikf_ar(path), boozedir)