Changeset 4403:55ef14e89d1f in livinglogic.python.xist for src/ll/scripts/ucat.py

Show
Ignore:
Timestamp:
03/04/11 17:48:20 (9 years ago)
Author:
Walter Doerwald <walter@…>
Branch:
default
Message:

Fix -a/--all option: Match the file name not the complete patch.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/ll/scripts/ucat.py

    r4402 r4403  
    2727 
    2828def main(args=None): 
    29     def match(strurl): 
     29    def match(url): 
     30        strurl = str(url) 
    3031        if args.include is not None and args.include.search(strurl) is None: 
    3132            return False 
    3233        if args.exclude is not None and args.exclude.search(strurl) is not None: 
    3334            return False 
    34         if not args.all and strurl.startswith("."): 
     35        if not args.all and url.file.startswith("."): 
    3536            return False 
    3637        return True 
    3738 
    3839    def catone(urlread): 
    39         strurlread = str(urlread) 
    4040        if urlread.isdir(): 
    4141            if args.recursive: 
     
    4343                    catone(urlread/u) 
    4444            else: 
    45                 raise IOError(errno.EISDIR, "Is a directory", strurlread) 
     45                raise IOError(errno.EISDIR, "Is a directory", str(urlread)) 
    4646        else: 
    47             if match(strurlread): 
     47            if match(urlread): 
    4848                try: 
    4949                    with contextlib.closing(urlread.open("rb")) as fileread: