Application -- Venue interaction

Eric Olson eolson at mcs.anl.gov
Tue Sep 23 14:05:12 CDT 2003


Terry,

You can use additional modules the same way python normally expects 
them.  You are able to copy additional modules/files into the 
SharedApplications directories when you register your application.  The 
attached example calls a function from an external module/file, 
SampleAppHelper.py.  (other possibilites include setting your PYTHONPATH 
or installing your helper modules into the system python directories.)

Also, it should also be a little easier to register applications now.  
Instead of needing your own functions to register the app, you can use the 
"RegisterApp.py" program which can be obtained from cvs (in the bin 
directory).  Then you only need to modify the small amount of info in a 
.app file (example attached).
To use it:
RegisterApp.py -f SampleApp.app
   (SampleApp.app mentions attached files SampleApp.py and 
SampleAppHelper.py which should be in the current directory)

Unregistering:
There is no unregister function yet, but the information is stored in the 
AppDatabase file:
Documents and Settings\<user>\Application Data\AccessGrid\ApplicationDatabase

In that text (.ini format) file, you can either remove the sections 
related to your program, or clear them all by removing the entire file.  
You can also remove the actual programs from the SharedApplications folder 
in the same location, but that's not absolutely necessary.

Eric


On Tue, 23 Sep 2003, Terry Disz wrote:

> Eric,
> 
> How do I use this when I have some module dependencies in my python
> programs? I can't tell how to tell it to include other modules.
> 
> Also, how do I un-register an app when I have decided I no longer want
> it available?
> 
> Thanks,
> 
> Terry
> 
> -----Original Message-----
> From: owner-ag-dev at mcs.anl.gov [mailto:owner-ag-dev at mcs.anl.gov] On
> Behalf Of Eric Olson
> Sent: Friday, September 12, 2003 4:57 PM
> To: ag-dev at mcs.anl.gov
> Subject: RE: Application -- Venue interaction
> 
> 
> Here is a quick sample on how to use the venueUrl option that Ivan 
> recently added.  All this example does is register the app and then let 
> your app be launched from the venueclient with the venueUrl provided as
> an 
> argument.  The SampleApp just prints the url and exits.  I sent this to 
> Terry, but others may want to comment on it or try it -- if so, just 
> follow the instructions below.
> Eric
> 
> ---------- Forwarded message ----------
> Date: Fri, 12 Sep 2003 14:42:45 -0500 (CDT)
> From: Eric Olson <eolson at mcs.anl.gov>
> To: Terrence Disz <disz at mcs.anl.gov>
> Subject: sample app
> 
> Hi Terry,
> 
> This only works in cvs right now and of course the methods for doing
> these 
> things may change with future releases.  The two files attached should
> be 
> in the same directory.
> 
> 1) Run RegisterSampleApp.py to register SampleApp.py.
> 
> In windows (in linux use python2):
>   python RegisterSampleApp.py
> 
> 2) Restart the venueclient (in debug mode --debug so you can see the
> print 
> statement later) and join a venue.  You should see "Start Sample App" in
> 
> venue applications.  It will put a "Sample App" entry under Applications
> 
> in the current venue, and will also run it.
> 
> 3) Open or double-click the new "Sample App".  The SampleApp.py will run
> 
> and print out the current venue url (in windows, you will probably only 
> see it if you run the venueclient in debug mode).
> 
> You no longer need the two files because SampleApp.py has been copied to
> 
> your .AccessGrid/SharedApplications directory and it runs from there.
> 
> Let me know if you have any problems.
> 
> Eric
> 
> 
> 
-------------- next part --------------
[application]
name = Sample Application
mimetype = application/x-ag-sample-application
extension = sampleapplication
files = SampleApp.py, SampleAppHelper.py

[commands]
Open = %(python)s SampleApp.py %(venueUrl)s

-------------- next part --------------
import sys
from SampleAppHelper import TestHelper

print sys.argv

if len(sys.argv) > 1:
    print "venue:", sys.argv[1]

if TestHelper():
    print "successfully called external function TestHelper()"
else:
    print "unable to call external function TestHelper()"

-------------- next part --------------


def TestHelper():
    return 1



More information about the ag-dev mailing list