in

The ORM Foundation

Get the facts!

ORM Lite source?

Last post Tue, Jul 9 2013 16:24 by Ken Evans. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • Wed, Jun 19 2013 3:00

    • maubrey
    • Top 25 Contributor
    • Joined on Wed, Jun 19 2013
    • Posts 21

    ORM Lite source?

    Hi. Where can I find the source for ORM Lite? All I see is Windows packages on the library section although the notes say it runs on Linux and MacOS as well. I thought I had found the source code repository on SourceForge, but it looks like that's a different project.
  • Wed, Jun 19 2013 12:28 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 805

    Re: ORM Lite source?

    I have asked Brian Christensen to answer your question.

    It's my (possibly incorrect) understanding that since ORM Lite is written in Python, it is Python itself that provides the multi-platform capability rather than there being a separate version for each platform. True or False?

    Also, are you saying that you have been able to look at the source code for ORM Lite? (e.g. from the 13.b download in the library)

     

    Thanks

    Ken

  • Wed, Jun 19 2013 13:50 In reply to

    • maubrey
    • Top 25 Contributor
    • Joined on Wed, Jun 19 2013
    • Posts 21

    Re: ORM Lite source?

    Ken Evans:

    I have asked Brian Christensen to answer your question.

    It's my (possibly incorrect) understanding that since ORM Lite is written in Python, it is Python itself that provides the multi-platform capability rather than there being a separate version for each platform. True or False?

    Thank you.

    Yes, that's what I expected; I had expected a single package that would run wherever a python interpreter + required modules would run. But that's what threw me, since the packages are labeled for Windows and appear to just contain a Windows executable:

      $ file ORMLite_Win_v0.13b.exe 
      ORMLite_Win_v0.13b.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit
    

    It looks like I can probably run this under the Wine emulator, but I would prefer to run it natively, if possible.

    Ken Evans:

    Also, are you saying that you have been able to look at the source code for ORM Lite? (e.g. from the 13.b download in the library)

    No, I haven't. I found a project by the same name that I thought was this one on first glance, but it turned out to be a Java-based object-relational mapper: http://sourceforge.net/projects/ormlite/

    Maurice

  • Mon, Jun 24 2013 13:19 In reply to

    • BrianC
    • Top 25 Contributor
      Male
    • Joined on Thu, Oct 9 2008
    • Posts 48

    Re: ORM Lite source?

    The source code is available via Subversion. Here are the commands to request a copy.

    svn checkout svn://pureviolet.net/air/trunk/ganttpv ormlite
    svn checkout svn://pureviolet.net/air/trunk/scripts Scripts

    I use Python 2.7 in development, but it might work with an earlier version. It requires a recent version of wxPython.

    I have received a report that there is an error when run under at least one version of Linux. The person who reported the error was not technical and was not able to identify exactly what was wrong or how to fix it. I have not been able to test this as I don't have a version of Linux available to me.

    If you run into the same problem please let me know.

    As a work around, because ORM-Lite shares source code with GanttPV, she was able to create ORM diagrams using GanttPV after running the "Object Role Modling -> Install ORM Diagram" script and then adding an ORM Diagram report.

    I have tested ORM-Lite on the Macintosh. It has a problem displaying all of the help text, but otherwise seems to be working properly.

    There are some developer hints that you might find useful on the GanttPV web site that also apply to ORM-Lite at http:/pureviolet.net/ganttpv/developer/subversion/

  • Mon, Jun 24 2013 13:31 In reply to

    • BrianC
    • Top 25 Contributor
      Male
    • Joined on Thu, Oct 9 2008
    • Posts 48

    Re: ORM Lite source?

    Ken,

    ORM-Lite has multi-platform capability because I developed it using Python and wxPython (a cross platform user interface library). Unfortunately, as good as wxPython is, there are some differences between the MW Windows, Linux, and Macintosh platforms. It is necessary to test and make (usually minor) changes for each platform. The most common problem is that the default font size are different on each platform. Sometimes an option on one platform isn't supported on another.

    For the Linux version of ORM-Lite, I suspect that I have been using an option or parameter on the Windows version that isn't supported in Linux.

    I intend to create a prepackaged version of ORM-Lite for the Macintosh. I would also create one for the common Linux distributions, but it requires specific skills and developer permissions that I don't have to add an application to the Linux program repositories.

  • Mon, Jun 24 2013 15:30 In reply to

    • maubrey
    • Top 25 Contributor
    • Joined on Wed, Jun 19 2013
    • Posts 21

    Re: ORM Lite source?

    Thanks, Brian.

    I pulled the svn sources and I am seeing a segmentation fault.

    Using:

    Python 2.7.2+
    python-wxgtk2.8 (recent enough?)
    

    Backtrace:
    #0  0x00007ffff5681c5f in wxGenericTreeCtrl::Delete(wxTreeItemId const&) ()
       from /usr/lib/libwx_gtk2u_core-2.8.so.0
    #1  0x00007fffed6e3b8b in ?? ()
       from /usr/lib/python2.7/dist-packages/wx-2.8-gtk2-unicode/wx/_controls_.so
    #2  0x00000000004ba179 in PyEval_EvalFrameEx ()
    #3  0x00000000004bcdbd in PyEval_EvalCodeEx ()
    

    Is there a more appropriate place to discuss the code? Didn't see anything on pureviolet.net.

    Best,

    Maurice

  • Tue, Jun 25 2013 1:32 In reply to

    • maubrey
    • Top 25 Contributor
    • Joined on Wed, Jun 19 2013
    • Posts 21

    Re: ORM Lite source?

    Follow-up on this. I installed a debugging version of python and was able to isolate the error. Here's a patch that at least got it running on Linux (haven't actually tried using it yet):

    http://pastie.org/8077519

    The main problem was around line 1433. For some reason, under Linux, ItemHasChildren() is returning true even when GetFirstChild() is ! IsOk(). I added an IsOk() check and that fixed the seg fault. No idea if that's the proper fix or not.

    The other issue I think is probably due to my having an older wx library. My library had no definition for aui.AUI_MINIMIZE_POS_TOOLBAR, so commented out that section. I may just need to upgrade, but maybe it would be good to support older versions where possible? Dunno if that's a critical feature or not.

    Best.,

    Maurice
  • Wed, Jul 3 2013 6:00 In reply to

    • JayD239
    • Top 500 Contributor
    • Joined on Sat, Apr 18 2009
    • Posts 1

    Re: ORM Lite source?

    This patch also allowed my to run the application, but it does not seem to work very well. I can't open a diagram (by double-clicking it).
    
    ('Report', 5)
    Traceback (most recent call last):
      File "/home/jd/ormlite/ormlite/MainORM.py", line 1621, in OnTreeLeftDClick
        Data.OpenReport(key[1]) 
      File "/home/jd/ormlite/ormlite/ReportAids.py", line 220, in OpenReport
        OpenPanel(r)
      File "/home/jd/ormlite/ormlite/ReportAids.py", line 182, in OpenPanel
        panel_type = reportobj.ReportType.PanelType
    AttributeError: 'NoneType' object has no attribute 'PanelType'
    
    
    
    $ python --version
    Python 2.7.3
    
    
    So I suppose it'll take a bit more effort to have this application properly OS-Independent.
  • Sat, Jul 6 2013 2:54 In reply to

    • maubrey
    • Top 25 Contributor
    • Joined on Wed, Jun 19 2013
    • Posts 21

    Re: ORM Lite source?

    Yes, I'm seeing the same thing.
    Looks like there's an issue around line 175 of ReportAids.py

    reportobj = Data.DBObject.GetObject("Report", id)

    reportobj appears to be a "NoneType" object and fails when it attempts to call reportobj.ReportType.PanelType

    Brian, any tips for additional debugging?

  • Tue, Jul 9 2013 1:59 In reply to

    • BrianC
    • Top 25 Contributor
      Male
    • Joined on Thu, Oct 9 2008
    • Posts 48

    Re: ORM Lite source?

    maubrey:
    Is there a more appropriate place to discuss the code? Didn't see anything on pureviolet.net.

    At present I feel that this is the best place to discuss the code (unless Ken has any objections). It will be useful for the ORM community to see the active interest in ORM-Lite.

  • Tue, Jul 9 2013 2:09 In reply to

    • BrianC
    • Top 25 Contributor
      Male
    • Joined on Thu, Oct 9 2008
    • Posts 48

    Re: ORM Lite source?

    maubrey:
    Follow-up on this. I installed a debugging version of python and was able to isolate the error. Here's a patch that at least got it running on Linux (haven't actually tried using it yet):
    Thank you Maurice. I am excited that you have found a solution. When I get a chance I'll review the change and apply it to the repository.

    maubrey:
    maybe it would be good to support older versions where possible?
    I think it would. I've found it isn't always easy to control which version of a library is available to Linux users.

    maubrey:
    Dunno if that's a critical feature or not.
    I don't know either. I'll try to verify that before I apply the patch to the repository.

    Thanks again for your efforts.

  • Tue, Jul 9 2013 2:35 In reply to

    • BrianC
    • Top 25 Contributor
      Male
    • Joined on Thu, Oct 9 2008
    • Posts 48

    Re: ORM Lite source?

    JayD239:
    I can't open a diagram (by double-clicking it).
    This error might be caused by ORM-Lite not knowing where to find the Scripts folder. It is the only reason I could think of for ReportType being a NoneType object.

    Could you test this work around? (1) After you start ORM-Lite and before you do anything else, select the menu command "Scripts -> Choose Scripts Folder ..." then tell ORM-Lite where you placed the scripts folder. (2) Exit the program and start it up again. (3) Then try double-clicking an ORM diagram to open it. ORM-Lite should save the Scripts location into an options file and reuse that location upon start up.

    In the installer for the Windows version of ORM-Lite, I can place the Scripts folder where ORM-Lite expects to find it. I'm not sure where the Linux version of ORM-Lite would expect to find the folder.

    JayD239:
    This patch also allowed my to run the application
    This is good news. Thank you for your efforts.

    JayD239:
    So I suppose it'll take a bit more effort to have this application properly OS-Independent.
    Unfortunately true, but with your help we are getting closer.

  • Tue, Jul 9 2013 2:51 In reply to

    • BrianC
    • Top 25 Contributor
      Male
    • Joined on Thu, Oct 9 2008
    • Posts 48

    Re: ORM Lite source?

    maubrey:
    reportobj appears to be a "NoneType" object and fails when it attempts to call reportobj.ReportType.PanelType
    maubrey:
    Brian, any tips for additional debugging?
    Every Report object should know its ReportType. The ReportType is what identifies that particular report as being an ORM Diagram. Without a type it is just a mystery diagram that ORM-Lite doesn't expect.

    ORM-Lite is supposed to find the definition of the ORM Diagram ReportType in a script that it automatically applies whenever it creates a new ORM file. The script could be manually applied to a file if necessary; it is the "Install ORM Diagram" script. The script also defines several other ORM related report types.

  • Tue, Jul 9 2013 15:18 In reply to

    • maubrey
    • Top 25 Contributor
    • Joined on Wed, Jun 19 2013
    • Posts 21

    Re: ORM Lite source?

    Yep, you were right: it was failing to find the Scripts directory

    Here's a patch that fixes things for me: http://pastie.org/8125563

    Again, not sure if it's the correct fix. I saw where Data.Path was being set in ORMLite.py, and AFAICT it's supposed to be set to the directory containing the script. With the directory layout in svn, Scripts and ormlite are at the same level, so I just changed GetScriptDirectory() to return ../Scripts rather the Scripts. I verified that it works for me whether I run it from the parent directory or within the ormlite/.

    I also modified GetScriptDirectory() to emit a warning if the path doesn't exist. Currently it only emits that in debug mode... not sure the best way to handle it but it would be nice to raise an exception or something if the Scripts/ directory isn't found, since that seems like a fatal error.

    Best,

    Maurice

    BTW, where can I find the message syntax for this forum? I'm currently using HTML to structure messages but wondering if it supports bbcode or markdown or somesuch?

  • Tue, Jul 9 2013 16:24 In reply to

    • Ken Evans
    • Top 10 Contributor
      Male
    • Joined on Sun, Nov 18 2007
    • Stickford, UK
    • Posts 805

    Re: ORM Lite source?

     "BTW, where can I find the message syntax for this forum?"

    Not sure what you mean by "message syntax".

    The way the Forum works is explained in the Help file that you can access from the help link at the top right of this page.

    Let me know if you need more.

     Ken

Page 1 of 1 (15 items)
© 2008-2024 ------- Terms of Service