~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-05-24 08:14:45 UTC
  • mfrom: (1725.1.1 benchmark)
  • mto: (1725.2.6 commit)
  • mto: This revision was merged to the branch mainline in revision 1729.
  • Revision ID: robertc@robertcollins.net-20060524081445-c046b4406ffc8dfa
(rbc)Merge in benchmark --lsprof-timed lsprofiling feature. (Robert Collins, Martin Pool).

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
   >>> from bzrlib.osutils import getcwd, dirname
 
5
   >>> import bzrlib.transport as transport
 
6
   >>> root = transport.get_transport("file:///")
 
7
   >>>
 
8
 
 
9
Each Transport instance represents a single logical directory.
 
10
 
 
11
   >>> dir = transport.get_transport(".")
 
12
   >>> dir.base == getcwd() + '/'
 
13
   True
 
14
 
 
15
You can change directories via the clone method:
 
16
 
 
17
   >>> parent = dir.clone('..')
 
18
   >>> parent.base == (dirname(getcwd()).rstrip('/') + '/')
 
19
   True