Esempio n. 1
0
def read_body(header, raw, curline):
	product = raw[header['product']]
	field = raw[header['field']]
	# n_tri
	n_tris = raw[header['n_tri']].split(lib.tsep)
	tris = []
	for str_tri in n_tris:
		raw_tri = str_tri.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = int(raw_tri[0])
		newpack.when = int(raw_tri[1])
		tris.append(newpack)
	if not n_tri.has_key(field):
		n_tri[field] = {}
	n_tri[field][product] = tris
	# n_cor_tri
	n_tris = raw[header['n_cor_tri']].split(lib.tsep)
	tris = []
	for str_tri in n_tris:
		raw_tri = str_tri.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = int(raw_tri[0])
		newpack.when = int(raw_tri[1])
		tris.append(newpack)
	if not n_cor_tri.has_key(field):
		n_cor_tri[field] = {}
	n_cor_tri[field][product] = tris
Esempio n. 2
0
def read_contact_info(header, raw, curline):
	global con_num, con_exp
	login = raw[header['login']]
	
	# number
	raw_nums = raw[header['contacter_num']].split(lib.tsep)
	num_packs = []
	for raw_num in raw_nums:
		if raw_num == '':
			continue
		raw_pack = raw_num.split(lib.fsep)
		num = int(raw_pack[0])
		time = int(raw_pack[1])
		newpack = lib.infopack()
		newpack.data = num
		newpack.when = time
		num_packs.append(newpack)
	con_num[login] = num_packs

	# exp
	raw_exps = raw[header['max_contecter_exp']].split(lib.tsep)
	exp_packs = []
	for raw_exp in raw_exps:
		if raw_exp == '':
			continue
		raw_pack = raw_exp.split(lib.fsep)
		exp = int(raw_pack[0])
		time = int(raw_pack[1])
		newpack = lib.infopack()
		newpack.data = exp
		newpack.when = time
		exp_packs.append(newpack)
	con_exp[login] = exp_packs
Esempio n. 3
0
def read_login_comment_number(header, raw, curline):
	global login_cmt
	login = raw[header['login']]
	raw_cmt = raw[header['cmt_num']].split(lib.tsep)
	cmt_num = []
	for str_num in raw_cmt:
		raw_num = str_num.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = int(raw_num[0])
		newpack.when = int(raw_num[1])
		cmt_num.append(newpack)
	login_cmt[login] = cmt_num
Esempio n. 4
0
def read_body(header, raw, curline):
	who = raw[header['who']]
	exps = raw[header['exp']].split(lib.tsep)
	explist = []
	for str_exp in exps:
		if str_exp == '':
			break
		raw_exp = str_exp.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = int(raw_exp[0])
		newpack.when = int(raw_exp[1])
		explist.append(newpack)
	login_exp[who] = explist
Esempio n. 5
0
def read_role_body(header, raw, curline):
	login = raw[header['who']]
	raw_role = raw[header['role']].split(lib.tsep)
	roles = []
	for str_role in raw_role:
		if str_role == '':
			break
		raw_role = str_role.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = raw_role[1]
		newpack.when = int(raw_role[0])
		roles.append(newpack)
	rolepacks[login] = roles
Esempio n. 6
0
def read_body(header, raw, curline):
	login = raw[header['login']]
	# n_assi
	n_assis = raw[header['n_assi']].split(lib.tsep)
	assis = []
	for str_assi in n_assis:
		raw_assi = str_assi.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = int(raw_assi[0])
		newpack.when = int(raw_assi[1])
		assis.append(newpack)
	n_assi[login] = assis
	# n_cor_assi
	n_assis = raw[header['n_cor_assi']].split(lib.tsep)
	assis = []
	for str_assi in n_assis:
		if str_assi == '':
			break
		raw_assi = str_assi.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = int(raw_assi[0])
		newpack.when = int(raw_assi[1])
		assis.append(newpack)
	n_cor_assi[login] = assis
Esempio n. 7
0
def read_body(header, raw, curline):
	login = raw[header['login']]
	product = raw[header['product']]
	type = raw[header['type']]

	raw_nums = raw[header['num']].split(lib.tsep)
	nums = []
	for str_num in raw_nums:
		raw_num = str_num.split(lib.fsep)
		newpack = lib.infopack()
		newpack.data = int(raw_num[0])
		newpack.when = int(raw_num[1])
		nums.append(newpack)
	if type == 'prdAssi':
		if not logPrdAssi.has_key(login):
			logPrdAssi[login] = {}
		logPrdAssi[login][product] = nums
	elif type == 'prdNotAssi':
		if not logPrdNotAssi.has_key(login):
			logPrdNotAssi[login] = {}
		logPrdNotAssi[login][product] = nums
Esempio n. 8
0
def read_activity_level2_body(header, raw, curline):
    global seenTarget
    global actList

    bugID = raw[header['bug_id']]
    if bugID != targetID:
        # if seen target and it is not target now, skip the rest
        if seenTarget:
            return -1
        else:
            return 0
    seenTarget = True

    field = raw[header['what']].lower()
    if curDict.has_key(field):
        # create new pack
        newPack = lib.infopack()
        newPack.time = int(raw[header['when']])
        newPack.field = field
        newPack.data = raw[header['new']]
        newPack.who = raw[header['who']]
        actList.append(newPack)
Esempio n. 9
0
def read_activity_level2_body(header, raw, curline):
	global seenTarget
	global actList

	bugID = raw[header['bug_id']]
	if bugID != targetID:
		# if seen target and it is not target now, skip the rest
		if seenTarget:
			return -1
		else:
			return 0
	seenTarget = True

	field = raw[header['what']].lower()
	if curDict.has_key(field):
		# create new pack
		newPack = lib.infopack()
		newPack.time = int(raw[header['when']])
		newPack.field = field
		newPack.data = raw[header['new']]
		newPack.who = raw[header['who']]
		actList.append(newPack)