PATH:
opt
/
alt
/
python33
/
lib64
/
python3.3
# Module 'os2emxpath' -- common operations on OS/2 pathnames """Common pathname manipulations, OS/2 EMX version. Instead of importing this module directly, import os and refer to this module as os.path. """ import os import stat from genericpath import * from ntpath import (expanduser, expandvars, isabs, islink, splitdrive, splitext, split) __all__ = ["normcase","isabs","join","splitdrive","split","splitext", "basename","dirname","commonprefix","getsize","getmtime", "getatime","getctime", "islink","exists","lexists","isdir","isfile", "ismount","expanduser","expandvars","normpath","abspath", "splitunc","curdir","pardir","sep","pathsep","defpath","altsep", "extsep","devnull","realpath","supports_unicode_filenames"] # strings representing various path-related bits and pieces curdir = '.' pardir = '..' extsep = '.' sep = '/' altsep = '\\' pathsep = ';' defpath = '.;C:\\bin' devnull = 'nul' # Normalize the case of a pathname and map slashes to backslashes. # Other normalizations (such as optimizing '../' away) are not done # (this is done by normpath). def normcase(s): """Normalize case of pathname. Makes all characters lowercase and all altseps into seps.""" if not isinstance(s, (bytes, str)): raise TypeError("normcase() argument must be str or bytes, " "not '{}'".format(s.__class__.__name__)) return s.replace('\\', '/').lower() # Join two (or more) paths. def join(a, *p): """Join two or more pathname components, inserting sep as needed""" path = a for b in p: if isabs(b): path = b elif path == '' or path[-1:] in '/\\:': path = path + b else: path = path + '/' + b return path # Parse UNC paths def splitunc(p): """Split a pathname into UNC mount point and relative path specifiers. Return a 2-tuple (unc, rest); either part may be empty. If unc is not empty, it has the form '//host/mount' (or similar using backslashes). unc+rest is always the input path. Paths containing drive letters never have an UNC part. """ if p[1:2] == ':': return '', p # Drive letter present firstTwo = p[0:2] if firstTwo == '/' * 2 or firstTwo == '\\' * 2: # is a UNC path: # vvvvvvvvvvvvvvvvvvvv equivalent to drive letter # \\machine\mountpoint\directories... # directory ^^^^^^^^^^^^^^^ normp = normcase(p) index = normp.find('/', 2) if index == -1: ##raise RuntimeError, 'illegal UNC path: "' + p + '"' return ("", p) index = normp.find('/', index + 1) if index == -1: index = len(p) return p[:index], p[index:] return '', p # Return the tail (basename) part of a path. def basename(p): """Returns the final component of a pathname""" return split(p)[1] # Return the head (dirname) part of a path. def dirname(p): """Returns the directory component of a pathname""" return split(p)[0] # alias exists to lexists lexists = exists # Is a path a directory? # Is a path a mount point? Either a root (with or without drive letter) # or an UNC path with at most a / or \ after the mount point. def ismount(path): """Test whether a path is a mount point (defined as root of drive)""" unc, rest = splitunc(path) if unc: return rest in ("", "/", "\\") p = splitdrive(path)[1] return len(p) == 1 and p[0] in '/\\' # Normalize a path, e.g. A//B, A/./B and A/foo/../B all become A/B. def normpath(path): """Normalize path, eliminating double slashes, etc.""" path = path.replace('\\', '/') prefix, path = splitdrive(path) while path[:1] == '/': prefix = prefix + '/' path = path[1:] comps = path.split('/') i = 0 while i < len(comps): if comps[i] == '.': del comps[i] elif comps[i] == '..' and i > 0 and comps[i-1] not in ('', '..'): del comps[i-1:i+1] i = i - 1 elif comps[i] == '' and i > 0 and comps[i-1] != '': del comps[i] else: i = i + 1 # If the path is now empty, substitute '.' if not prefix and not comps: comps.append('.') return prefix + '/'.join(comps) # Return an absolute path. def abspath(path): """Return the absolute version of a path""" if not isabs(path): path = join(os.getcwd(), path) return normpath(path) # realpath is a no-op on systems without islink support realpath = abspath supports_unicode_filenames = False
[+]
..
[-] opcode.py
[edit]
[-] token.py
[edit]
[-] keyword.py
[edit]
[-] runpy.py
[edit]
[-] smtplib.py
[edit]
[-] colorsys.py
[edit]
[+]
dbm
[-] posixpath.py
[edit]
[-] bz2.py
[edit]
[-] pydoc.py
[edit]
[-] pkgutil.py
[edit]
[-] warnings.py
[edit]
[-] sre_constants.py
[edit]
[-] ipaddress.py
[edit]
[-] pty.py
[edit]
[-] sched.py
[edit]
[-] copyreg.py
[edit]
[-] quopri.py
[edit]
[-] mailcap.py
[edit]
[+]
collections
[-] getpass.py
[edit]
[-] locale.py
[edit]
[-] nntplib.py
[edit]
[-] shlex.py
[edit]
[-] heapq.py
[edit]
[-] csv.py
[edit]
[+]
ctypes
[-] threading.py
[edit]
[-] pstats.py
[edit]
[+]
lib-dynload
[-] subprocess.py
[edit]
[-] linecache.py
[edit]
[-] crypt.py
[edit]
[-] base64.py
[edit]
[-] genericpath.py
[edit]
[-] platform.py
[edit]
[-] aifc.py
[edit]
[+]
curses
[+]
__pycache__
[-] codecs.py
[edit]
[-] mailbox.py
[edit]
[-] zipfile.py
[edit]
[-] doctest.py
[edit]
[-] string.py
[edit]
[+]
lib2to3
[-] ast.py
[edit]
[+]
multiprocessing
[-] os2emxpath.py
[edit]
[-] __future__.py
[edit]
[-] difflib.py
[edit]
[+]
wsgiref
[-] pickle.py
[edit]
[+]
distutils
[+]
importlib
[-] weakref.py
[edit]
[-] asynchat.py
[edit]
[-] random.py
[edit]
[-] _osx_support.py
[edit]
[-] imghdr.py
[edit]
[-] bdb.py
[edit]
[-] xdrlib.py
[edit]
[-] hashlib.py
[edit]
[+]
http
[+]
unittest
[-] abc.py
[edit]
[-] hmac.py
[edit]
[-] tokenize.py
[edit]
[-] imaplib.py
[edit]
[-] pdb.py
[edit]
[+]
plat-linux
[+]
logging
[-] contextlib.py
[edit]
[-] sunau.py
[edit]
[-] _strptime.py
[edit]
[-] queue.py
[edit]
[-] this.py
[edit]
[-] os.py
[edit]
[-] netrc.py
[edit]
[-] _threading_local.py
[edit]
[+]
test
[-] stat.py
[edit]
[-] pickletools.py
[edit]
[-] cmd.py
[edit]
[-] imp.py
[edit]
[-] telnetlib.py
[edit]
[-] uu.py
[edit]
[-] rlcompleter.py
[edit]
[-] sysconfig.py
[edit]
[-] chunk.py
[edit]
[-] _weakrefset.py
[edit]
[-] io.py
[edit]
[-] profile.py
[edit]
[-] socketserver.py
[edit]
[+]
sqlite3
[+]
idlelib
[-] decimal.py
[edit]
[-] __phello__.foo.py
[edit]
[-] copy.py
[edit]
[+]
html
[-] bisect.py
[edit]
[-] site.py
[edit]
[-] pprint.py
[edit]
[+]
venv
[-] optparse.py
[edit]
[-] pipes.py
[edit]
[-] _pyio.py
[edit]
[-] poplib.py
[edit]
[-] glob.py
[edit]
[-] configparser.py
[edit]
[+]
email
[-] fnmatch.py
[edit]
[-] pyclbr.py
[edit]
[-] antigravity.py
[edit]
[-] ftplib.py
[edit]
[-] dummy_threading.py
[edit]
[-] getopt.py
[edit]
[-] binhex.py
[edit]
[-] gettext.py
[edit]
[-] re.py
[edit]
[-] _dummy_thread.py
[edit]
[-] compileall.py
[edit]
[-] _sysconfigdata.py
[edit]
[+]
xmlrpc
[-] uuid.py
[edit]
[-] inspect.py
[edit]
[-] ntpath.py
[edit]
[-] fileinput.py
[edit]
[-] gzip.py
[edit]
[+]
site-packages
[-] symtable.py
[edit]
[-] dis.py
[edit]
[-] smtpd.py
[edit]
[-] asyncore.py
[edit]
[-] datetime.py
[edit]
[-] tempfile.py
[edit]
[-] _markupbase.py
[edit]
[-] functools.py
[edit]
[-] nturl2path.py
[edit]
[-] timeit.py
[edit]
[+]
json
[-] numbers.py
[edit]
[+]
urllib
[-] _compat_pickle.py
[edit]
[-] sre_compile.py
[edit]
[-] socket.py
[edit]
[-] cProfile.py
[edit]
[-] trace.py
[edit]
[-] argparse.py
[edit]
[-] traceback.py
[edit]
[-] calendar.py
[edit]
[-] struct.py
[edit]
[-] webbrowser.py
[edit]
[+]
encodings
[-] types.py
[edit]
[-] cgitb.py
[edit]
[-] tarfile.py
[edit]
[-] plistlib.py
[edit]
[-] macurl2path.py
[edit]
[-] textwrap.py
[edit]
[-] tty.py
[edit]
[-] fractions.py
[edit]
[-] modulefinder.py
[edit]
[-] mimetypes.py
[edit]
[-] shelve.py
[edit]
[+]
config-3.3m
[-] sndhdr.py
[edit]
[-] symbol.py
[edit]
[-] macpath.py
[edit]
[-] code.py
[edit]
[-] cgi.py
[edit]
[-] py_compile.py
[edit]
[-] wave.py
[edit]
[-] stringprep.py
[edit]
[-] reprlib.py
[edit]
[-] filecmp.py
[edit]
[-] sre_parse.py
[edit]
[-] formatter.py
[edit]
[-] lzma.py
[edit]
[+]
xml
[-] ssl.py
[edit]
[+]
concurrent
[-] shutil.py
[edit]
[-] codeop.py
[edit]
[+]
pydoc_data
[-] tabnanny.py
[edit]