Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wx._core.PyAssertionError in Class Designer #18

Open
rubdos opened this issue Aug 24, 2015 · 5 comments
Open

wx._core.PyAssertionError in Class Designer #18

rubdos opened this issue Aug 24, 2015 · 5 comments

Comments

@rubdos
Copy link

rubdos commented Aug 24, 2015

Hi,

I'm on dabo git working branch, because I'm affected with bugs #16 en #15.

I'm a newbe to Dabo, but I'm trying to create an invoicing application as I became a self-employed.

I started very basic with sqlite; a table for my clients:

CREATE TABLE "clients" (
    "client_id" INTEGER PRIMARY KEY AUTOINCREMENT,
    "name" TEXT,
    "street" TEXT,
    "city" TEXT,
    "postalcode" TEXT
)

and

CREATE TABLE "invoices" (
    "invoice_id" INTEGER PRIMARY KEY AUTOINCREMENT,
    "date" DATETIME,
    "client_fk" INTEGER
)

Now, I try to use the Class Designer and the Add From Data Environment feature, but after selecting the order of my fields and selecting Column; labels on Left on the Layout Selection, the Class Designer breaks when clicking next with this error:

Traceback (most recent call last):
  File "/home/rsmet/.local/lib/python2.7/site-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/uiwx/dControlMixin.py", line 27, in _onWxHit
    self.raiseEvent(dEvents.Hit, evt, *args, **kwargs)
  File "/home/rsmet/.local/lib/python2.7/site-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/uiwx/dPemMixin.py", line 1084, in raiseEvent
    super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs)
  File "/home/rsmet/.local/lib/python2.7/site-packages/Dabo-0.9.14-py2.7.egg/dabo/lib/eventMixin.py", line 81, in raiseEvent
    bindingFunction(event)
  File "/home/rsmet/.local/lib/python2.7/site-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/dialogs/Wizard.py", line 126, in onNext
    self.CurrentPage += pg.nextPage()
  File "/home/rsmet/.local/lib/python2.7/site-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/dialogs/Wizard.py", line 311, in _setCurrPage
    self._pages[self._currentPage].onEnterPage(direction)
  File "/home/rsmet/src/dabo/ide/wizards/QuickLayoutWizard.py", line 382, in onEnterPage
    cs.setColExpand(True, 1)
  File "/home/rsmet/.local/lib/python2.7/site-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/uiwx/dGridSizer.py", line 178, in setColExpand
    self.AddGrowableCol(colNum, proportion=proportion)
  File "/usr/lib64/python2.7/site-packages/wx-3.0-gtk2/wx/_core.py", line 15364, in AddGrowableCol
    return _core_.FlexGridSizer_AddGrowableCol(*args, **kwargs)
wx._core.PyAssertionError: C++ assertion "!m_cols || idx < (size_t)m_cols" failed at ./src/common/sizer.cpp(1980) in AddGrowableCol(): invalid column index
@EdLeafe
Copy link
Member

EdLeafe commented Aug 25, 2015

Hmmm... I'm not able to reproduce this on my OSX system, so I'm guessing that it's a Gtk issue. Can you modify the dGridSizer script to add some debug information? Just before the line that's causing the error (line 178), try adding:

print "Count:", self.HighCol, "Index:", colNum

Now re-run the Class Designer and follow the same steps as before. This time it should print the debug line before the traceback. Let me know what it prints.

@rubdos
Copy link
Author

rubdos commented Aug 27, 2015

Just checked, also happens with PostgreSQL (I debugged some stuff in sqlite, now I moved to Postgres, because, well, performance and ease of use).

And the output of HighCol is pretty fancy:
Count: -1 Index: 1

Let me know what I can do to help debug this any further. I don't have a good grasp on the code atm., so I won't be of much help. This is probably a two-minute fix for you. If you want to, I can give you temporary database credentials to try against.

@gagabon501
Copy link

Hi. I'm new to Dabo as well and I am on Ubuntu 15.10. I have a similar issue. Actually, I am just following the "TheStep-By-StepGuidetoDaboProgramming" tutorial and I am stuck on this error:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/uiwx/dControlMixin.py", line 27, in _onWxHit
self.raiseEvent(dEvents.Hit, evt, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/uiwx/dPemMixin.py", line 1084, in raiseEvent
super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.14-py2.7.egg/dabo/lib/eventMixin.py", line 81, in raiseEvent
bindingFunction(event)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/dialogs/Wizard.py", line 126, in onNext
self.CurrentPage += pg.nextPage()
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/dialogs/Wizard.py", line 311, in _setCurrPage
self._pages[self._currentPage].onEnterPage(direction)
File "/home/gag0/Documents/Programming/Dabo/dabo-0.9.14/ide/wizards/QuickLayoutWizard.py", line 382, in onEnterPage
cs.setColExpand(True, 1)
File "/usr/local/lib/python2.7/dist-packages/Dabo-0.9.14-py2.7.egg/dabo/ui/uiwx/dGridSizer.py", line 178, in setColExpand
self.AddGrowableCol(colNum, proportion=proportion)
File "/usr/lib/python2.7/dist-packages/wx-3.0-gtk2/wx/_core.py", line 15364, in AddGrowableCol
return core.FlexGridSizer_AddGrowableCol(_args, *_kwargs)
wx._core.PyAssertionError: C++ assertion "!m_cols || idx < (size_t)m_cols" failed at ../src/common/sizer.cpp(1980) in AddGrowableCol(): invalid column index

EdLeafe added a commit that referenced this issue Apr 21, 2016
As reported on GitHub #18

Looks like under Gtk you can't pre-set the exapnd setting of a column,
so this moves that setting until after the grid sizer and grid are
populated.
@EdLeafe
Copy link
Member

EdLeafe commented Apr 21, 2016

OK, it looks like the grid sizer doesn't like having things set on columns that don't exist yet. Strange that the other platforms have no problem with this.

I've pushed a fix to the working branch. Can you try that out and let me know if it fixes the problem?

@gagabon501
Copy link

Wow Ed! Thank you very much! It did solve the issue. I was able to continue. Thank you so much.

EdLeafe added a commit that referenced this issue Jul 18, 2016
As reported on GitHub #18

Looks like under Gtk you can't pre-set the exapnd setting of a column,
so this moves that setting until after the grid sizer and grid are
populated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants