-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchallonge_cli.py
131 lines (113 loc) · 2.56 KB
/
challonge_cli.py
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#import pycurl
#from StringIO import StringIO
import argparse
from challonge.tournament import *
#parser = argparse.ArgumentParser(description='Process some integers.')
#parser.add_argument('integers', metavar='N', type=int, nargs='+',
# help='an integer for the accumulator')
#parser.add_argument('--sum', dest='accumulate', action='store_const',
# const=sum, default=max,
# help='sum the integers (default: find the max)')
#
#args = parser.parse_args()
#print(args.accumulate(args.integers))
##curl part
#buffer = StringIO()
#c = pycurl.Curl()
#c.setopt(c.URL, 'https://$username:[email protected]/v1/')
#c.setopt(c.WRITEDATA, buffer)
#c.perform()
#c.close()
#
#body = buffer.getvalue()
## Body is a string in some encoding.
## In Python 2, we can print it without knowing what the encoding is.
#print(body)
def main():
t = Tournament(username='vinek', api_key='szhCM5VLKqatUbjre1rGR3hqgLmHYh1en8LJayK0');
#### Construct index
print(t.index(state=2,type=3))
print(t.create())
#### Construct create
#url=t._create(test=2,test2=3);
#print (url);
def usage():
print ' -------------------------------------------------------------------------'
print ' '
print ' '
print ' '
print ' '
print ' '
print ' Typical usage:'
print ' '
print ' '
print ' '
print ' '
print ' -------------------------------------------------------------------------'
sys.exit(' ')
#-------------------------------
if __name__ == "__main__":
main()
# def _create(*arg):
# return "create";
#
# def _show(*arg):
# return "show";
#
# def _update(*arg):
# return "update";
#
# def _destroy(*arg):
# return "destroy";
#
# def _process(*arg):
# return "process";
#
# def _abort(*arg):
# return "abort";
#
# def _start(*arg):
# print arg;
# return "start";
#
# def _finalize(*arg):
# return "finalize";
#
# def _reset(*arg):
# print "%s" list(arg);
# return "reset";
# Index
# * api_key
# state
# type
# created_after
# created_before
# subdomain
# Create
# * api_key
# tournament[name]
#
# Show
# Update
# Destroy
# Process
# Abort
# Start
# Finalize
# Reset
#Participants
# Index
# Create
# Bulk
# Show
# Update
# Check
# Destroy
# Randomize
#Matches
# Index
# Show
# Update
#