Home | History | Annotate | Download | only in server

Lines Matching refs:location

50 def get(location, local_copy = False):
54 location: the source of the material to get. This source may
61 The location of the file or directory where the requested
64 directory, the location will contain a trailing '/'
68 # location is a file-like object
69 if hasattr(location, "read"):
72 shutil.copyfileobj(location, tmpfileobj)
76 if isinstance(location, types.StringTypes):
77 # location is a URL
78 if location.startswith('http') or location.startswith('ftp'):
79 tmpfile = os.path.join(tmpdir, os.path.basename(location))
80 utils.urlretrieve(location, tmpfile)
82 # location is a local path
83 elif os.path.exists(os.path.abspath(location)):
85 if os.path.isdir(location):
86 return location.rstrip('/') + '/'
88 return location
89 tmpfile = os.path.join(tmpdir, os.path.basename(location))
90 if os.path.isdir(location):
92 shutil.copytree(location, tmpfile, symlinks=True)
94 shutil.copyfile(location, tmpfile)
96 # location is just a string, dump it to a file
100 tmpfileobj.write(location)