Exemple #1
0
 def __init__(self, model):
     """
     Constructor
     :param model: The model from which the view gets the data
     """
     Subject.__init__(self)
     self.model = model
Exemple #2
0
 def __init__(self, rules=[], config=config.Config()):
     Subject.__init__(self)
     self.log = logging.getLogger("mallorymain")
     self.config = config
     self.rules = rules
     #Will be used to know where to start new "runp" thread on plug in conf
     self.persistent = 0
Exemple #3
0
    def __init__(self):
        Subject.__init__(self)
        Pyro.core.ObjBase.__init__(self)

        self.debugq = Queue.Queue()
        self.debugon = False
        self.log = logging.getLogger("mallorymain")
Exemple #4
0
 def __init__(self):
     Subject.__init__(self)
     Pyro.core.ObjBase.__init__(self)
     
     self.debugq = Queue.Queue()
     self.debugon = False
     self.log = logging.getLogger("mallorymain")
Exemple #5
0
    def __init__(self, model):
        tk.Tk.__init__(self)
        Subject.__init__(self)
        # VIEW OBSERVES THE MODEL FOR STATE CHANGES
        Observer.__init__(self)

        self.model = model
        self.model.attach(self)

        for x in self.model.layout_algos:
            print(x, self.model.layout_algos[x])

        for x in self.model.algos:
            print(x, self.model.algos[x])

        self.info_menu = None
        self.geometry("1920x1080")
        # Init. canvas
        self.tabs = {}
        self.nb = ttk.Notebook(self, name="nb")
        self.index = 0

        self.nb.grid(column=0, row=0, sticky=tk.N)

        self.bind("<Control-t>", self.open_new_graph)
        self.bind("<Control-w>", self.delete_tab)
        self.bind("<Control-s>", self.do_algo)
        self.bind("<Control-r>", self.zoom_out)
        self.bind("<Control-f>", self.zoom_in)
Exemple #6
0
 def __init__(self, rules = [], config = config.Config()):
     Subject.__init__(self)
     self.log = logging.getLogger("mallorymain")
     self.config = config
     self.rules = rules
     #Will be used to know where to start new "runp" thread on plug in conf
     self.persistent = 0
 def __init__(self,a=1.0,f=1.0,p=0.0,o=0.0,color='red'):
     Subject.__init__(self)
     self.signal=[]
     self.a,self.f,self.p,self.o=a,f,p,o
     self.color=color
     self.time = 1
     self.generate_signal()
Exemple #8
0
 def __init__(self):
     Subject.__init__(self)
     self.__notes = [
         "C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"
     ]
     self.chordInPrepare = []
     self.chordsList = [["C4", "E4", "G4"]]
     pass
Exemple #9
0
 def __init__(self, rules = [], config = config.Config()):
     Subject.__init__(self)
     self.log = logging.getLogger("mallorymain")        
     self.config = config
     self.rules = rules
     self.plugin_manager  = None
     self.friendly_name = "Undefined"
     self.done = False
Exemple #10
0
 def __init__(self, save=False, filepath="."):
     Subject.__init__(self)
     self.filepath = filepath
     self.last_time = 0
     self.simulations = []
     if (save):
         self.saver = DataSaver(filepath)
         self.attach(self.saver, simulation=False)
 def __init__(self,aX=0.0,fX=0.0,pX=0.0,oX=0.0,colorX='red',
                 aY=0.0,fY=0.0,pY=0.0,oY=0.0,colorY='blue'):
     Subject.__init__(self)
     self.X = Generator(aX,fX,pX,oX,colorX)
     self.X.generate_signal()
     self.Y = Generator(aY,fY,pY,oY,colorY)
     self.Y.generate_signal()
     self.XY = []
     self.generate_XYCurve()
Exemple #12
0
 def __init__(self, options):        
     Subject.__init__(self)
     self.log = logging.getLogger("mallorymain")
     config.logsetup(self.log)        
     self.configured_protos = []
     self.configured_plugin_managers = []
     self.protoinstances = []
     self.opts = options.options
     self.dbname = self.opts.trafficdb
     self.debugon = False
     self.debugger = Debugger()
     self.config_protocols = config_proto.ConfigProtocols()
     self.config_rules = config_rule.ConfigRules()
     self.rpcserver = rpc.RPCServer()
     self.nftool = netfilter.NetfilterTool()
