PHP 8.5.2
Preview: cli.py Size: 1.25 KB
//lib/python3/dist-packages/netaddr/cli.py

#!/usr/bin/env python
#-----------------------------------------------------------------------------
#   Copyright (c) 2008 by David P. D. Moss. All rights reserved.
#
#   Released under the BSD license. See the LICENSE file for details.
#-----------------------------------------------------------------------------
"""an interactive shell for the netaddr library"""

import os
import sys
import netaddr
from netaddr import *

#   aliases to save some typing ...
from netaddr import IPAddress as IP, IPNetwork as CIDR
from netaddr import EUI as MAC

def main():
    argv = sys.argv[1:]

    banner = "\nnetaddr shell %s - %s\n" % (netaddr.__version__, __doc__)
    exit_msg = "\nShare and enjoy!"
    rc_override = None

    try:
        try:
            # ipython >= 0.11
            from IPython.terminal.embed import InteractiveShellEmbed
            ipshell = InteractiveShellEmbed(banner1=banner, exit_msg=exit_msg)
        except ImportError:
            # ipython < 0.11
            from IPython.Shell import IPShellEmbed
            ipshell = IPShellEmbed(argv, banner, exit_msg, rc_override)
    except ImportError:
        sys.stderr.write('IPython (http://ipython.scipy.org/) not found!\n')
        sys.exit(1)

    ipshell()


if __name__ == '__main__':
    main()

Directory Contents

Dirs: 5 × Files: 5

Name Size Perms Modified Actions
contrib DIR
- drwxr-xr-x 2026-01-08 12:56:25
Edit Download
eui DIR
- drwxr-xr-x 2026-01-08 12:56:25
Edit Download
ip DIR
- drwxr-xr-x 2026-01-08 12:56:25
Edit Download
strategy DIR
- drwxr-xr-x 2026-01-08 12:56:25
Edit Download
- drwxr-xr-x 2026-01-08 12:56:25
Edit Download
1.25 KB lrw-r--r-- 2020-06-22 10:41:23
Edit Download
2.16 KB lrw-r--r-- 2020-06-23 10:05:23
Edit Download
5.76 KB lrw-r--r-- 2020-06-15 16:03:00
Edit Download
8.05 KB lrw-r--r-- 2020-06-22 10:41:23
Edit Download
1.81 KB lrw-r--r-- 2020-07-03 14:41:59
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).