ckan/lib/cli.py
def minify_file(self, path):
        '''Create the minified version of the given file.

        If the file is not a .js or .css file (e.g. it's a .min.js or .min.css
        file, or it's some other type of file entirely) it will not be
        minifed.

        :param path: The path to the .js or .css file to minify

        '''
        import ckan.lib.fanstatic_resources as fanstatic_resources

        path_only, extension = os.path.splitext(path)

        if path_only.endswith('.min'):
            # This is already a minified file.
            return

        if extension not in ('.css', '.js'):
            # This is not a js or css file.
            return

        path_min = fanstatic_resources.min_path(path)

        source = open(path, 'r').read()
        f = open(path_min, 'w')
        if path.endswith('.css'):
            f.write(rcssmin.cssmin(source))
        elif path.endswith('.js'):
            f.write(rjsmin.jsmin(source))
        f.close()
        print("Minified file '{0}'".format(path))
Create the minified version of the given file.

        If the file is not a .js or .css file (e.g. it's a .min.js or .min.css
        file, or it's some other type of file entirely) it will not be
        minifed.

        :param path: The path to the .js or .css file to minify

        
Create the minified version of the given file.
If the file is not a .js or .css file  it will not be
minifed.
Create the minified version of the given file . If the file is not a . js or . css file it will not be minifed .
def minify_file(self, path):
        import ckan.lib.fanstatic_resources as fanstatic_resources
        path_only, extension = os.path.splitext(path)
        if path_only.endswith('.min'):
            return
        if extension not in ('.css', '.js'):
            return
        path_min = fanstatic_resources.min_path(path)
        source = open(path, 'r').read()
        f = open(path_min, 'w')
        if path.endswith('.css'):
            f.write(rcssmin.cssmin(source))
        elif path.endswith('.js'):
            f.write(rjsmin.jsmin(source))
        f.close()
        print("Minified file '{0}'".format(path))
def minify_file ( self , path ) : import ckan . lib . fanstatic_resources as fanstatic_resources path_only , extension = os . path . splitext ( path ) if path_only . endswith ( '.min' ) : return if extension not in ( '.css' , '.js' ) : return path_min = fanstatic_resources . min_path ( path ) source = open ( path , 'r' ) . read ( ) f = open ( path_min , 'w' ) if path . endswith ( '.css' ) : f . write ( rcssmin . cssmin ( source ) ) elif path . endswith ( '.js' ) : f . write ( rjsmin . jsmin ( source ) ) f . close ( ) print ( "Minified file '{0}'" . format ( path ) )
Create the minified version of the given file.
Create the minified version of the given file .
'''Create the minified version of the given file.

        If the file is not a .js or .css file (e.g. it's a .min.js or .min.css
        file, or it's some other type of file entirely) it will not be
        minifed.

        :param path: The path to the .js or .css file to minify

        ''' # This is already a minified file. # This is not a js or css file.
self
path
The path to the .js or .css file to minify
The path to the . js or . css file to minify