[NOT A BUG]EG 0.5 Beta 4 Add Event

Found a bug in EventGhost? Report it here.

[NOT A BUG]EG 0.5 Beta 4 Add Event

Postby kgschlosser » Sun Sep 25, 2016 2:49 am

I am not sure where to put this bug. but since there doesn't seem to be any movement on the GitHub i thought this might be a better place to put it.

and then anyone that wants to have the Add Event Dialog working in EG 0.5 Beta 4 can make this change.

there is a coding error in the Add Event Dialog.

It won't even open the dialog.

I have traced the problem to the EventItem.py file

this code below
Code: Select all
def GetArguments(self):
        return self.name


should be this (or a tuple)

Code: Select all
def GetArguments(self):
        return [self.name]


the name parameter is set in NewEvent.py
which is a string.
here in the code below.

Code: Select all
if label is None:
    name = eg.event.string
    needsConfigure = True
    eventItem = document.EventItem.Create(parent, pos, name=name)
    eventItem.Select()


and then when it goes to configure the item in the NewEvent.py file

Code: Select all
if (
    needsConfigure and
    not eg.UndoHandler.Configure(document).Do(item, True)
):


it passes an instance of it's self to the Configure

which calls the GetArguments

Code: Select all
newArgs = ActionThreadFunc(item.GetArguments)()
oldArgs = DeepCopy(newArgs)         


and a string is returned from the GetArguments
and then passed to the Creation of the dialog with a *prefix which turns the string into a tuple and the dialog thinks however many characters the last event had is what it is being passed to it for arguments when it only has ability to handle 2

Code: Select all
dialog = eg.ConfigDialog.Create(item, *oldArgs)
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2087
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA

Re: EG 0.5 Beta 4 Add Event

Postby Sem;colon » Sun Sep 25, 2016 4:03 pm

Hi K,

are you sure you don't use an older version of EventItem.py?
I just had a quick look and I can't reproduce the issue, I guess it has been fixed already.
e.g. in my EventItem.py is
Code: Select all
def GetArguments(self):
        return (self.name, )
Sem;colon
Experienced User
 
Posts: 572
Joined: Sat Feb 18, 2012 10:51 am
Location: Germany

Re: EG 0.5 Beta 4 Add Event

Postby kgschlosser » Mon Sep 26, 2016 12:27 am

ahhhh ok I know what happened.

because of a code inspection and and it thought the returned variable had redundant parenthesis.
If you like the work I have been doing then feel free to Image
User avatar
kgschlosser
Site Admin
 
Posts: 2087
Joined: Fri Jun 05, 2015 5:43 am
Location: Rocky Mountains, Colorado USA


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 3 guests