Re: [dabo-users] Opening a database from the Dabo Class Designer
On Wed, Oct 01, 2008 at 04:01:59PM -0500, Ed Leafe wrote: On Oct 1, 2008, at 3:56 PM, Chris G wrote: Now I need to connect to a database and I'm a bit stuck. In Linux do I need to create a cnxml file myself? That's not too bad, I've copied the sample.cnxml file and have put my own parameters in it but it doesn't work (yet), I'm not really an XML guru though so I there's certainly things wrong. Yes, you need to create the .cnxml file outside of the Class Designer, but you don't have to do it by hand. Instead, use the CxnEditor.py application in your ide directory. Ah, that's a bit easier! :-) However I can't seem to get a connection to my database. I've created the database called isbd in mysql as user 'chris' (who has admin rights in mysql). I've entered the host, database name, user (chris) and password in CxnEditor.py and it just says Unable to make connection when I click on Test. How do I debug this? -- Chris Green ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] Opening a database from the Dabo Class Designer
On Oct 2, 2008, at 3:29 AM, Chris G wrote: Ah, that's a bit easier! :-) I thought that it might be. However I can't seem to get a connection to my database. I've created the database called isbd in mysql as user 'chris' (who has admin rights in mysql). I've entered the host, database name, user (chris) and password in CxnEditor.py and it just says Unable to make connection when I click on Test. How do I debug this? We just had this problem last week, and it was because the MySQLdb module was not installed. If you open up a terminal and start a Python session, do you get an error if you type: import MySQLdb -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
[dabo-users] dApp.DatabaseActivityLog and non-ASCII database content
Hello, this doesn't really look well: Dabo application using SQLite database. Main program: if __name__ == __main__: app = dabo.dApp() app.MainFormClass = FrmTest app.setup() app.DatabaseActivityLog = sys.stdout app.start() Editing an existing record by entering text with non-ASCII characters into a varchar field and trying to save it results in this traceback: Dabo Error Log: Thu Oct 2 17:45:08 2008: Error in scanChangedRows: 'ascii' codec can't encode character u'\xfc' in position 117: ordinal not in range(128) Traceback (most recent call last): File /usr/lib/python2.5/site-packages/Dabo-0.8.4-py2.5.egg/dabo/ui/uiwx/dControlMixin.py, line 27, in _onWxHit self.raiseEvent(dEvents.Hit, evt, *args, **kwargs) File /usr/lib/python2.5/site-packages/Dabo-0.8.4-py2.5.egg/dabo/ui/uiwx/dPemMixin.py, line 928, in raiseEvent super(dPemMixin, self).raiseEvent(eventClass, nativeEvent, *args, **kwargs) File /usr/lib/python2.5/site-packages/Dabo-0.8.4-py2.5.egg/dabo/lib/eventMixin.py, line 92, in raiseEvent bindingFunction(event) File /usr/lib/python2.5/site-packages/Dabo-0.8.4-py2.5.egg/dabo/ui/uiwx/dForm.py, line 682, in onSave def onSave(self, evt): self.save() File /usr/lib/python2.5/site-packages/Dabo-0.8.4-py2.5.egg/dabo/ui/uiwx/dForm.py, line 355, in save bizobj.saveAll() File /usr/lib/python2.5/site-packages/Dabo-0.8.4-py2.5.egg/dabo/biz/dBizobj.py, line 337, in saveAll startTransaction=False) File /usr/lib/python2.5/site-packages/Dabo-0.8.4-py2.5.egg/dabo/biz/dBizobj.py, line 722, in scanChangedRows raise e UnicodeEncodeError: 'ascii' codec can't encode character u'\xfc' in position 117: ordinal not in range(128) Without the line app.DatabaseActivityLog = sys.stdout the application works as expected, field content with non-ASCII characters is saved normally. On the one hand I should have thought of this, because sys.stdout.write(u'äöü') raises the same UnicodeEncodeError. On the other hand the traceback for this case definitely doesn't help. And why is saving the record impossible, just because the _logging_ raises an exception? I've tried to wrap sys.stdout using codecs.EncodedFile, but without success. I don't know which input and output encoding would be right. My system charset is UTF-8. Would it be possible to have DatabaseActivityLog write something like repr(theUnicodeObject)? Not very pretty, but for diagnostic purposes perhaps acceptable? Greetings Sibylle -- Dr. Sibylle Koczian ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] is there a dPageFrame.active()
johnf wrote: Is there a method available that will fire when a tab is selected? Sort like VFP activate dPageFrame has 2 interesting events: PageChanging and PageChanged. http://paul.dabodev.com/doc/api/dabodoc/dabo.ui.uiwx.dPageFrame.dPageFrame.html#Events_PageChanged dPage has PageEnter and PageLeave: http://paul.dabodev.com/doc/api/dabodoc/dabo.ui.uiwx.dPage.dPage.html#Events_PageEnter These are events that you can bind to, eg: pf.bind(dabo.dEvents.PageChanging, myOnPageChangingMethod) Paul ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] Parent and child grid from the same table
That makes sense. Thank you for the explanation. I like your approach to building frameworks. Dabo seems very clean. Is your SVN tree usually pretty stable, or should I be wary about using it in production? Thanks for the fix, Richard On Wednesday 01 October 2008 21:26:20 Ed Leafe [EMAIL PROTECTED] wrote: On Oct 1, 2008, at 10:00 PM, Richard Esplin wrote: I tried 'id' and 'ID' because SQL is case insensitive. The sqlite command line interface accepts any case for field names. If it is getting passed to the interpreter correctly, the case shouldn't matter. I see the same behavior (FieldNotFoundException) with 'rowid', which is an SQLite alias for the PRIMARY KEY field. Any idea on why Dabo doesn't like it? Because the UI is not connected to the DB layer. The binding from UI to bizobj to DB is pure Python; the only connection to the DB is at one extreme of the spectrum. DataField and bizobj binding and cursor fields are all at the Python layer, and thus case-sensitive. Dabo is also backend-agnostic in all but the far end of the DB layer, so database-specific behaviors such as PK aliases don't have any effect inside the framework. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] Parent and child grid from the same table
On Oct 2, 2008, at 12:35 PM, Richard Esplin wrote: Is your SVN tree usually pretty stable, or should I be wary about using it in production? Generally, yes, it's fairly stable, although we have had a few commits that broke things. Those are usually cleaned up pretty quickly, but they can be a pain when they happen. We have a feature called WebUpdate that it is a good compromise between formal release and bleeding-edge repository versions. What this is a series of snapshots that are taken between releases that push out new features and bug fixes when we are satisfied that the code is solid enough. Unfortunately, we are currently in the middle of a series of rather major changes in anticipation of our 0.9 release. There has been some compatibility breaks (i.e., we no longer support Python 2.3 and wxPython earlier than 2.8), as well as some serious code cleanup. Once 0.9 is released, WebUpdate will once again be available. WebUpdate can be configured to check for updates automatically, or only when you choose to check. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] treeFromStructure()
Sweet. Thanks you guys. Mike M. On Tue, Sep 30, 2008 at 7:32 PM, Ed Leafe [EMAIL PROTECTED] wrote: On Sep 30, 2008, at 5:45 PM, Mike Mabey wrote: File C:\src\dabo\ui\uiwx\dPemMixin.py, line 86, in __init__ self._initProperties() File C:\src\dabo\dObject.py, line 177, in _initProperties self.initProperties() File c:\docume~1\mike\locals~1\temp\tmp9efwxz.py, line 251, in initProperties self.treeFromStructure([Part Categories,[None]]) You're placing the call to treeFromStructure in the initProperties method, which fires before the object has been created. Try putting the calls in afterInit(), which fires after the tree exists. -- Ed Leafe [excessive quoting removed by server] ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] dApp.DatabaseActivityLog and non-ASCII database content
Am 2008-10-02 um 18:21 schrieb Sibylle Koczian: Without the line app.DatabaseActivityLog = sys.stdout the application works as expected, field content with non-ASCII characters is saved normally. On the one hand I should have thought of this, because sys.stdout.write(u'äöü') raises the same UnicodeEncodeError. On the other hand the traceback for this case definitely doesn't help. And why is saving the record impossible, just because the _logging_ raises an exception? I've tried to wrap sys.stdout using codecs.EncodedFile, but without success. I don't know which input and output encoding would be right. My system charset is UTF-8. Would it be possible to have DatabaseActivityLog write something like repr(theUnicodeObject)? Not very pretty, but for diagnostic purposes perhaps acceptable? You can't simply print python unicode objects to stdout. Just change your wrapper that it works like sys.stdout.write(u'äöü'.encode('utf-8')) Greetlings from Lake Constance! Hraban --- http://www.fiee.net https://www.cacert.org (I'm an assurer) ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
[dabo-users] Resizable proportion
Okay, I'm going to swallow my pride and ask for help again. This time is worse because I'm pretty sure it's a newbie question. I think I'm struggling to find the answer because I don't know the terminology yet (it's like trying to look up the spelling of a word in the dictionary). In my little application, I have a vertical sizer with a gridlist on the left and a grid sizer on the right. I want the user to be able to grab the border between the two slots, and resize by dragging left or right. This would dynamically change the proportion between the two slots. I know it's possible because the Object Info dialog of the Class Designer does it between the property list and the description text box (except that one is horizontal). I've hunted around the ClassDesigner and don't see anything that appears to work. I tried consulting the ClassDesigner source in the IDE directory, It's hard to follow given that it's a hand-coded UI instead of using the ClassDesigner XML. I think I prefer hand-assembling the dialog, but I'm still learning the API and I'm on a deadline. I tried Googleing wxWidgets, wxPython, and Dabo, but I must not be using the right words. I also searched Dabo-users. Would someone please beat me with a clue stick? Thank you, Richard Esplin ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] Resizable proportion
On Oct 2, 2008, at 8:31 PM, Ed Leafe wrote: That's not a sizer; that's a splitter. Look under the 'Display Controls' on the context menu for adding controls. Hmmm... I just ran this, and got an error when I tried to close a form with a splitter on it. I'll look into this, but I wanted to give you a heads-up in case you saw the same error. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] Resizable proportion
On Oct 2, 2008, at 8:35 PM, Ed Leafe wrote: Hmmm... I just ran this, and got an error when I tried to close a form with a splitter on it. I'll look into this, but I wanted to give you a heads-up in case you saw the same error. Just posted a fix - a rather simple matter. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
Re: [dabo-users] Resizable proportion
Splitter. Got it. Thank you. It works great once I updated from SVN (I saw the same problem closing). Thank you again. Richard Esplin On Thursday 02 October 2008 19:31:37 Ed Leafe [EMAIL PROTECTED] wrote: On Oct 2, 2008, at 8:27 PM, Richard Esplin wrote: In my little application, I have a vertical sizer with a gridlist on the left and a grid sizer on the right. I want the user to be able to grab the border between the two slots, and resize by dragging left or right. This would dynamically change the proportion between the two slots. I know it's possible because the Object Info dialog of the Class Designer does it between the property list and the description text box (except that one is horizontal). That's not a sizer; that's a splitter. Look under the 'Display Controls' on the context menu for adding controls. -- Ed Leafe ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]
[dabo-users] AttributeError: 'controlMix' object has no attribute 'ControllingSizer'
I've been having a problem since I updated from SVN this evening. Once I load my form into ClassDesigner and make a change, I can no longer run my application, save my form, or close cleanly the ClassDesigner. I can duplicate the problem with a clean form as soon as I add a DataGrid to the horizontal sizer. Removing the DataGrid makes the problem go away. The GridList appears to work fine. Google says that someone posted the same error to the mailing list in 2006, but I couldn't find a response. Here is the last few lines of my traceback: line 253, in getDesignerDict ret[children] = self.getChildrenPropDict(classDict) File /usr/local/share/applications/dabo/ide/ClassDesignerComponents.py, line 411, in getChildrenPropDict classDict=kidDict)) File /usr/local/share/applications/dabo/ide/ClassDesignerComponents.py, line 145, in getDesignerDict csz = self.ControllingSizer AttributeError: 'controlMix' object has no attribute 'ControllingSizer' My form is pretty simple: ?xml version=1.0 encoding=utf-8 standalone=no? dForm code-ID=dForm-top CxnFile=path://../db/defaultdb.cnxml Name=dForm Caption=Sampling Application Top=0 Height=676 Width=1353 designerClass=DesForm CxnName=DefaultDB UseSizers=True Left=59 dSizer SlotCount=1 designerClass=LayoutSizer Orientation=Vertical dPanel sizerInfo={'Proportion': 1, 'HAlign': 'Center', 'VAlign': 'Middle', 'Expand': True} designerClass=controlMix dSizer SlotCount=2 designerClass=LayoutSizer Orientation=Horizontal dGrid ColumnCount=4 code-ID=dGrid-dPanel sizerInfo={'Proportion': 1, 'Expand': True} Name=GridListRecords Editable=False designerClass=controlMix DataSource=table1 SelectionMode=Row dColumn Caption=id DataField=id designerClass=controlMix Order=0 Width=64/dColumn snip dColumn Caption=Column4 DataField=col4 designerClass=controlMix Order=30 Width=157/dColumn /dGrid dGridSizer HGap=5 sizerInfo={'Proportion': 1, 'Border': 10, 'Expand': True} Rows=12 designerClass=LayoutGridSizer VGap=5 MaxDimension=r Columns=2 dLabel Width=12 sizerInfo={'Proportion': 0, 'ColExpand': False, 'VAlign': 'Middle', 'Expand': False, 'RowExpand': False} designerClass=controlMix rowColPos=(0, 0) Caption=id/dLabel dTextBox sizerInfo={'Proportion': 0, 'ColExpand': True, 'VAlign': 'Middle', 'Expand': True, 'RowExpand': False} rowColPos='(0, 1)' designerClass='controlMix' DataSource='table1' DataField='id'/ dTextBox snip /dGridSizer /dSizer /dPanel /dSizer /dForm How best can I determine if the problem is on my side, or if a fix is necessary in the framework? Thank you, Richard ___ Post Messages to: Dabo-users@leafe.com Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users Searchable Archives: http://leafe.com/archives/search/dabo-users This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]