~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/doc/api/transport.txt

  • Committer: Robert Collins
  • Date: 2005-12-24 02:20:45 UTC
  • mto: (1185.50.57 bzr-jam-integration)
  • mto: This revision was merged to the branch mainline in revision 1550.
  • Revision ID: robertc@robertcollins.net-20051224022045-14efc8dfa0e1a4e9
Start tests for api usage.

Show diffs side-by-side

added added

removed removed

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