Skip to content

Commit 6e299e2

Browse files
committed
run make all
1 parent 4d06e15 commit 6e299e2

File tree

10 files changed

+29343
-41596
lines changed

10 files changed

+29343
-41596
lines changed
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
#!/usr/bin/env python
2+
#
3+
# Autogenerated by Thrift Compiler (0.22.0)
4+
#
5+
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
6+
#
7+
# options string: py
8+
#
9+
10+
import sys
11+
import pprint
12+
if sys.version_info[0] > 2:
13+
from urllib.parse import urlparse
14+
else:
15+
from urlparse import urlparse
16+
from thrift.transport import TTransport, TSocket, TSSLSocket, THttpClient
17+
from thrift.protocol.TBinaryProtocol import TBinaryProtocol
18+
19+
from fb303 import FacebookService
20+
from fb303.ttypes import *
21+
22+
if len(sys.argv) <= 1 or sys.argv[1] == '--help':
23+
print('')
24+
print('Usage: ' + sys.argv[0] + ' [-h host[:port]] [-u url] [-f[ramed]] [-s[sl]] [-novalidate] [-ca_certs certs] [-keyfile keyfile] [-certfile certfile] function [arg1 [arg2...]]')
25+
print('')
26+
print('Functions:')
27+
print(' string getName()')
28+
print(' string getVersion()')
29+
print(' fb_status getStatus()')
30+
print(' string getStatusDetails()')
31+
print(' getCounters()')
32+
print(' i64 getCounter(string key)')
33+
print(' void setOption(string key, string value)')
34+
print(' string getOption(string key)')
35+
print(' getOptions()')
36+
print(' string getCpuProfile(i32 profileDurationInSec)')
37+
print(' i64 aliveSince()')
38+
print(' void reinitialize()')
39+
print(' void shutdown()')
40+
print('')
41+
sys.exit(0)
42+
43+
pp = pprint.PrettyPrinter(indent=2)
44+
host = 'localhost'
45+
port = 9090
46+
uri = ''
47+
framed = False
48+
ssl = False
49+
validate = True
50+
ca_certs = None
51+
keyfile = None
52+
certfile = None
53+
http = False
54+
argi = 1
55+
56+
if sys.argv[argi] == '-h':
57+
parts = sys.argv[argi + 1].split(':')
58+
host = parts[0]
59+
if len(parts) > 1:
60+
port = int(parts[1])
61+
argi += 2
62+
63+
if sys.argv[argi] == '-u':
64+
url = urlparse(sys.argv[argi + 1])
65+
parts = url[1].split(':')
66+
host = parts[0]
67+
if len(parts) > 1:
68+
port = int(parts[1])
69+
else:
70+
port = 80
71+
uri = url[2]
72+
if url[4]:
73+
uri += '?%s' % url[4]
74+
http = True
75+
argi += 2
76+
77+
if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed':
78+
framed = True
79+
argi += 1
80+
81+
if sys.argv[argi] == '-s' or sys.argv[argi] == '-ssl':
82+
ssl = True
83+
argi += 1
84+
85+
if sys.argv[argi] == '-novalidate':
86+
validate = False
87+
argi += 1
88+
89+
if sys.argv[argi] == '-ca_certs':
90+
ca_certs = sys.argv[argi+1]
91+
argi += 2
92+
93+
if sys.argv[argi] == '-keyfile':
94+
keyfile = sys.argv[argi+1]
95+
argi += 2
96+
97+
if sys.argv[argi] == '-certfile':
98+
certfile = sys.argv[argi+1]
99+
argi += 2
100+
101+
cmd = sys.argv[argi]
102+
args = sys.argv[argi + 1:]
103+
104+
if http:
105+
transport = THttpClient.THttpClient(host, port, uri)
106+
else:
107+
if ssl:
108+
socket = TSSLSocket.TSSLSocket(host, port, validate=validate, ca_certs=ca_certs, keyfile=keyfile, certfile=certfile)
109+
else:
110+
socket = TSocket.TSocket(host, port)
111+
if framed:
112+
transport = TTransport.TFramedTransport(socket)
113+
else:
114+
transport = TTransport.TBufferedTransport(socket)
115+
protocol = TBinaryProtocol(transport)
116+
client = FacebookService.Client(protocol)
117+
transport.open()
118+
119+
if cmd == 'getName':
120+
if len(args) != 0:
121+
print('getName requires 0 args')
122+
sys.exit(1)
123+
pp.pprint(client.getName())
124+
125+
elif cmd == 'getVersion':
126+
if len(args) != 0:
127+
print('getVersion requires 0 args')
128+
sys.exit(1)
129+
pp.pprint(client.getVersion())
130+
131+
elif cmd == 'getStatus':
132+
if len(args) != 0:
133+
print('getStatus requires 0 args')
134+
sys.exit(1)
135+
pp.pprint(client.getStatus())
136+
137+
elif cmd == 'getStatusDetails':
138+
if len(args) != 0:
139+
print('getStatusDetails requires 0 args')
140+
sys.exit(1)
141+
pp.pprint(client.getStatusDetails())
142+
143+
elif cmd == 'getCounters':
144+
if len(args) != 0:
145+
print('getCounters requires 0 args')
146+
sys.exit(1)
147+
pp.pprint(client.getCounters())
148+
149+
elif cmd == 'getCounter':
150+
if len(args) != 1:
151+
print('getCounter requires 1 args')
152+
sys.exit(1)
153+
pp.pprint(client.getCounter(args[0],))
154+
155+
elif cmd == 'setOption':
156+
if len(args) != 2:
157+
print('setOption requires 2 args')
158+
sys.exit(1)
159+
pp.pprint(client.setOption(args[0], args[1],))
160+
161+
elif cmd == 'getOption':
162+
if len(args) != 1:
163+
print('getOption requires 1 args')
164+
sys.exit(1)
165+
pp.pprint(client.getOption(args[0],))
166+
167+
elif cmd == 'getOptions':
168+
if len(args) != 0:
169+
print('getOptions requires 0 args')
170+
sys.exit(1)
171+
pp.pprint(client.getOptions())
172+
173+
elif cmd == 'getCpuProfile':
174+
if len(args) != 1:
175+
print('getCpuProfile requires 1 args')
176+
sys.exit(1)
177+
pp.pprint(client.getCpuProfile(eval(args[0]),))
178+
179+
elif cmd == 'aliveSince':
180+
if len(args) != 0:
181+
print('aliveSince requires 0 args')
182+
sys.exit(1)
183+
pp.pprint(client.aliveSince())
184+
185+
elif cmd == 'reinitialize':
186+
if len(args) != 0:
187+
print('reinitialize requires 0 args')
188+
sys.exit(1)
189+
pp.pprint(client.reinitialize())
190+
191+
elif cmd == 'shutdown':
192+
if len(args) != 0:
193+
print('shutdown requires 0 args')
194+
sys.exit(1)
195+
pp.pprint(client.shutdown())
196+
197+
else:
198+
print('Unrecognized method %s' % cmd)
199+
sys.exit(1)
200+
201+
transport.close()

0 commit comments

Comments
 (0)