Exemple #13
0
 def __init__(self, options):
     Subject.__init__(self)
     self.log = logging.getLogger("mallorymain")
     config.logsetup(self.log)
     self.configured_protos = []
     self.configured_plugin_managers = []
     self.protoinstances = []
     self.opts = options.options
     self.dbname = self.opts.trafficdb
     self.debugon = False
     self.debugger = Debugger()
     self.config_protocols = config_proto.ConfigProtocols()
     self.config_rules = config_rule.ConfigRules()
     self.rpcserver = rpc.RPCServer()
     self.nftool = netfilter.NetfilterTool()
Exemple #14
0
    def __init__(self, model):
        """Inits the class."""
        Subject.__init__(self)
        QMainWindow.__init__(self)

        # Set model
        self.model = model

        # Create interface elements
        self.menu_bar = MenuBar(self)
        self.tool_bar = ToolBar(self)
        self.exif_area = ExifWidget(self)
        self.image_area = ImageWidget(self)
        self.status_bar = StatusBar()
        about_text = 'IEViewer 1.0' \
                     '<br><br>' \
                     'Copyright © 2021 by' \
                     '<br>' \
                     'Paula Mihalcea' \
                     '<br>' \
                     '<a href="mailto:[email protected]">[email protected]</a>' \
                     '<br><br>' \
                     'This program uses PyQt5, a comprehensive set of Python bindings for Qt v5. Qt is a set of cross-platform C++ libraries that implement high-level APIs for accessing many aspects of modern desktop and mobile systems.\n' \
                     '<br><br>' \
                     'PyQt5 is copyright © Riverbank Computing Limited. Its homepage is <a href="https://www.riverbankcomputing.com/software/pyqt/">https://www.riverbankcomputing.com/software/pyqt/</a>.' \
                     '<br><br>' \
                     'No genasi were harmed in the making of this application. <a href="https://www.dndbeyond.com/races/genasi#WaterGenasi">#GenasiLivesMatter#NereisThalian</a>'
        self.about = AboutWidget('About IEViewer',
                                 about_text,
                                 image_path='icons/about_img.png')

        # Disable GUI elements that are unavailable when no image is opened
        self.menu_bar.disable_widgets()
        self.exif_area.hide()

        # Set layout
        self.setCentralWidget(Layout(self).central_widget)

        # Set window properties
        self.set_window_properties()

        # Install additional event filters
        self.image_area.installEventFilter(self)
Exemple #15
0
    def __init__(self):
        """
        Checks if all needed paths exists and starts to load data which
        is needed by the application
        """
        Subject.__init__(self)
        if not os.path.exists("graphs"):
            logger.debug("Making graphs directory")
            os.makedirs("graphs")

        if not os.path.exists("algorithms"):
            logger.debug("Making algorithms directory")
            os.makedirs("algorithms")

        self.is_connected = False
        self.acyclic = False
        self.is_undirected_tree = False
        self.loaded_graphs: Dict[str, Graph] = dict()
        self.layout_algos: Dict[str, LayoutAlgorithm] = dict()
        self.algos = dict()

        self.load_layouting_algos()
        self.load_algos()
        self.view = None
Exemple #16
0
 def __init__(self, rules = [], config = config.Config()):
     Subject.__init__(self)
     self.log = logging.getLogger("mallorymain")
     self.config = config
     self.rules = rules
     self.eventQ = Queue.Queue(0)
Exemple #17
0
 def __init__(self, rules=[], config=config.Config()):
     Subject.__init__(self)
     self.log = logging.getLogger("mallorymain")
     self.config = config
     self.rules = rules
     self.eventQ = Queue.Queue(0)
Exemple #18
0
 def __init__(self):
     Subject.__init__(self)
     self.signal = []
     self.a, self.f, self.p, self.h = 1.0, 1.0, 0.0, 1
Exemple #19
0
 def __init__(self):
     Subject.__init__(self)
     self.ability_event = None