~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-05-08 01:57:31 UTC
  • mfrom: (1692.7.11 bzr.mbp.integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060508015731-cde475bafa628268
(mbp) Fix #43064, doc updates

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