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

All Samples(2)  |  Call(0)  |  Derive(2)  |  Import(0)
Given a list of files and/or directories, this picks a random file.
Directories are searched for files matching any of a list of extensions.
Files are relative to our data directory plus a subclass-specified base path.

src/p/y/PyCAPTCHA-HEAD/Captcha/Visual/Text.py   PyCAPTCHA(Download)
class FontFactory(File.RandomFileFactory):
    """Picks random fonts and/or sizes from a given list.
       'sizes' can be a single size or a (min,max) tuple.
       If any of the given files are directories, all *.ttf found
       in that directory will be added.

src/p/y/PyCAPTCHA-HEAD/Captcha/Visual/Pictures.py   PyCAPTCHA(Download)
class ImageFactory(File.RandomFileFactory):
    """A factory that generates random images from a list"""
    extensions = [".png", ".jpeg"]
    basePath = "pictures"