<commit_before>import socket
import sublime
import sublime_plugin

INFO = '''
Platform:        %(platform)s
Hostname:        %(hostname)s
Sublime Version: %(version)s
Architecture:    %(arch)s
IP:              %(ip)s
'''


class SublimeInfoCommand(sublime_plugin.ApplicationCommand):
    def run(self):
        info = {
            "platform": sublime.platform(),
            "hostname": socket.gethostname().lower(),
            "version": sublime.version(),
            "arch": sublime.arch(),
            "ip": socket.gethostbyname(socket.gethostname())
        }

        msg = INFO % info

        # Show in a dialog, console, and copy to clipboard
        sublime.message_dialog(msg)
        sublime.set_clipboard(msg)
        print("\nSublimeInfo: %s" % msg)<commit_msg>Add external ip<commit_after>import socket
import sublime
import sublime_plugin
import urllib.request as urllibReq
import traceback


INFO = '''
Platform:        %(platform)s
Hostname:        %(hostname)s
Sublime Version: %(version)s
Architecture:    %(arch)s
IP:              %(ip)s
External IP:     %(e_ip)s
'''


def external_ip():
    e_ip = "???"
    try:
        with urllibReq.urlopen("http://myip.dnsdynamic.org/") as url:
            e_ip = url.read().decode("utf-8")
    except:
        print(traceback.format_exc())
    return e_ip


class SublimeInfoCommand(sublime_plugin.ApplicationCommand):
    def run(self):
        info = {
            "platform": sublime.platform(),
            "hostname": socket.gethostname().lower(),
            "version": sublime.version(),
            "arch": sublime.arch(),
            "ip": socket.gethostbyname(socket.gethostname()),
            "e_ip": external_ip()
        }

        msg = INFO % info

        # Show in a dialog, console, and copy to clipboard
        sublime.message_dialog(msg)
        sublime.set_clipboard(msg)
        print("\nSublimeInfo: %s" % msg)
{'fraction_non_alphanumeric': 0.1300684570826751, 'fraction_numerical': 0.000526592943654555, 'mean_word_length': 2.4234234234234235, 'pattern_counts': {'":': 11, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1626516', 'n_tokens_mistral': 607, 'n_tokens_neox': 592, 'n_words': 126}