/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/win32utils.py

  • Committer: Gordon Tyler
  • Date: 2010-02-02 06:39:31 UTC
  • mto: (5037.3.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5046.
  • Revision ID: gordon@doxxx.net-20100202063931-n6z2ehfpe10rty9m
Simplified win32utils.command_line_to_argv and made it private since it's no longer used outside of the module.

Show diffs side-by-side

added added

removed removed

Lines of Context:
518
518
            trace.mutter('Unable to set hidden attribute on %r: %s', path, e)
519
519
 
520
520
 
521
 
def command_line_to_argv(command_line, wildcard_expansion=True,
522
 
                         single_quotes_allowed=False):
 
521
def _command_line_to_argv(command_line, single_quotes_allowed=False):
523
522
    """Convert a Unicode command line into a list of argv arguments.
524
523
 
525
 
    This optionally does wildcard expansion, etc. It is intended to make
526
 
    wildcards act closer to how they work in posix shells, versus how they
527
 
    work by default on Windows. Quoted arguments are left untouched.
 
524
    It performs wildcard expansion to make wildcards act closer to how they
 
525
    work in posix shells, versus how they work by default on Windows. Quoted
 
526
    arguments are left untouched.
528
527
 
529
528
    :param command_line: The unicode string to split into an arg list.
530
 
    :param wildcard_expansion: Whether wildcard expansion should be applied to
531
 
                               each argument. True by default.
532
529
    :param single_quotes_allowed: Whether single quotes are accepted as quoting
533
530
                                  characters like double quotes. False by
534
531
                                  default.
540
537
    #       '**/' style globs
541
538
    args = []
542
539
    for is_quoted, arg in s:
543
 
        if is_quoted or not glob.has_magic(arg) or not wildcard_expansion:
 
540
        if is_quoted or not glob.has_magic(arg):
544
541
            args.append(arg)
545
542
        else:
546
543
            args.extend(glob_one(arg))
556
553
        if command_line is None:
557
554
            raise ctypes.WinError()
558
555
        # Skip the first argument, since we only care about parameters
559
 
        argv = command_line_to_argv(command_line)[1:]
 
556
        argv = _command_line_to_argv(command_line)[1:]
560
557
        if getattr(sys, 'frozen', None) is None:
561
558
            # Invoked via 'python.exe' which takes the form:
562
559
            #   python.exe [PYTHON_OPTIONS] C:\Path\bzr [BZR_OPTIONS]