[Patch] Updated support for external command handlers
Aaron Bentley
aaron.bentley at utoronto.ca
Mon May 9 17:41:53 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Michael Ellerman wrote:
| + for dir in bzrpath.split(':'):
| + path = os.path.join(dir, cmd)
| + if os.path.isfile(path):
| + return ExternalCommand(path)
Since subcommands may be delivered as bzr trees, I think it would be
nice to support subdirectories in bzrpathdirs.
e.g. (untested code)
def iter_bzrdirs(bzrpath)
~ for dir in bzrpath.split(':'):
~ yield dir
~ for subdir in listdir(dir)
~ path = os.path.join(subdir)
~ if os.path.isdir(path):
~ yield path
for dir in iter_bzrdirs(bzrpath):
~ path = os.path.join(dir, cmd)
~ if os.path.isfile(path):
return ExternalCommand(path)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.5 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCf5LQ0F+nu1YWqI0RAiqxAKCCWpjvJH6khY+YgGPX+GI5pPtWxwCfaQ90
/qoFJkO6v05U186SnIytUFE=
=g6i5
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list