Exemplo n.º 1
0
	def __init__(self, name):
		self.sysop = ''
		self.aka = ufido.address()
		self.baud = 0
		self.requestlist = ''
		self.responselist = ''
		self.remotestatus = ''
		self.systemstatus = ''
		self.site = ''
		self.callerid = ''
		self.password = ''
		self.read(name)
Exemplo n.º 2
0
	def __init__(self, name):
		self.dir_list_file = ''
		self.send_report = 0
		self.limit_size_day = 0
		self.limit_size_week = 0
		self.limit_size_month = 0
		self.spool_dir = ''
		self.freq_policy = ''
		self.freq_alias = []
		self.freq_magic = []
		self.log_file = ''
		self.local_address = ufido.address()
		self.report_header = ''
		self.report_footer = ''
		self.report_from = 'FREQ manager'
		self.report_subj = 'FREQ report'
		self.stat_dbase = None
		self.read(name)
Exemplo n.º 3
0
		# Get total statistic
		self.stat_total_size = entry[3][0]
		self.stat_total_num = entry[3][1]
		self.stat_total_time = entry[3][2]
		db.close()
		return 0
	
	def put_stat(self):
		db = gdbm.open(self.dbpath, 'cf')
		# Don't handle exceptions
		entry = [[self.month_id, self.stat_month_size, self.stat_month_num, self.stat_month_time],
			[self.week_id, self.stat_week_size, self.stat_week_num, self.stat_week_time],
			[self.day_id, self.stat_day_size, self.stat_day_num, self.stat_day_time],
			[self.stat_total_size, self.stat_total_num, self.stat_total_time]]
		db[self.key] = repr(entry)
		db.close()
		return 0

if __name__ == '__main__':
	addr = ufido.address()
	addr.parse('2:5020/2120')
	ns = nodestat('./tmp.db', addr)
	ns.upd_stat(2, 32768)
	ns.put_stat()
	addr2 = ufido.address()
	addr2.parse('2:5020/2120')
	ns2 = nodestat('./tmp.db', addr2)
	ns2.get_stat()
	print ns2.stat_total_num, ns2.stat_total_size

Exemplo n.º 4
0
            self.stat_month_time
        ],
                 [
                     self.week_id, self.stat_week_size, self.stat_week_num,
                     self.stat_week_time
                 ],
                 [
                     self.day_id, self.stat_day_size, self.stat_day_num,
                     self.stat_day_time
                 ],
                 [
                     self.stat_total_size, self.stat_total_num,
                     self.stat_total_time
                 ]]
        db[self.key] = repr(entry)
        db.close()
        return 0


if __name__ == '__main__':
    addr = ufido.address()
    addr.parse('2:5020/2120')
    ns = nodestat('./tmp.db', addr)
    ns.upd_stat(2, 32768)
    ns.put_stat()
    addr2 = ufido.address()
    addr2.parse('2:5020/2120')
    ns2 = nodestat('./tmp.db', addr2)
    ns2.get_stat()
    print ns2.stat_total_num, ns2.stat_total_size