mirror of
https://github.com/python/cpython.git
synced 2025-08-02 16:13:13 +00:00
get default directory from CVS/Repository
This commit is contained in:
parent
330e884082
commit
177df7d7c9
1 changed files with 12 additions and 2 deletions
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
import string
|
import string
|
||||||
|
|
||||||
|
# These defaults don't belong here -- they should be taken from the
|
||||||
|
# environment or from a hidden file in the current directory
|
||||||
|
|
||||||
HOST = 'voorn.cwi.nl'
|
HOST = 'voorn.cwi.nl'
|
||||||
PORT = 4127
|
PORT = 4127
|
||||||
DIRECTORY = '/ufs/guido/voorn/python-RCS/Demo/pdist'
|
|
||||||
VERBOSE = 1
|
VERBOSE = 1
|
||||||
|
|
||||||
def openrcsclient(opts = []):
|
def openrcsclient(opts = []):
|
||||||
|
@ -12,8 +14,8 @@ def openrcsclient(opts = []):
|
||||||
import RCSProxy
|
import RCSProxy
|
||||||
host = HOST
|
host = HOST
|
||||||
port = PORT
|
port = PORT
|
||||||
directory = DIRECTORY
|
|
||||||
verbose = VERBOSE
|
verbose = VERBOSE
|
||||||
|
directory = None
|
||||||
for o, a in opts:
|
for o, a in opts:
|
||||||
if o == '-h':
|
if o == '-h':
|
||||||
host = a
|
host = a
|
||||||
|
@ -32,6 +34,14 @@ def openrcsclient(opts = []):
|
||||||
verbose = 0
|
verbose = 0
|
||||||
address = (host, port)
|
address = (host, port)
|
||||||
x = RCSProxy.RCSProxyClient(address, verbose)
|
x = RCSProxy.RCSProxyClient(address, verbose)
|
||||||
|
if not directory:
|
||||||
|
try:
|
||||||
|
directory = open("CVS/Repository").readline()
|
||||||
|
except IOError:
|
||||||
|
pass
|
||||||
|
else:
|
||||||
|
if directory[-1] == '\n':
|
||||||
|
directory = directory[:-1]
|
||||||
if directory:
|
if directory:
|
||||||
x.cd(directory)
|
x.cd(directory)
|
||||||
return x
|
return x
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue