Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Validation function.  Matches a filename, expanding tildes as
appropriate

        def _parseFilename(s):
    """Validation function.  Matches a filename, expanding tildes as
       appropriate"""
    s = s.strip()
    if s[0] in "\"'":
        if s[-1] != s[0]:
            raise ConfigError("Mismatched quotes")
        s = s[1:-1]

    return os.path.expanduser(s)
        


src/m/i/mixminion-HEAD/lib/mixminion/test.py   mixminion(Download)
        self.assertEquals(C._parseNickname("Mrs-Premise"), "Mrs-Premise")
        # Filenames
        self.assertEquals(C._parseFilename(" ab/c/d"), "ab/c/d")
        self.assertEquals(C._parseFilename("  ~/ab/c/d"),
                          os.path.expanduser("~/ab/c/d"))
        self.assertEquals(C._parseFilename(" 'ab/c d/d' "), "ab/c d/d")
        self.assertEquals(C._parseFilename('  "ab/c d/d" '), "ab/c d/d")