<commit_before>#!/usr/bin/env python
'''
NOX GUI
This file creates the main application window, sets up the layout and invokes
the GUI's widgets.
The left panel (log) is used for displaying context-specific information.
The right panel (topology) is an interactive display of the topology
The bottom right pane (console) is a frontend for communication with
jsonmessenger.

@author <NAME> (<EMAIL>)
'''

import struct
import sys
import getopt

from PyQt4 import QtGui, QtCore

import gui.log as log
import gui.info as info
import gui.topology as topology
import gui.console as console
import gui.Popup as Popup
import gui.settings as settings
from gui.communication import Communication
import signal

class MainWindow(QtGui.QMainWindow):

    def usage(self):
        """Print usage information
        """
        print "Usage "+sys.argv[0]+" <options> [IP address | default to localhost]"
        print  "Options:"
        print "-h/--help\n\tPrint this usage guide"
        print "-p/--port\n\tPort to connect to"

    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        #Parse options and commandline arguments
        try:
            opts, args = getopt.getopt(sys.argv[1:], "hp:",
                                       ["help","port="])
        except getopt.GetoptError:
            print "Option error!"
            self.usage()
            sys.exit(2)

        #Get options
        self.backend_port = 7790 #GuiMessenger port
        for opt,arg in opts:
            if (opt in ("-h","--help")):
                self.usage()
                sys.exit(0)
            elif (opt in ("-p","--port")):
                self.backend_port = int(arg)
            else:
                print "Unhandled option :"+opt
                sys.exit(2)
<commit_msg>pox-gui: add optional mininet IP argument<commit_after>#!/usr/bin/env python
'''
NOX GUI
This file creates the main application window, sets up the layout and invokes
the GUI's widgets.
The left panel (log) is used for displaying context-specific information.
The right panel (topology) is an interactive display of the topology
The bottom right pane (console) is a frontend for communication with
jsonmessenger.

@author <NAME> (<EMAIL>)
'''

import struct
import sys
import getopt

from PyQt4 import QtGui, QtCore

import gui.log as log
import gui.info as info
import gui.topology as topology
import gui.console as console
import gui.Popup as Popup
import gui.settings as settings
from gui.communication import Communication
import signal

class MainWindow(QtGui.QMainWindow):

    def usage(self):
        """Print usage information
        """
        print "Usage: "+sys.argv[0]+" <options> [IP address | default to localhost]"
        print  "Options:"
        print "-h / --help \tPrint this usage guide"
        print "-p / --port \tPort to connect to"
        print "-m / --mininet \tMininet IP address"

    def __init__(self, parent=None):
        QtGui.QWidget.__init__(self, parent)

        #Parse options and commandline arguments
        try:
            opts, args = getopt.getopt(sys.argv[1:], "hp:m:", ["help","port=","mininet="])
        except getopt.GetoptError:
            print "Option error!"
            self.usage()
            sys.exit(2)

        #Get options
        self.backend_port = 7790 #GuiMessenger port
        for opt,arg in opts:
            if (opt in ("-h","--help")):
                self.usage()
                sys.exit(0)
            elif (opt in ("-p","--port")):
                self.backend_port = int(arg)
            elif (opt in ("-m","--mininet")):
                self.mininet_address = arg
            else:
                print "Unhandled option :"+opt
                sys.exit(2)

{'fraction_non_alphanumeric': 0.10503751339764202, 'fraction_numerical': 0.0053590568060021436, 'mean_word_length': 2.277436347673398, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1826534', 'n_tokens_mistral': 1100, 'n_tokens_neox': 1045, 'n_words': 373}