pyswarm Documentation (http://pyswarm.sourceforge.net/)

2.4.  Installing Your Application

2.4.1. Inspecting the Generated Output
2.4.2. Automatic set-up

Change to the application directory you provided as target for the generated output. You will see one sub-directory for each generation you run with this specification. The name of the sub-directory is the timestamp of when the generation did happen.

Inside this generated sub-directory you will find several files and directories, see Section 3.3, “ Content of the generated output ” for a full description.

petstore/ is the top-level package of your recently created pyswarm application. Browse through the tree. As sub-directories you will find the nodes. Change to the internet directory which has the sub-directories contacts, core, shop and logistics (which are sub-packages). Change to contacts. In contacts you see two directories, one for the logic-component adm and one for its corresponding database-component admDB.

Change to adm - uh, this directory is rather populated. Your entity and zone classes resides here in their appropriate modules and have a big party together. You easily recognize them at their names. There are also some modules named like some of your association-roles, but usually you will never work with them. And last, but not least, you see a module with the same name as your logic-component, adm.py. This is the module you will later need to import when writing a client to access the component and all its entity objects. An example client is described later.

In order to install your pyswarm application and initialize all its databases the pyswarm SDK has generated two scripts which you may consider as very useful, especially if you deploy a new generation on the local host.

In the output directory you will find the initdb.py which we will use to initialize the databases of our PetStore project. The same directory also contains setup.py, which we will use to install the Python packages on the local host.

The very first time you will need initdb to create the login-roles that are used by the logic-component to access them, but these logins also are used to drop and/or create the database and create its tables, insert the primary object and so on. I assume you have a locally installed PostgreSQL server and still know the user and password of the postgres role that is created during PostgreSQL installation - or at least you have any other login-role in the database server that has the privilege to create new login-roles, I refer to it as a super-user, although it is not really necessary to have a full super-user account to create roles at this server.

[Tip] Tip

See Section 3.9, “ Initialize Databases: initdb ” to learn other options of this command.

[Tip] Tip

See Chapter 3, Installing pyswarm Applications to learn how to use this command.

[Tip] Tip

The next chapter Section 2.5, “ Running Your Application ” will show you how you can implement yourself a script like petstore-populate.py.

This document was created using the >e-novative> DocBook Environment (eDE)