~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2012-10-25 11:13:27 UTC
  • mfrom: (6570.1.6 rubberstamp)
  • Revision ID: pqm@pqm.ubuntu.com-20121025111327-p0ylql0nh9fla0rs
(gz) Set approved revision and vote "Approve" when using lp-propose
 --approve (Jonathan Lange)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
The Transport API in bzrlib provides URL based access to network resources.
2
2
 
3
3
   >>> import os
 
4
   >>> import sys
4
5
   >>> from bzrlib.osutils import getcwd, dirname
5
6
   >>> from bzrlib.urlutils import local_path_from_url
6
7
   >>> import bzrlib.transport as transport
7
 
   >>> root = transport.get_transport("file:///")
 
8
   >>> if sys.platform == 'win32':
 
9
   ...     root = transport.get_transport_from_url('file:///C:/')
 
10
   ... else:
 
11
   ...     root = transport.get_transport_from_url('file:///')
8
12
   >>>
9
13
 
10
14
Each Transport instance represents a single logical directory.
11
15
 
12
 
   >>> dir = transport.get_transport(".")
 
16
   >>> dir = transport.get_transport_from_path(".")
13
17
   >>> local_path_from_url(dir.base) == getcwd() + '/'
14
18
   True
15
19