p!ranha?
Server IP : 103.169.32.36  /  Your IP : 216.73.217.13
Web Server : Apache
System : Linux web.dpmptsp 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python2.7/site-packages/iniparse/

Upload File :
Curr3nt_D!r [ Writeable ] D0cum3nt_r0Ot [ Writeable ]

 
Command :
Current File : /lib/python2.7/site-packages/iniparse/utils.py
import compat
from ini import LineContainer, EmptyLine

def tidy(cfg):
    """Clean up blank lines.

    This functions makes the configuration look clean and
    handwritten - consecutive empty lines and empty lines at
    the start of the file are removed, and one is guaranteed
    to be at the end of the file.
    """

    if isinstance(cfg, compat.RawConfigParser):
        cfg = cfg.data
    cont = cfg._data.contents
    i = 1
    while i < len(cont):
        if isinstance(cont[i], LineContainer):
            tidy_section(cont[i])
            i += 1
        elif (isinstance(cont[i-1], EmptyLine) and
              isinstance(cont[i], EmptyLine)):
            del cont[i]
        else:
            i += 1

    # Remove empty first line
    if cont and isinstance(cont[0], EmptyLine):
        del cont[0]

    # Ensure a last line
    if cont and not isinstance(cont[-1], EmptyLine):
        cont.append(EmptyLine())

def tidy_section(lc):
    cont = lc.contents
    i = 1
    while i < len(cont):
        if (isinstance(cont[i-1], EmptyLine) and
            isinstance(cont[i], EmptyLine)):
            del cont[i]
        else:
            i += 1

    # Remove empty first line
    if len(cont) > 1 and isinstance(cont[1], EmptyLine):
        del cont[1]
N4m3
5!z3
L45t M0d!f!3d
0wn3r / Gr0up
P3Rm!55!0n5
0pt!0n5
..
--
December 21 2023 09:18:24
0 / 0
0755
__init__.py
1.085 KB
May 08 2010 19:36:42
0 / 0
0644
__init__.pyc
0.923 KB
June 09 2014 22:04:54
0 / 0
0644
__init__.pyo
0.923 KB
June 09 2014 22:04:54
0 / 0
0644
compat.py
11.818 KB
May 08 2010 00:51:42
0 / 0
0644
compat.pyc
12.545 KB
June 09 2014 22:04:54
0 / 0
0644
compat.pyo
12.545 KB
June 09 2014 22:04:54
0 / 0
0644
config.py
8.112 KB
May 08 2010 19:55:43
0 / 0
0644
config.pyc
9.374 KB
June 09 2014 22:04:54
0 / 0
0644
config.pyo
9.374 KB
June 09 2014 22:04:54
0 / 0
0644
ini.py
20.172 KB
June 09 2014 22:04:54
0 / 0
0644
ini.pyc
19.943 KB
June 09 2014 22:04:54
0 / 0
0644
ini.pyo
19.943 KB
June 09 2014 22:04:54
0 / 0
0644
utils.py
1.236 KB
May 08 2010 19:36:42
0 / 0
0644
utils.pyc
1.393 KB
June 09 2014 22:04:54
0 / 0
0644
utils.pyo
1.393 KB
June 09 2014 22:04:54
0 / 0
0644