blob: 22459a18113a25d6eadd7135e892c8306e63e7af [file] [log] [blame]
Guido van Rossum8bcd3011995-04-28 14:31:36 +00001"Customize this file to change the default client etc."
2
3import string
4
5HOST = 'voorn.cwi.nl'
6PORT = 4127
7DIRECTORY = '/ufs/guido/voorn/python-RCS/Demo/pdist'
8VERBOSE = 1
9
10def openrcsclient(opts = []):
11 "open an RCSProxy client based on a list of options returned by getopt"
12 import RCSProxy
13 host = HOST
14 port = PORT
15 directory = DIRECTORY
16 verbose = VERBOSE
17 for o, a in opts:
18 if o == '-h':
19 host = a
20 if ':' in host:
21 i = string.find(host, ':')
22 host, p = host[:i], host[i+1:]
23 if p:
24 port = string.atoi(p)
25 if o == '-p':
26 port = string.atoi(a)
27 if o == '-d':
28 directory = a
29 if o == '-v':
30 verbose = verbose + 1
31 if o == '-q':
32 verbose = 0
33 address = (host, port)
34 x = RCSProxy.RCSProxyClient(address, verbose)
35 if directory:
36 x.cd(directory)
37 return x