forked from Rakshitha03/DBLP_processing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
superuser-init.py
262 lines (227 loc) · 8.64 KB
/
superuser-init.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
#!/usr/bin/python
"""
<<<<<<< e05208d8bebfb3e22cbe0ad88cf2306b18a48e74
This is the initialization script for dblp.org
added dblp directory and tutorial section
It should only be run ONCE to kick off the conference. It can only be run by the Super User.
"""
## Import statements
import argparse
import csv
import sys
from openreview import *
## Handle the arguments
parser = argparse.ArgumentParser()
parser.add_argument('--baseurl', help="base URL")
parser.add_argument('--overwrite',
help="If set to true, overwrites existing groups")
parser.add_argument('--username')
parser.add_argument('--password')
args = parser.parse_args()
## Initialize the client library with username and password
if args.username != None and args.password != None:
openreview = Client(baseurl=args.baseurl, username=args.username,
password=args.password)
else:
openreview = Client(baseurl=args.baseurl)
groups = []
overwrite = True if (
args.overwrite != None and args.overwrite.lower() == 'true') else False
def overwrite_allowed(groupid):
if not openreview.exists(groupid) or overwrite == True:
return True
else:
return False
if openreview.user['id'].lower() == 'openreview.net':
#########################
## SETUP GROUPS ##
#########################
if overwrite_allowed('DBLP.org'):
DBLP = Group('DBLP.org',
readers=['OpenReview.net'],
writers=['OpenReview.net', 'DBLP.org'],
signatures=['OpenReview.net'],
signatories=['DBLP.org'],
members=[])
groups.append(DBLP)
if overwrite_allowed('DBLP.org/upload'):
DBLP_upload = Group('DBLP.org/upload',
readers=['DBLP.org/upload'],
writers=['DBLP.org', 'DBLP.org/upload'],
signatures=['DBLP.org'],
signatories=['DBLP.org/upload'],
members=['spector@cs.umass.edu',
'mbok@cs.umass.edu', 'rbhat@cs.umass.edu',
'ngovindraja@cs.umass.edu', 'rbhat@umass.edu',
'asrinivasan@cs.umass.edu'])
groups.append(DBLP_upload)
## Post the groups
for g in groups:
print "Posting group: ", g.id
openreview.post_group(g)
reply = {
'forum': None,
'replyto': None,
'readers': {
'description': 'The users who will be allowed to read the above content.',
'values': ['everyone']
},
'signatures': {
'description': 'How your identity will be displayed with the above content.',
'values': ['DBLP.org/upload']
},
'writers': {
'values': ['DBLP.org/upload']
},
'content': {
'title': {
'description': 'Title of paper.',
'order': 1,
'value-regex': '.{0,300}',
'required': False
},
'abstract': {
'description': 'Abstract of paper.',
'order': 2,
'value-regex': '[\\S\\s]{0,5000}',
'required': False
},
'authors': {
'description': 'Comma separated list of author names, as they appear in the paper.',
'order': 2,
'values-regex': "[^;,\\n]+(,[^,\\n]+)*",
'required':True
},
'authorids': {
'description': 'Comma separated list of author email addresses, in the same order as above.',
'order': 3,
'values-regex': "[^;,\\n]+(,[^,\\n]+)*",
'required':True
},
'DBLP_url': {
'description': 'DBLP.org url associated with this paper',
'order': 3,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'isbn': {
'description': 'isbn number of this paper',
'order': 5,
'value-regex': '[^\\n]{0,20}',
'required': False
},
'ee': {
'description': 'electronic edition of the paper',
'order': 6,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'series': {
'description': 'The name of the series the volume is a part of',
'order': 5,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'mag_number': {
'description': 'The number of a journal, magazine, technical '
'report, or of a work in a series',
'order': 5,
'value-regex': '[^\\n]{0,20}',
'required': False
},
'month': {
'description': 'the month in which the paper or work was '
'published. 3 letter abbrevivation',
'order': 5,
'value-regex': '[a-zA-Z]{0,3}',
'required': False
},
'year': {
'description': 'year in which paper/journal was Published',
'order': 5,
'value-regex': '[^\\n]{0,20}',
'required': False
},
'booktitle': {
'description': 'Title of a book, part of which is being cited',
'order': 5,
'value-regex': '.{0,100}',
'required': False
},
'editors': {
'description': 'Comma separated list of editor names',
'order': 7,
'value-regex': '[^,\\n]*(,[^,\\n]+)*',
'required': False
},
'sub_type': {
'description': 'subtype of a technical report',
'order': 5,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'type': {
'description': 'The type of a technical report',
'order': 5,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'journal': {
'description': 'A journal name.',
'order': 5,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'volume': {
'description': 'The volume of a journal or multivolume book.',
'order': 5,
'value-regex': '[^\\n]{0,100}',
'required': False
},
'pages': {
'description': 'One or more page numbers or range of numbers',
'order': 5,
'value-regex': '[^\\n]{0,100}',
'required': False
},
'crossref': {
'description': 'The database key of the entry being cross referenced.',
'order': 5,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'chapter': {
'description': 'A chapter (or section or whatever) number',
'order': 5,
'value-regex': '[^\\n]{0,8}',
'required': False
},
'publisher': {
'description': 'The publisher\'s name.',
'order': 5,
'value-regex': '[^\\n]{0,250}',
'required': False
},
'school': {
'description': 'The name of the school where a thesis was written.',
'order': 5,
'value-regex': '[^\\n]{0,250}',
'required': False
},
}
}
submission_invitation = Invitation('DBLP.org',
'paper',
readers=['everyone'],
writers=['DBLP.org/upload'],
invitees=['DBLP.org/upload'],
signatures=['DBLP.org'],
reply=reply,
duedate=0,
# duedate of 0 means that the invitation has not been released
process='../process/dblp_process.js')
invitations = [submission_invitation]
## Post the invitations
for i in invitations:
print "Posting invitation: " + i.id
openreview.post_invitation(i)