source: orange/orange/doc/Orange/rst/code/serverfiles2.py @ 7742:f8f8bdab658d

Revision 7742:f8f8bdab658d, 808 bytes checked in by markotoplak, 3 years ago (diff)

Moved orngServerFiles to a new hierarchy.

Line 
1import Orange, sys
2sf = Orange.misc.serverfiles
3
4ordinary = sf.ServerFiles()
5authenticated = sf.ServerFiles(sys.argv[1], sys.argv[2])
6#authentication is provided as command line arguments
7
8try: 
9    authenticated.remove_domain('demo2', force=True)
10except: 
11    pass 
12   
13authenticated.create_domain('demo2')
14authenticated.upload('demo2', 'titanic.tab', 'titanic.tab', \
15    title="A sample .tab file", tags=["basic", "data set"])
16print "Uploaded."
17print "Non-authenticated users see:", ordinary.listfiles('demo2')
18print "Authenticated users see:", authenticated.listfiles('demo2')
19authenticated.unprotect('demo2', 'titanic.tab')
20print "Non-authenticated users now see:", ordinary.listfiles('demo2')
21print "orngServerFiles.py file info:"
22import pprint; pprint.pprint(ordinary.info('demo2', 'titanic.tab')) 
23
Note: See TracBrowser for help on using the repository browser.