-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathexample.py
More file actions
60 lines (52 loc) · 1.42 KB
/
example.py
File metadata and controls
60 lines (52 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<%
import sys
sys.path.append("/var/www/html/working")
import IDrive
from xml.dom.minidom import parseString
import xml.dom.minidom as xdm
#create an instance of the library
myNewObj = IDrive.IDrive('<IDRIVE UID>', '<IDRIVE PWD>')
#create the parameters dictionary
inparams = {}
#load the server response into a variable
result = myNewObj.execute('validateAccount', inparams)
#parse the XML response
dom = xdm.parseString(result)
root = dom.documentElement
atr1 = root.getAttributeNode('message')
#print the response
%>
<strong>Valiate Account</strong></br />
<%=atr1.nodeValue%>
<%
inparams = {}
inparams['pvtkey'] = ""
inparams['enctype'] = "default"
result = myNewObj.execute('configureAccount', inparams)
dom = xdm.parseString(result)
root = dom.documentElement
atr2 = root.getAttributeNode('message')
%>
<br /><strong>Configure Account</strong></br />
<%=atr2.nodeValue%>
<%
inparams = {}
inparams['p'] = "/OWNER-PC"
inparams['searchkey'] = "Crysanthemums"
inparams['trash'] = "yes"
result = myNewObj.execute('searchFiles', inparams)
dom = xdm.parseString(result)
root = dom.documentElement
atr2 = root.getAttributeNode('message')
%>
<br /><strong>Search Files</strong></br />
<%=atr2.nodeValue%>
<%
inparams = {}
result = myNewObj.execute('getAccountQuota', inparams)
dom = xdm.parseString(result)
root = dom.documentElement
atr2 = root.getAttributeNode('message')
%>
<br /><strong>Get Account Quota</strong></br />
<%=atr2.nodeValue%>