title: .gitignore style fnmatch()
body: <p>What would be the simplest way to have .gitignore style fnmatch() with Python. Looks like that stdlib does not provide a match() function which would match a path spec against an UNIX style path regex.</p>
  
  <ul>
  <li><p>fnmatch() matches only pure filenames, no paths <a href="http://docs.python.org/library/fnmatch.html?highlight=fnmatch#fnmatch" rel="noreferrer">http://docs.python.org/library/fnmatch.html?highlight=fnmatch#fnmatch</a></p></li>
  <li><p>glob() will perform directory listing, and does not provide match() true/false style function <a href="http://docs.python.org/py3k/library/glob.html?highlight=glob#glob.glob" rel="noreferrer">http://docs.python.org/py3k/library/glob.html?highlight=glob#glob.glob</a></p></li>
  </ul>
  
  <p>.gitignore have both paths and files with wildcards to be (black)listed</p>
  
  <ul>
  <li><p><a href="https://github.com/miohtama/Krusovice/blob/master/.gitignore" rel="noreferrer">https://github.com/miohtama/Krusovice/blob/master/.gitignore</a></p></li>
  <li><p><a href="http://linux.die.net/man/5/gitignore" rel="noreferrer">http://linux.die.net/man/5/gitignore</a></p></li>
  </ul>