GRAYBYTE WORDPRESS FILE MANAGER8297

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/_vendor/autocommand/
Upload Files :
Current_dir [ Not Writeable ] Document_root [ Writeable ]

Command :


Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/setuptools/_vendor/autocommand//automain.py
# Copyright 2014-2015 Nathan West
#
# This file is part of autocommand.
#
# autocommand is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# autocommand is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with autocommand.  If not, see <http://www.gnu.org/licenses/>.

import sys
from .errors import AutocommandError


class AutomainRequiresModuleError(AutocommandError, TypeError):
    pass


def automain(module, *, args=(), kwargs=None):
    '''
    This decorator automatically invokes a function if the module is being run
    as the "__main__" module. Optionally, provide args or kwargs with which to
    call the function. If `module` is "__main__", the function is called, and
    the program is `sys.exit`ed with the return value. You can also pass `True`
    to cause the function to be called unconditionally. If the function is not
    called, it is returned unchanged by the decorator.

    Usage:

    @automain(__name__)  # Pass __name__ to check __name__=="__main__"
    def main():
        ...

    If __name__ is "__main__" here, the main function is called, and then
    sys.exit called with the return value.
    '''

    # Check that @automain(...) was called, rather than @automain
    if callable(module):
        raise AutomainRequiresModuleError(module)

    if module == '__main__' or module is True:
        if kwargs is None:
            kwargs = {}

        # Use a function definition instead of a lambda for a neater traceback
        def automain_decorator(main):
            sys.exit(main(*args, **kwargs))

        return automain_decorator
    else:
        return lambda main: main

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
May 15 2025 08:30:38
root / root
0755
__pycache__
--
May 15 2025 08:30:34
root / root
0755
__init__.py
1.013 KB
April 17 2025 13:10:58
root / root
0644
autoasync.py
5.547 KB
April 17 2025 13:10:58
root / root
0644
autocommand.py
2.446 KB
April 17 2025 13:10:58
root / root
0644
automain.py
2.027 KB
April 17 2025 13:10:58
root / root
0644
autoparse.py
11.369 KB
April 17 2025 13:10:58
root / root
0644
errors.py
0.865 KB
April 17 2025 13:10:58
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF