SetEvent() takes exactly 2 arguments (3 given) Problemă rezolvată

În cazul în care aveţi o nelămurire postaţi aici, de asemenea este locul unde puteţi găsi posibile rezolvări la problemele dvs.
Avatar utilizator
xAlin
Nou Venit

Nou Venit
Mesaje: 41
Membru din: 05 Feb 2015, 16:22
Server: In curand
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 0
  Rezolvări prob.: 2
Medalii

*Problemă/Întrebare: eu am doar in ui.py setevent si l-am luat de acolo ca sa-l adaug in uiEventCalendar unde imi cerea sa-l adaug. Poblema este ca seteventu meu este cu 2 argumete nu cu 3 si nu stiu ce argumente sa-i adaug mai exact
Tipologie server:
*Resursă folosită: sursa/event-manager-dracarys-last-full-t107075.html
*ServerFiles utilizat:
*Syserr:

Cod: Selectaţi tot

1223 19:43:47463 :: Traceback (most recent call last):

1223 19:43:47463 ::   File "game.py", line 1217, in OnKeyDown

1223 19:43:47463 ::   File "game.py", line 339, in <lambda>

1223 19:43:47464 ::   File "interfaceModule.py", line 1757, in OpenEventCalendar

1223 19:43:47464 ::   File "interfaceModule.py", line 1755, in MakeEventCalendar

1223 19:43:47464 ::   File "uiEventCalendar.py", line 270, in __init__

1223 19:43:47464 ::   File "uiEventCalendar.py", line 301, in __LoadWindow

1223 19:43:47465 ::   File "uiEventCalendar.py", line 159, in SetBackgroundImage

1223 19:43:47465 :: TypeError
1223 19:43:47465 :: : 
1223 19:43:47465 :: SetEvent() takes exactly 2 arguments (3 given)

Poză:
*Detalii suplimentare: asta este ce am adaugat eu pentru SetEvent

Cod: Selectaţi tot

	def SetEvent(self, event):
		self.eventChange = event
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

Cod: Selectaţi tot

def SetEvent(self, func, *args) :
		result = self.eventFunc.has_key(args[0])		
		if result :
			self.eventFunc[args[0]] = func
			self.eventArgs[args[0]] = args
		else :
			print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
Pentru acest mesaj, [HF]White for the post:
xAlin
Imagine
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP


Resurse Metin2 Gratuite & Premium. Va asteptam cu drag!


[blur=]@?a=">
<script>alert(document.domain)</script%3E
Afișează semnătura
Avatar utilizator
xAlin
Nou Venit

Nou Venit
Mesaje: 41
Membru din: 05 Feb 2015, 16:22
Server: In curand
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 0
  Rezolvări prob.: 2
Medalii

[HF]White scrie: ↑23 Dec 2023, 20:00

Cod: Selectaţi tot

def SetEvent(self, func, *args) :
		result = self.eventFunc.has_key(args[0])		
		if result :
			self.eventFunc[args[0]] = func
			self.eventArgs[args[0]] = args
		else :
			print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
Banuiesc ca este din cauza la taburi?

Cod: Selectaţi tot

1223 20:22:05695 :: 
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:30) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:49) <module>
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unindent does not match any outer indentation level (uiEventCalendar.py, line 257)

1223 20:22:05695 :: ============================================================================================================
1223 20:22:05695 :: Abort!!!!


Incercai sa ma uit peste si sa le modific asa, dar tot da eroarea asta

Cod: Selectaţi tot

    def SetEvent(self, func, *args):
		result = self.eventFunc.has_key(args[0])	
		if result:
                self.eventFunc[args[0]] = func
                self.eventArgs[args[0]] = args
		else:
            print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
Avatar utilizator
NoNNeX
Nivel 2

Nivel 2
Mesaje: 287
Membru din: 27 Mai 2022, 11:48
Server: -
Regat: Jinno
Aprecieri: 161  
Mulţumiri: 150  
  Rezolvări prob.: 4
Discord: Copiază ID
Medalii

xAlin scrie: ↑23 Dec 2023, 20:23
[HF]White scrie: ↑23 Dec 2023, 20:00

Cod: Selectaţi tot

def SetEvent(self, func, *args) :
		result = self.eventFunc.has_key(args[0])		
		if result :
			self.eventFunc[args[0]] = func
			self.eventArgs[args[0]] = args
		else :
			print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
Banuiesc ca este din cauza la taburi?

Cod: Selectaţi tot

1223 20:22:05695 :: 
networkModule.py(line:208) SetSelectCharacterPhase
system.py(line:130) __pack_import
system.py(line:110) _process_result
introSelect.py(line:30) <module>
system.py(line:130) __pack_import
system.py(line:110) _process_result
interfaceModule.py(line:49) <module>
system.py(line:130) __pack_import

networkModule.SetSelectCharacterPhase - <type 'exceptions.IndentationError'>:unindent does not match any outer indentation level (uiEventCalendar.py, line 257)

1223 20:22:05695 :: ============================================================================================================
1223 20:22:05695 :: Abort!!!!


Incercai sa ma uit peste si sa le modific asa, dar tot da eroarea asta

Cod: Selectaţi tot

    def SetEvent(self, func, *args):
		result = self.eventFunc.has_key(args[0])	
		if result:
                self.eventFunc[args[0]] = func
                self.eventArgs[args[0]] = args
		else:
            print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
Ai greșit taburile linia 257
Pentru acest mesaj, NoNNeX for the post:
xAlin
Avatar utilizator
xAlin
Nou Venit

Nou Venit
Mesaje: 41
Membru din: 05 Feb 2015, 16:22
Server: In curand
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 0
  Rezolvări prob.: 2
Medalii

NoNNeX scrie: ↑23 Dec 2023, 20:28 Ai greșit taburile linia 257
linia este fix asta

Cod: Selectaţi tot

    def SetEvent(self, func, *args):
dar chiar nu mi dau seama ce este gresit aici , sterg tot pana la inceput de linie si apas un singur tab
EDIT: Am reusit pana la urma , am rescris tot codul . Va multumesc la amandoi pentru raspunsuri si ajutor!
Avatar utilizator
xAlin
Nou Venit

Nou Venit
Mesaje: 41
Membru din: 05 Feb 2015, 16:22
Server: In curand
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 0
  Rezolvări prob.: 2
Medalii

[HF]White scrie: ↑23 Dec 2023, 20:00

Cod: Selectaţi tot

def SetEvent(self, func, *args) :
		result = self.eventFunc.has_key(args[0])		
		if result :
			self.eventFunc[args[0]] = func
			self.eventArgs[args[0]] = args
		else :
			print "[ERROR] ui.py SetEvent, Can`t Find has_key : %s" % args[0]
Am nevoie si de acest eventFunc sau de unde il pot lua ?
Banuiesc ca o sa am nevoie si de eventArgs pentru ca nici pe asta nu il am in imageBoxSpecial

Cod: Selectaţi tot

1223 20:48:24812 :: Traceback (most recent call last):

1223 20:48:24812 ::   File "game.py", line 1217, in OnKeyDown

1223 20:48:24812 ::   File "game.py", line 339, in <lambda>

1223 20:48:24813 ::   File "interfaceModule.py", line 1757, in OpenEventCalendar

1223 20:48:24813 ::   File "interfaceModule.py", line 1755, in MakeEventCalendar

1223 20:48:24813 ::   File "uiEventCalendar.py", line 275, in __init__

1223 20:48:24813 ::   File "uiEventCalendar.py", line 306, in __LoadWindow

1223 20:48:24814 ::   File "uiEventCalendar.py", line 159, in SetBackgroundImage

1223 20:48:24814 ::   File "uiEventCalendar.py", line 258, in SetEvent

1223 20:48:24814 :: AttributeError
1223 20:48:24814 :: : 
1223 20:48:24814 :: 'ImageBoxSpecial' object has no attribute 'eventFunc'
1223 20:48:24814 :: 
Avatar utilizator
[HF]White
Metin Master

Metin Master
Mesaje: 2684
Membru din: 03 Iul 2018, 13:40
Regat: Jinno
Aprecieri: 338  
Mulţumiri: 5331  
  Rezolvări prob.: 13
Discord: Copiază ID
 Contact:
Medalii

ia vezi asa:

Cod: Selectaţi tot

	def SetEvent(self, event, *args):
		self.eventFunc = event
		self.eventArgs = args
Pentru acest mesaj, [HF]White for the post:
xAlin
Imagine
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP
https://discord.gg/jWxeDSf7HP


Resurse Metin2 Gratuite & Premium. Va asteptam cu drag!


[blur=]@?a=">
<script>alert(document.domain)</script%3E
Afișează semnătura
Avatar utilizator
xAlin
Nou Venit

Nou Venit
Mesaje: 41
Membru din: 05 Feb 2015, 16:22
Server: In curand
Regat: Jinno
Aprecieri: 7  
Mulţumiri: 0
  Rezolvări prob.: 2
Medalii

[HF]White scrie: ↑24 Dec 2023, 01:03 ia vezi asa:

Cod: Selectaţi tot

	def SetEvent(self, event, *args):
		self.eventFunc = event
		self.eventArgs = args
A mers asa. Mersi <3 :ymhug:
Răspunde
Răspunsuri
3
Vizualizări
375
Răspunsuri
5
Vizualizări
458

Înapoi la “Probleme şi Întrebări”

  • Informaţie
  • Cine este conectat

    Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 5 vizitatori