/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2006-02-28 04:31:50 UTC
  • mto: This revision was merged to the branch mainline in revision 1583.
  • Revision ID: robertc@robertcollins.net-20060228043150-fdb9c7f7231b271b
Bugfix aliases to be backwards compatible with plugins providing command.run_argv.

Show diffs side-by-side

added added

removed removed

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