Exemple #1
0
	def __on_click(self,widget,data=None):
		if data=='new':
			if len(self.num.get_text())!=0:
				ic=len(self.lst)
				ic +=1
				if ic>20:
					return False
				glu.setKey('Group Num '+str(ic),self.num.get_text())
				glu.setKey('Group Text '+str(ic),self.mes.get_text())
				self.__refresh()			
			pass
		if data=='del':
			pass
		if data=='sendcale':
			selscale=sysfrm.SelectScale()
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,20):
							if glu.testKey('Group Text '+str(i)):
								tigerlib.setCommodityGroups_210(int(glu.getKey('Group Num '+str(i))),glu.getKey('Group Text '+str(i)),int(glu.getKey('Group Num '+str(i))),modesocket=tigerlib.MULTIOPERATION)
								#time.sleep(1)
						tigerlib.closesocket()
			pass
		if data=='resivescale':
			selscale=sysfrm.SelectScale(1)
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False	
			
			self.__clear_text()
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,20):
							try :
								num,txt,root_group=tigerlib.getCommodityGroups_210(i,tigerlib.MULTIOPERATION)
								glu.setKey('Group Num '+str(i),num)
								glu.setKey('Group Text '+str(i),txt)
							except Exception,ecx :
								print 'поймали ',ecx
								continue
								#time.sleep(1)
						tigerlib.closesocket()
			self.__refresh()			
			pass
Exemple #2
0
	def __on_click(self,widget,data=None):
		if data=='resivescale':
			selscale=sysfrm.SelectScale(1)
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False	
			
			self.__clear_text()
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,99):
							try :
								num,txt=tigerlib.getSellers_204(i,modesocket=tigerlib.MULTIOPERATION)
								glu.setKey('Pers Num '+str(num),num)
								glu.setKey('Pers Text '+str(num),txt)
							except Exception,ecx :
								print 'поймали ',ecx
								continue
							#time.sleep(1)
						tigerlib.closesocket()
			self.__refresh()
Exemple #3
0
class SetPerson(gtk.Frame):
	'''
	   Продавцы
	'''
	def __clear_text(self):
		for i in xrange(1,99):
			if glu.testKey('Pers Num '+str(i)):
				glu.delKey('Pers Num '+str(i))
				glu.delKey('Pers Text '+str(i))
				
	def __on_click(self,widget,data=None):
		if data=='resivescale':
			selscale=sysfrm.SelectScale(1)
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False	
			
			self.__clear_text()
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,99):
							try :
								num,txt=tigerlib.getSellers_204(i,modesocket=tigerlib.MULTIOPERATION)
								glu.setKey('Pers Num '+str(num),num)
								glu.setKey('Pers Text '+str(num),txt)
							except Exception,ecx :
								print 'поймали ',ecx
								continue
							#time.sleep(1)
						tigerlib.closesocket()
			self.__refresh()
			
		if data=='sendcale':
			selscale=sysfrm.SelectScale()
			selscale.run()
			if selscale.ok_flg :
				selscale.destroy()
			else :
				selscale.destroy()
				return False	
			for ci in xrange(glu.getKey('Count Scale')):
				if glu.testKey('Exchange scale '+str(ci+1)):
					if glu.getKey('Exchange scale '+str(ci+1)):
						tigerlib.address=glu.getKey('IP '+str(ci+1))
						tigerlib.opensocket()
						for i in xrange(1,99):
							if glu.testKey('Pers Text '+str(i)):
								tigerlib.setSellers_204(int(glu.getKey('Pers Num '+str(i))),glu.getKey('Pers Text '+str(i)),modesocket=tigerlib.MULTIOPERATION)
								#time.sleep(1)
						tigerlib.closesocket()			
			
		if data=='new'	:
			if len(self.num.get_text())!=0:
				ic=len(self.lst)
				ic +=1
				glu.setKey('Pers Num '+str(ic),self.num.get_text())
				glu.setKey('Pers Text '+str(ic),self.mes.get_text())
				self.__refresh()
		if data=='del':
			if len(self.num.get_text())!=0:
				glu.delKey('Pers Num '+self.num.get_text())
				glu.delKey('Pers Text '+self.num.get_text())
				self.num.set_text('')
				self.mes.set_text('')
				self.__refresh()			
			pass