9

i am looking for something similar to Organizing GUI code, but for Python and PyQt4. Especially, I am looking at tips and examples of how to handle and store the configuration data, general state etc.

EDIT: I have found some hints regarding older versions under: http://www.commandprompt.com/community/pyqt/

data
  • 2,493
  • 2
  • 19
  • 21

1 Answers1

15

Here's an overview of what we did w/some example names and their functions (we have a lot more in the actual app.)

ProjectFolder/
  - src/
     - my_project/
        - model/
           - preference.py # Interact with config params
           - api.py # Interact with our REST api

        - controller/
           - startup.py # Initialization code
           - login.py # Login a user

        - view/
           - main_window.py # Application container
           - login_widget.py # Login form

        - main.py # Application entry point.

  - tests/
      - my_project_tests/
          - model/ 
          - view/
          - controller/

  - resources/
      - ui/ # The files match basically one to one with the modules in the view directory.
        - main_window.ui
        - login_widget.ui
      - images/
        - logo.png

  - setup.py # Script to build the application (calling into the build_py2exe, etc. files below)
  - build_py2exe.py # Build the py2exe exe 
  - build_py2app.py # Build the py2app app
  - build_win_installer.iss # Package up the py2exe into an installer (Using inno setup).
  - build_dmg.py #Package up the py2app into a DMG

  - runtests.py # Run the tests
Sam Dolan
  • 31,966
  • 10
  • 88
  • 84
  • Is this an open source application? Would you mind giving me a link to the source code? – data Aug 16 '10 at 18:22
  • 1
    @data: The application never actually made it into production, and I no longer work at the company. We talked about making it open source while I was there, but never got around to it. I'll ask them at lunch this week, but it will take me a couple of weeks before I'll have time for it. What I'll aim to do is abstract everything out into a base pyqt4 project, with our application as an example project. – Sam Dolan Aug 16 '10 at 18:45
  • sdolan: Did you ever manage to release the code? I would still be interested to see how you solved it. My code is still far away from even pre-alpha ;) – data Dec 01 '10 at 17:55