Module Expr Str ImportFrom alias alias alias alias alias alias alias ImportFrom alias Import alias Import alias ImportFrom alias ImportFrom alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr Call NameLoad Assign AttributeStore NameLoad attr NameLoad Assign AttributeStore NameLoad attr ListLoad Assign AttributeStore NameLoad attr Dict decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad Return decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore ListComp Call AttributeLoad NameLoad attr NameLoad comprehension NameStore AttributeLoad NameLoad attr If NameLoad body Assign NameStore ListComp NameLoad comprehension NameStore NameLoad UnaryOpNot Call NameLoad NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr If Call NameLoad AttributeLoad NameLoad attr NameLoad body Assign NameStore Dict Str Str AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Assign NameStore AttributeLoad NameLoad attr For NameStore NameLoad body TryExcept body Assign NameStore SubscriptLoad NameLoad Index Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr keyword NameLoad keyword Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword NameLoad If CompareNotEq NameLoad Num body Raise Call NameLoad Str handlers ExceptHandler type NameLoad body Continue Return decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If AttributeLoad NameLoad attr body Assign NameStore Call NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Assign NameStore Call NameLoad NameLoad orelse Assign NameStore Call NameLoad NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr NameLoad handlers ExceptHandler type NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad For NameStore NameLoad body Assign NameStore Call AttributeLoad NameLoad attr NameLoad If BoolOpOr AttributeLoad NameLoad attr Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr Str Return decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str For TupleStore NameStore NameStore Call AttributeLoad AttributeLoad NameLoad attr attr body If BoolOpAnd Call NameLoad NameLoad NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr body For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad orelse If UnaryOpNot Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad If UnaryOpNot NameLoad body Assign NameStore Call NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If CompareNotEq SubscriptLoad AttributeLoad NameLoad attr Index Num Str body Assign NameStore BinOpAdd AttributeLoad NameLoad attr Str orelse Assign NameStore AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad Str Num decorator_list decorator_list
N/A N/A 
collectr.models
---------------

This module contains the main models used by collectr.

:copyright: (c) 2013 Cory Benfield
:license: MIT License, see LICENSE for details.

 utils tree_walk match_regexes move_path minified_filename get_extension default_minifier should_update_key exceptions MinifierError N/A re N/A subprocess boto.s3.connection S3Connection boto.exception S3ResponseError boto.s3.key Key StaticDir N/A object N/A N/A 
    This class represents a single directory or directory tree of static files.
    This class can be created by the user, or used internally in collectr.

    :param directory: The root of the directory tree.
     __init__ N/A N/A self directory N/A N/A N/A N/A self directory directory N/A N/A self input_directory None N/A N/A self minifier N/A default_minifier N/A N/A self force_update False N/A N/A self ignore N/A N/A N/A self metadata N/A N/A update N/A N/A self bucket_name N/A N/A N/A 
        Connect to S3 and update the bucket with the static files from the
        directory.

        :param bucket_name: The name of the S3 bucket to upload to.
         N/A N/A N/A self minify_files N/A files N/A N/A self enumerate_files N/A self directory N/A conn N/A N/A self connect_s3 N/A N/A N/A self upload_files files bucket_name conn N/A N/A enumerate_files N/A N/A self directory N/A N/A N/A 
        Enumerate all the files beneath a directory. Walks into all
        directories except for those created by version control.

        :param directory: The root of the tree.
         N/A files N/A tree_walk directory N/A files N/A N/A self filter_files files N/A files N/A filter_files N/A N/A self files N/A N/A N/A 
        Given a list of files, remove any that match any of a list of regular
        expressions.
         N/A tests N/A N/A N/A re compile x N/A x N/A self ignore N/A tests N/A N/A files N/A name N/A name files N/A N/A match_regexes tests name N/A files N/A minify_files N/A N/A self N/A N/A N/A 
        Takes all the files either in the main directory or the input directory
        and minifies them. If the files came from the input directory, moves
        them to the main directory.
         N/A N/A self input_directory N/A N/A files N/A N/A self enumerate_files N/A self input_directory N/A N/A files N/A N/A self enumerate_files N/A self directory N/A N/A isinstance N/A self minifier basestring N/A N/A minifier N/A css js N/A self minifier N/A self minifier N/A N/A minifier N/A self minifier N/A name files N/A N/A N/A N/A command N/A minifier N/A N/A get_extension name N/A command N/A N/A command format in_name name out_name N/A N/A self get_output_name name N/A rc N/A N/A subprocess call command shell True N/A N/A rc 0 N/A N/A N/A MinifierError Error occurred during minification. N/A N/A N/A KeyError N/A N/A N/A N/A get_output_name N/A N/A self input_filename N/A N/A N/A 
        When minifying a file, determine its output filename. This depends on
        whether it's being copied to a new directory.
         N/A N/A self input_directory N/A N/A filename N/A move_path N/A self input_directory N/A self directory input_filename N/A filename N/A minified_filename filename N/A N/A filename N/A minified_filename input_filename N/A filename N/A connect_s3 N/A N/A self N/A N/A N/A 
        Connect to S3. Returns the boto connection object.
         N/A N/A S3Connection N/A upload_files N/A N/A self files bucket_name connection N/A N/A N/A 
        Given a list of files, an Amazon S3 bucket and a connection, uploads
        the files to the bucket. If the bucket doesn't exist, creates it.
         N/A N/A N/A bucket N/A N/A connection get_bucket bucket_name N/A N/A N/A S3ResponseError N/A N/A bucket N/A N/A connection create_bucket bucket_name N/A path files N/A N/A key N/A N/A self find_or_create_key path N/A N/A N/A self force_update N/A should_update_key key path N/A N/A N/A N/A key set_contents_from_filename path N/A N/A metakey metavalue N/A N/A N/A self metadata iteritems N/A N/A N/A N/A key set_metadata metakey metavalue N/A N/A N/A key set_acl public-read N/A N/A apply_metadata N/A N/A self key N/A N/A N/A 
        Apply any expected metadata to an S3 key. If the value is a dict, the
        key is treated as a regular expression that must match the file path.
        Otherwise, the key and value are applied to all keys.
         N/A N/A metakey metavalue N/A N/A N/A self metadata iteritems N/A N/A N/A N/A isinstance metavalue dict N/A N/A re search metakey N/A key key N/A N/A N/A newkey newvalue N/A N/A metavalue iteritems N/A N/A N/A N/A key set_metadata newkey newvalue N/A N/A N/A N/A isinstance metavalue dict N/A N/A N/A N/A key set_metadata metakey metavalue N/A N/A find_or_create_key N/A N/A self path bucket N/A N/A N/A 
        For a given file, checks whether it's in the S3 bucket. If it is,
        returns the key object corresponding to it. If not, creates a new key
        and returns it.
         N/A name N/A N/A self key_name_from_path path N/A key N/A N/A bucket lookup name N/A N/A key N/A N/A key N/A Key bucket N/A N/A key key name N/A key N/A key_name_from_path N/A N/A self path N/A N/A N/A 
        Get the name of an S3 key from the path on the filesystem.
         N/A N/A N/A N/A self directory N/A -1 / N/A N/A temp_directory N/A N/A self directory / N/A N/A temp_directory N/A self directory N/A N/A N/A path replace temp_directory 1 N/A N/A