def __init__(self, parent=None): super(MainWindow, self).__init__(parent) self.__index = 0 self.fixtures = [] self.changedByProg = True self.setupUi(self) self.connectSlots() self.conf = loadconf() self.graphicsView.setMainWindow(self) self.patternLineEdit.setText(self.conf['pattern']) self.sortClockwiseCheckBox.setChecked(self.conf['sort_clockwise']) self.invertedYCheckBox.setChecked(self.conf['inverted_y']) if 'last_file' in self.conf: filename = self.conf['last_file'] self.graphicsView.loadSprite(filename) self.addNewFixture()
def __init__(self, *args, **kwargs): super(MyGraphicsView, self).__init__() scene = QGraphicsScene(self) self.mainWindow = args[0] self.actFixture = Fixture(self) self.conf = loadconf() self.scene = scene scene.setItemIndexMethod(QGraphicsScene.NoIndex) scene.setSceneRect(0, 0, self.conf['x_max'], self.conf['y_max']) self.setScene(scene) self.setCacheMode(QGraphicsView.CacheBackground) self.setCacheMode(QGraphicsView.CacheNone) self.setTransformationAnchor(QGraphicsView.AnchorUnderMouse) self.setResizeAnchor(QGraphicsView.AnchorViewCenter) self.grabbed = None self.selected = None self.bgImage = None self.mainSprite = None self.zoom = 1 self.zoomStep = 2 # used by menu commands self.zoomScale = 1 # used by mouse zoom self.signalZoomByMouse.connect(self.slotZoom, Qt.QueuedConnection) self.setTransformationAnchor(QGraphicsView.NoAnchor)
def __init__(self, *args, **kwargs): super(MyGraphicsView, self).__init__() scene = QGraphicsScene(self) self.mainWindow = args[0] self.actFixture = Fixture(self) self.conf = loadconf() self.scene = scene scene.setItemIndexMethod(QGraphicsScene.NoIndex) scene.setSceneRect(0, 0, self.conf['x_max'], self.conf['y_max']) self.setScene(scene) self.setCacheMode(QGraphicsView.CacheBackground) self.setCacheMode(QGraphicsView.CacheNone) self.setTransformationAnchor(QGraphicsView.AnchorUnderMouse) self.setResizeAnchor(QGraphicsView.AnchorViewCenter) self.grabbed = None self.selected = None self.bgImage = None self.mainSprite = None self.zoom = 1 self.zoomStep = 2 # used by menu commands self.zoomScale = 1 # used by mouse zoom self.signalZoomByMouse.connect(self.slotZoom,Qt.QueuedConnection) self.setTransformationAnchor( QGraphicsView.NoAnchor )
if o == '-l': level = int(v) if o == '-p': pop = v if o == '-D': debug = debug + 1 options = ["details"] Attributes.pop = pop Attributes.options = options log = Log.Log(level) import conf conffile = "/import/bta4/v2/etc/bta4.conf" conf.loadconf(conffile) mf = ParseMakefile.ParseMakefile(conf=conf) for rtr in mf.rtrdict.keys(): mtr = mf.getRouterMeter(rtr=rtr) #print "%s = %s" % (rtr, mtr) cfg = RtrConfigParser(dir=RTRCFGDIR, attrs=Attributes) # Routers in the flowrules makefile for r in mf.rtrdict.keys(): found = 0 for s in cfg.crouters: # The config files if found: break #print "[%s] <=> [%s]" % (s.rtrname, r) if r == s.rtrname:
if o=='-l': level=int(v) if o=='-p': pop=v if o=='-D': debug=debug+1 options=["details"] Attributes.pop=pop Attributes.options=options log=Log.Log(level) import conf conffile="/import/bta4/v2/etc/bta4.conf" conf.loadconf(conffile) mf=ParseMakefile.ParseMakefile(conf=conf) for rtr in mf.rtrdict.keys(): mtr = mf.getRouterMeter(rtr=rtr) #print "%s = %s" % (rtr, mtr) cfg = RtrConfigParser(dir=RTRCFGDIR, attrs=Attributes) # Routers in the flowrules makefile for r in mf.rtrdict.keys(): found=0 for s in cfg.crouters: # The config files if found: break #print "[%s] <=> [%s]" % (s.rtrname, r) if r==s.rtrname:
def __init__(self, graphicsView, idNumber=0): self.idNumber = idNumber self.conf = loadconf() self.items = [] self.lines = [] self.graphicsView = graphicsView