def __init__(self):
        # load template and base data
        self.userinfo = modUserInfo.modUserInfo()
        self.userinfo.loadbaseinfo(4)
        self.userinfo.loadtemplate()

        # get begin date
        begin_date = datetime.date(
            int(self.userinfo.begin_year), int(self.userinfo.begin_month), int(self.userinfo.begin_day)
        )
        self.delta = datetime.timedelta(days=7)
        self.now = begin_date
        # nowarr=str(now).split('-')
        self.next = self.now + self.delta
        # nextarr=str(next).split('-')

        # init some value
        self.flag = False

        # made 2*2 matrix array to sort
        self.arr = modPublic.sarray()
        for i in range(100):
            for j in range(100):
                self.arr.teamA[i][j] = ""
                self.arr.teamB[i][j] = ""
                self.arr.black[i][j] = False
                self.arr.isOver[i][j] = False

                # load template and set team name to template
        self.loadtemplate(str(self.userinfo.count), str(self.userinfo.team_count))

        # export excel
        self.export_excel()
	def __init__(self):
		#load template and base data
		self.userinfo=modUserInfo.modUserInfo()
		self.userinfo.loadbaseinfo(3)
		self.userinfo.loadtemplate()

		#get begin date
		begin_date = datetime.date(int(self.userinfo.begin_year),int(self.userinfo.begin_month),int(self.userinfo.begin_day))
		delta = datetime.timedelta(days=7)
		now=begin_date
		#nowarr=str(now).split('-')
		next=now+delta
		#nextarr=str(next).split('-')

		#init some value
		self.flag=False

		#made 2*2 matrix array to sort
		self.arr=modPublic.sarray()
		for i in range(100):
			for j in range(100):
				self.arr.teamA[i][j]=""
				self.arr.teamB[i][j]=""
				self.arr.black[i][j]=False
				self.arr.isOver[i][j]=False
		
		#sort game
		k=0	#field number
		d=0	#day numer
		n=0	#round number
		for i in range(self.userinfo.team_count):
			for j in range(self.userinfo.team_count):
				if i<j:
					self.userinfo.field[0].date[d]=now
					self.arr.teamA[i][j]=self.userinfo.team[i].name
					self.arr.teamB[i][j]=self.userinfo.team[j].name
					
					#round first
					if n<self.userinfo.count:
						n+=1	#if round is not use end, then use other round to start contest.
					else:
						n=0		#if all field and all round is full, then user other days.
						d+=1
						now=next	#update date information
						next=next+delta	
						
					print i,j
					print str(d)+" "+str(n)
					print self.userinfo.field[0].date[d]
					print self.userinfo.team[i].name + " VS " + self.userinfo.team[j].name
		
		
		#d is need skip.#
		self.maxd=d+1
		
		#enum array
		self.enumarray_main()
		
		#export excel
		self.export_excel()
	def enumarray_main(self):
		#make array
		self.arr=modPublic.sarray()
		for i in range(100):
			for j in range(100):
				self.arr.teamA[i][j]=""
				self.arr.teamB[i][j]=""
				self.arr.black[i][j]=False
				self.arr.isOver[i][j]=False
		
		self.enumarray_sub()
		self.arr.isOver[0][0]=True