1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
The Transport API in bzrlib provides URL based access to network resources.
>>> import os
>>> from bzrlib.osutils import getcwd, dirname
>>> import bzrlib.transport as transport
>>> root = transport.get_transport("file:///")
>>>
Each Transport instance represents a single logical directory.
>>> dir = transport.get_transport(".")
>>> dir.base == getcwd() + '/'
True
You can change directories via the clone method:
>>> parent = dir.clone('..')
>>> parent.base == (dirname(getcwd()).rstrip('/') + '/')
True
|