8. Projects

The first thing you will find out is that Arachno is not an editor. It is a full featured project based IDE. One of the main differences to Editors and same other IDE's is that you must define a project before you can do something useful.

Logically a project is a complete application, a website, a library or another kind of clearly defined collection of files. Physically it is a bundle of directories, files and a lot of specific settings stored together for each project.

Settings that reflect your personal style, like colors or key bindings are configured on a program wide global level. In contrast to that all settings that influence the output of your work, are stored on a project level. Many options have a dual behaviour, this means you can set them on both levels. If this is done then the project specific option will always overwrite the global one. So you can setup the normal default behaviour for projects in your company and change minor details on a per project base.

8.1. Simple Project Handling

If you work on only one computer then the simplified project handling has all what you need. In this mode Arachno will not pollute the directories in your project with any additional project data files. Instead the project files are all created in the private directory. On Windows this is the directory:
C:\Documents and Settings\Administrator\My Documents\Python Projects
and on Unix/MacOSX we use:
$HOME/.Arachno/Python Projects
This path of course depends on your login name and the choosen windows operating system language.

To create a new menu you have to select "New Project" from the "File" menu.

First of all you must give the project a unique name. The name must be a valid file name so it can't for example contain the '/' or '\' characters. While many characters (depending on the file system) may be possible its always best to use only latin letters, digits, space or the characters '_' and '-'.

After this you must specify the root directory of your project. All path values in the project settings are stored relative to this directory. It is not easy to change the rootpath later because you have to manually modify the project settings file.

The most important part of a project is the file list. It is very easy to search and navigate inside project files. They are also continuous scanned in the background and a repository of source code entites (functions, classes) is created for all project files. When you create a new project you can define if you want to add the files in the root directory, the files and all subdirectories or nothing at all. You can edit the project file list later if you want.

8.2. Advanced Project Creation

If you intend to work on your project from different computers and even different operating systems you have to use the advanced project creation dialog. To get there you first have to bring up the simple project dialog and then hit "Advanced Options..." button in the lower left side to turn the dialog into the one with the advanced settings.

Arachno maintains three entities for each project. A project file, a directory with files that can be shared on different computers and a directory with files that contain settings for the local computer only. While we will call this directories the shared and local settings directory they also contain other files and cached values that are not settings. For example file lists, unit test data, the source code repository and much more.

The project file is the most important file. It carries the .apython file extension and is a simple text configuartion file in Windows INI format.

Note: Even if a settings file is stored as a text file it is not recommended that you change the settings by hand. Please use the GUI to set the data values. The values in the file are not checked for all possible inconsistencies and errors. So if you make an error the program may crash without any feedback.

The location of the project file is important because this is the base location for the directories. If you don't set a full absolute path in the "Local Project Directory", "Shared Project Directory" and "Project Root Directory" fields then they are considered relative to the project file location.

You can store the project file and the two directories wherever you want. But we recommend to store the project file and the shared project directory in the project root directory and the local directory somewhere under C:\Documents and Settings\Administrator\My Documents on Windows or /home/user on Unix. If you use a version control system this makes it easy to synchronize your project on your workstation with the one on your notebook or your computer at home. If you work with multiple person you should think twice if you want to share project settings with your team members. Often this is not a good idea because different persons have different working styles.

The local settings directory contain only non important data, like the history values for input fields, last window positions, log files, cached file lists the indexed source code repository etc. All of them can be regenerated. So if you see that this directory becomes very large you can delete it. It will be restored the next time you open the project.

There is one more thing that you can set here. A descriptive text that will be be added as a comment at the front of each new created file using the correct comment syntax for the file type. If the file type does not support the concept of a comment, for example plain text files, then nothing is added. This feature is especially usefull if you want to precede each file with a license and copyright comment.

Environment Variables in Project Paths

If you keep a project on two different systems there might be a problem. If your project "website" is stored on computer A on drive "X:\work\website" and on computer "B" in directory "/home/lothar/my_boring_job/website" then you have obviously a problem with absolute paths. In this case you can either use a relative path or you use an environment variable.

In the paths fields you can use the syntax "${JOB}\website" to expand the environment variable 'JOB'. It is an error if a referenced environment variable is not found - in this case the project will not open. You can use the environment variables defined on the system level when you start Arachno and the variables that you set with global scope in the environment variable settings dialog.

8.3. Open and Close a Project

If you work with simple projects you can easily select the project by it's name from the "Open Project" submenu. This submenu lists all projects file found in the
C:\Documents and Settings\Administrator\My Documents\Python Projects (Windows)
or the
$HOME/.Arachno/Python Projects (Unix)
directory . If there are too many projects you will see a "Select Project..." menu option which pops up a dialog and give you a list where you can select the project.

To open a project that is stored somewhere else you need to reference the project settings file. You can do this via the "Open Project => Select Project File..." menu item from the "File" menu. In the menu you will also see the paths to the 8 most recently used projects.

Projects and Windows

There is a strong relation between Arachno main windows and projects. Each main window can display one project but a project can be displayed in multiple main windows.

If you open a project and the main window is not already displaying a project then the project gets opened in it. Otherwise a new window is created and the project is opened there. If you use the "New Window" item from "Windows" menu you can open a new window that has its configuration cloned from the current window. In this way you can open multiple windows for a project. You will see later that there are some usecases (for example a client server application) that really benefit from the ability to have two main windows for the same project.

Closing a project is done with the corresponding command in the "File" menu. It closes all windows that display the project except the last window. The last window can only be closed if the program exists.

8.4. Delete a Project

To delete a project you just have to delete the project settings file and the local and the shared settings directories. Be carefull: You can't delete a project that is open. The "Delete Project" item in the "File" menu just does this. If displays the same items as described for the "Open Project" submenu.

8.5. A Look Inside the Projects Handling

Moving the Root Directory of a Project

8.6. Environment Variables