Did I find the right examples for you? yes no

All Samples(2)  |  Call(1)  |  Derive(0)  |  Import(1)

        def safe_filename(filename):
    if not filename:
        return ''
    # filename = re.sub("([^a-zA-Z0-9\.\-\_\s\]\[+)", '_', filename)
    try:
        filename = re.sub('([\\\/\:\;\*\<\>\|\?\"\n\t\r]+)', '_', filename)
        filename = smart_str(filename)
    except TypeError, e:
        print "!!! ERROR -- filename: %s, Exception: %s" % (filename, e)
    MAX_FILENAME_LENGTH = 255
    THRESHOLD = 5
    if len(filename) > MAX_FILENAME_LENGTH + THRESHOLD:
        extension = get_extension(filename)
        filename = filename[:MAX_FILENAME_LENGTH] + '.' + extension
    return filename
        


src/p/y/pyHarp-0.1/pyharp/http_helper.py   pyHarp(Download)
from os.path import basename
from file_system import get_file_content, format_filesize
from file_naming import safe_filename
from time_helper import get_time
from queue_system import Job
    # create full path
    #===========================================================================
    localName = safe_filename(localName)
    # Create the temp folder, if not there
    file_path = '%s/%s' % (base_path, localName)