On 26/07/13 02:15, Hua Xiang wrote:

Where I can find the standard procedure to create my plugin? Or, should I
create these directory structure manually?

I'm afraid it is a bit of a manual process.. I tend to just create
everything required then svn add everything later but if the directories
don't already exist you can also do something like

     svn mkdir bloodhound_time_series_reports/bhtsreports --parents
     svn commit bloodhound_time_series_reports -m "adding basic directory
     structure for bep-0008 plugin"

to get the bare minimum directories into your branch - you are free to
change either of the "bloodhound_time_series_reports" and "bhtsreports"
directory names but I will keep referring to the directories with that
name in this email.


Anyway, you will be putting a setup.py file in
/home/xiang/bep_0008_time_series_reports/bloodhound_time_series_reports
so that it will be possible to install the plugin but real code for your
project should go in

/home/xiang/bep_0008_time_series_reports/bloodhound_time_series_reports/bhtsreports.

The directories and the updated setup.py file have been committed.

Looks like you have only committed the directories, possibly because I didn't mention that you also need to "svn add" files so that subversion knows which files you intend to add to the repository. You can svn add recursively though sometimes this will add more things than you intended. An example of this happening in our repository is (at the time of writing anyway - revision 1507215 has this but I hope that Antonia will fix it soon) demonstrated in the bep_0007_embeddable_objects/bloodhound_embedding_plugin directory where there are at three directories that don't belong in the repository (BloodhoundEmbeddingPlugin.egg-info, build and dist).

Anyway, all I am saying is that you can either svn add everything and then use svn stat to try to work out if there is anything you added accidentally or do the complete opposite and use svn stat to help you pick out particular files you need to svn add.

I hope that is clear enough for now!

You can use
/home/xiang/bep_0008_time_series_reports/bloodhound_relations or any of
the other bloodhound plugins to give example setup.py files but let us
know if you have any more problems.

I have checked the files in bloodhound_relations directory. I would move
out the changes I committed to the trunk. Just want to know how can I bulid
my plugin and check the display in browser?

Cheers!

A properly written setup.py file will allow you to do this in your activated virtualenv:

   python setup.py develop

so that is useful to do while you are trying to get the setup.py right. Once it does work, adding the following line to your the installer/requirements-dev.txt file in your branch:

   -e ../bloodhound_time_series_reports

will mean that you and others can install it in the same develop mode with a "pip install -r requirements-dev.txt".

The question of how to get a report into the system is an interesting one. As you may be able to tell, generally these are provided at install time. You could try to implement the IEnvironmentSetupParticipant interface to give you the opportunity to install your report. You will not be able to rely on the id for the report being the same on all installations so you might want to maintain your own database version to track whether you need to request the upgrade though there may be other ways of unambiguously determining whether a particular report is installed.

Cheers,
    Gary

Reply via email to