PATH: //lib64/python3.9
FILE_BARU
CREATE
FOLDER_BARU
MKDIR
UPLOAD_FILE
GO
[ .. KEMBALI ]
📄 LICENSE.txt
↓
X
📄 __future__.py
↓
X
📄 __phello__.foo.py
↓
X
📁 __pycache__/
X
📄 _aix_support.py
↓
X
📄 _bootlocale.py
↓
X
📄 _bootsubprocess.py
↓
X
📄 _collections_abc.py
↓
X
📄 _compat_pickle.py
↓
X
📄 _compression.py
↓
X
📄 _markupbase.py
↓
X
📄 _osx_support.py
↓
X
📄 _py_abc.py
↓
X
📄 _pydecimal.py
↓
X
📄 _pyio.py
↓
X
📄 _sitebuiltins.py
↓
X
📄 _strptime.py
↓
X
📄 _sysconfigdata__linux_x86_64-linux-gnu.py
↓
X
📄 _threading_local.py
↓
X
📄 _weakrefset.py
↓
X
📄 abc.py
↓
X
📄 aifc.py
↓
X
📄 antigravity.py
↓
X
📄 argparse.py
↓
X
📄 ast.py
↓
X
📄 asynchat.py
↓
X
📁 asyncio/
X
📄 asyncore.py
↓
X
📄 base64.py
↓
X
📄 bdb.py
↓
X
📄 binhex.py
↓
X
📄 bisect.py
↓
X
📄 bz2.py
↓
X
📄 cProfile.py
↓
X
📄 calendar.py
↓
X
📄 cgi.py
↓
X
📄 cgitb.py
↓
X
📄 chunk.py
↓
X
📄 cmd.py
↓
X
📄 code.py
↓
X
📄 codecs.py
↓
X
📄 codeop.py
↓
X
📁 collections/
X
📄 colorsys.py
↓
X
📄 compileall.py
↓
X
📁 concurrent/
X
📁 config-3.9-x86_64-linux-gnu/
X
📄 configparser.py
↓
X
📄 contextlib.py
↓
X
📄 contextvars.py
↓
X
📄 copy.py
↓
X
📄 copyreg.py
↓
X
📄 crypt.py
↓
X
📄 csv.py
↓
X
📁 ctypes/
X
📁 curses/
X
📄 dataclasses.py
↓
X
📄 datetime.py
↓
X
📁 dbm/
X
📄 decimal.py
↓
X
📄 difflib.py
↓
X
📄 dis.py
↓
X
📁 distutils/
X
📄 doctest.py
↓
X
📁 email/
X
📁 encodings/
X
📁 ensurepip/
X
📄 enum.py
↓
X
📄 filecmp.py
↓
X
📄 fileinput.py
↓
X
📄 fnmatch.py
↓
X
📄 formatter.py
↓
X
📄 fractions.py
↓
X
📄 ftplib.py
↓
X
📄 functools.py
↓
X
📄 genericpath.py
↓
X
📄 getopt.py
↓
X
📄 getpass.py
↓
X
📄 gettext.py
↓
X
📄 glob.py
↓
X
📄 graphlib.py
↓
X
📄 gzip.py
↓
X
📄 hashlib.py
↓
X
📄 heapq.py
↓
X
📄 hmac.py
↓
X
📁 html/
X
📁 http/
X
📄 imaplib.py
↓
X
📄 imghdr.py
↓
X
📄 imp.py
↓
X
📁 importlib/
X
📄 inspect.py
↓
X
📄 io.py
↓
X
📄 ipaddress.py
↓
X
📁 json/
X
📄 keyword.py
↓
X
📁 lib-dynload/
X
📁 lib2to3/
X
📄 linecache.py
↓
X
📄 locale.py
↓
X
📁 logging/
X
📄 lzma.py
↓
X
📄 mailbox.py
↓
X
📄 mailcap.py
↓
X
📄 mimetypes.py
↓
X
📄 modulefinder.py
↓
X
📁 multiprocessing/
X
📄 netrc.py
↓
X
📄 nntplib.py
↓
X
📄 ntpath.py
↓
X
📄 nturl2path.py
↓
X
📄 numbers.py
↓
X
📄 opcode.py
↓
X
📄 operator.py
↓
X
📄 optparse.py
↓
X
📄 os.py
↓
X
📄 pathlib.py
↓
X
📄 pdb.py
↓
X
📄 pickle.py
↓
X
📄 pickletools.py
↓
X
📄 pipes.py
↓
X
📄 pkgutil.py
↓
X
📄 platform.py
↓
X
📄 plistlib.py
↓
X
📄 poplib.py
↓
X
📄 posixpath.py
↓
X
📄 pprint.py
↓
X
📄 profile.py
↓
X
📄 pstats.py
↓
X
📄 pty.py
↓
X
📄 py_compile.py
↓
X
📄 pyclbr.py
↓
X
📄 pydoc.py
↓
X
📁 pydoc_data/
X
📄 queue.py
↓
X
📄 quopri.py
↓
X
📄 random.py
↓
X
📄 re.py
↓
X
📄 reprlib.py
↓
X
📄 rlcompleter.py
↓
X
📄 runpy.py
↓
X
📄 sched.py
↓
X
📄 secrets.py
↓
X
📄 selectors.py
↓
X
📄 shelve.py
↓
X
📄 shlex.py
↓
X
📄 shutil.py
↓
X
📄 signal.py
↓
X
📁 site-packages/
X
📄 site.py
↓
X
📄 smtpd.py
↓
X
📄 smtplib.py
↓
X
📄 sndhdr.py
↓
X
📄 socket.py
↓
X
📄 socketserver.py
↓
X
📁 sqlite3/
X
📄 sre_compile.py
↓
X
📄 sre_constants.py
↓
X
📄 sre_parse.py
↓
X
📄 ssl.py
↓
X
📄 stat.py
↓
X
📄 statistics.py
↓
X
📄 string.py
↓
X
📄 stringprep.py
↓
X
📄 struct.py
↓
X
📄 subprocess.py
↓
X
📄 sunau.py
↓
X
📄 symbol.py
↓
X
📄 symtable.py
↓
X
📄 sysconfig.py
↓
X
📄 tabnanny.py
↓
X
📄 tarfile.py
↓
X
📄 telnetlib.py
↓
X
📄 tempfile.py
↓
X
📄 textwrap.py
↓
X
📄 this.py
↓
X
📄 threading.py
↓
X
📄 timeit.py
↓
X
📁 tkinter/
X
📄 token.py
↓
X
📄 tokenize.py
↓
X
📄 trace.py
↓
X
📄 traceback.py
↓
X
📄 tracemalloc.py
↓
X
📄 tty.py
↓
X
📄 turtle.py
↓
X
📁 turtledemo/
X
📄 types.py
↓
X
📄 typing.py
↓
X
📁 unittest/
X
📁 urllib/
X
📄 uu.py
↓
X
📄 uuid.py
↓
X
📁 venv/
X
📄 warnings.py
↓
X
📄 wave.py
↓
X
📄 weakref.py
↓
X
📄 webbrowser.py
↓
X
📁 wsgiref/
X
📄 xdrlib.py
↓
X
📁 xml/
X
📁 xmlrpc/
X
📄 zipapp.py
↓
X
📄 zipfile.py
↓
X
📄 zipimport.py
↓
X
📁 zoneinfo/
X
SAVING...
BERHASIL DIUBAH!
EDITING: netrc.py
"""An object-oriented interface to .netrc files.""" # Module and documentation by Eric S. Raymond, 21 Dec 1998 import os, shlex, stat __all__ = ["netrc", "NetrcParseError"] class NetrcParseError(Exception): """Exception raised on syntax errors in the .netrc file.""" def __init__(self, msg, filename=None, lineno=None): self.filename = filename self.lineno = lineno self.msg = msg Exception.__init__(self, msg) def __str__(self): return "%s (%s, line %s)" % (self.msg, self.filename, self.lineno) class netrc: def __init__(self, file=None): default_netrc = file is None if file is None: file = os.path.join(os.path.expanduser("~"), ".netrc") self.hosts = {} self.macros = {} with open(file) as fp: self._parse(file, fp, default_netrc) def _parse(self, file, fp, default_netrc): lexer = shlex.shlex(fp) lexer.wordchars += r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~""" lexer.commenters = lexer.commenters.replace('#', '') while 1: # Look for a machine, default, or macdef top-level keyword saved_lineno = lexer.lineno toplevel = tt = lexer.get_token() if not tt: break elif tt[0] == '#': if lexer.lineno == saved_lineno and len(tt) == 1: lexer.instream.readline() continue elif tt == 'machine': entryname = lexer.get_token() elif tt == 'default': entryname = 'default' elif tt == 'macdef': # Just skip to end of macdefs entryname = lexer.get_token() self.macros[entryname] = [] lexer.whitespace = ' \t' while 1: line = lexer.instream.readline() if not line or line == '\012': lexer.whitespace = ' \t\r\n' break self.macros[entryname].append(line) continue else: raise NetrcParseError( "bad toplevel token %r" % tt, file, lexer.lineno) # We're looking at start of an entry for a named machine or default. login = '' account = password = None self.hosts[entryname] = {} while 1: tt = lexer.get_token() if (tt.startswith('#') or tt in {'', 'machine', 'default', 'macdef'}): if password: self.hosts[entryname] = (login, account, password) lexer.push_token(tt) break else: raise NetrcParseError( "malformed %s entry %s terminated by %s" % (toplevel, entryname, repr(tt)), file, lexer.lineno) elif tt == 'login' or tt == 'user': login = lexer.get_token() elif tt == 'account': account = lexer.get_token() elif tt == 'password': if os.name == 'posix' and default_netrc: prop = os.fstat(fp.fileno()) if prop.st_uid != os.getuid(): import pwd try: fowner = pwd.getpwuid(prop.st_uid)[0] except KeyError: fowner = 'uid %s' % prop.st_uid try: user = pwd.getpwuid(os.getuid())[0] except KeyError: user = 'uid %s' % os.getuid() raise NetrcParseError( ("~/.netrc file owner (%s) does not match" " current user (%s)") % (fowner, user), file, lexer.lineno) if (prop.st_mode & (stat.S_IRWXG | stat.S_IRWXO)): raise NetrcParseError( "~/.netrc access too permissive: access" " permissions must restrict access to only" " the owner", file, lexer.lineno) password = lexer.get_token() else: raise NetrcParseError("bad follower token %r" % tt, file, lexer.lineno) def authenticators(self, host): """Return a (user, account, password) tuple for given host.""" if host in self.hosts: return self.hosts[host] elif 'default' in self.hosts: return self.hosts['default'] else: return None def __repr__(self): """Dump the class data in the format of a .netrc file.""" rep = "" for host in self.hosts.keys(): attrs = self.hosts[host] rep += f"machine {host}\n\tlogin {attrs[0]}\n" if attrs[1]: rep += f"\taccount {attrs[1]}\n" rep += f"\tpassword {attrs[2]}\n" for macro in self.macros.keys(): rep += f"macdef {macro}\n" for line in self.macros[macro]: rep += line rep += "\n" return rep if __name__ == '__main__': print(netrc())
SIMPAN PERUBAHAN