Data Storage |
The exercises in this session will show you how to use
the DataStoreClient to connect to a venue data storage.
The DataStoreClient API can be found here.
Please refer to the class AccessGrid.DataStoreClient.DataStoreClient
|
Exercise 1 - Test the Data Storage
API |
- Start a server on your local machine, see Configuration - Exercise
4.
- Open the DataStorageTest.py file.
- Print results from each DataStoreClient call.
- Create a test.doc and test.ppt file in your local directory
- Run the script
DataStorageTest.py
Note: OSX users will first need to source the file /Applications/AccessGridToolkit.app/Contents/Resources/setupenv.sh
- Connect with the Venue Client to see files get added and removed.
You may have to refresh the UI to see the new files. Also, make sure
the localFile.doc exists in your local directory.
|
Exercise 2 - Create a Venue File
Browser |
- Download the VenueFileBrowser.py
file.
- Start the file browser
VenueFileBrowser.py
OSX: pythonw VenueFileBrowser.py
Two lists will be displayed; one for local files on the left and one
for venue files on the right. The VenueFileBrowser.py code does only
include the UI components.
- Add code for populating the remote file list on the right.
- Add code for uploading a file from the local directory to the venue
in the Upload event handler.
- Add code for downloading a venue file to the local directory in the
Download event handler.
- Make sure upload and download works. Enter the venue with the Venue
Client and check if the files are there.
For more UI details, see the wxPython
online documentation.
Solution: VenueFileBrowser_Solution.py
|