| 1519 | |
| 1520 | |
| 1521 | class Pattern(object): |
| 1522 | |
| 1523 | def __init__(self, pattern): |
| 1524 | self.pattern = pattern |
| 1525 | self.compiled = None |
| 1526 | |
| 1527 | def match(self, str): |
| 1528 | if not self.compiled: |
| 1529 | pattern = "^" + self.pattern.replace('*', '.*') + "$" |
| 1530 | self.compiled = re.compile(pattern) |
| 1531 | return self.compiled.match(str) |
| 1532 | |
| 1533 | def __str__(self): |
| 1534 | return self.pattern |
| 1535 | |
| 1536 | |
| 1537 | def SplitPath(path_arg): |