Permalink
Browse files

remove the build file

  • Loading branch information...
afourmy committed Aug 29, 2017
1 parent cee28d4 commit 1ad4b9d11a7b5f26bed06c29a71a6ca1834f0768
Binary file not shown.
View
BIN -3.26 MB Shapefiles/france.shp
Binary file not shown.
View
Binary file not shown.
@@ -59,7 +59,7 @@ def send_script(self):
# credentials to log in to the device
'username': credentials['username'],
'password': credentials['password'],
'secret': credentials['enable_password']
'enable_password': credentials['enable_password']
}
netmiko_connection = ConnectHandler(**connection_parameters)
View
@@ -445,7 +445,8 @@ def add_note(self):
self.creation_mode = 'text'
def rectangle(self):
pass
self.mode = 'creation'
self.creation_mode = 'rectangle'
def ellipse(self):
pass
@@ -0,0 +1,10 @@
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
class GraphicalRectangle(QGraphicsRectItem):
def __init__(self, view):
super().__init__()
self.setFlag(QGraphicsItem.ItemIsMovable)
self.setFlag(QGraphicsItem.ItemIsSelectable)
View

This file was deleted.

Oops, something went wrong.
View
@@ -2,6 +2,7 @@
from graphical_objects.graphical_node import GraphicalNode
from graphical_objects.graphical_link import GraphicalLink
from graphical_objects.graphical_text import GraphicalText
from graphical_objects.graphical_rectangle import GraphicalRectangle
from miscellaneous.decorators import *
from objects.objects import *
from os.path import join
@@ -95,11 +96,10 @@ def dragEnterEvent(self, event):
## Mouse bindings
def mousePressEvent(self, event):
item = self.itemAt(event.pos())
# activate rubberband for selection
# by default, the rubberband is active for both clicks, we have to
# deactivate it explicitly for the right-click
if event.buttons() == Qt.LeftButton:
# activate rubberband for selection
# by default, the rubberband is active for both clicks, we have to
# deactivate it explicitly for the right-click
if self.controller.mode == 'selection':
self.setDragMode(QGraphicsView.RubberBandDrag)
else:
@@ -110,6 +110,12 @@ def mousePressEvent(self, event):
text_item.setZValue(11)
self.scene.addItem(text_item)
text_item.setPos(self.mapToScene(event.pos()))
elif self.controller.creation_mode == 'rectangle':
self.rectangle_item = GraphicalRectangle(self)
self.scene.addItem(self.rectangle_item)
self.rectangle_item.setZValue(11)
self.position = self.mapToScene(event.pos())
self.rectangle_item.setRect(self.position.x(), self.position.y(), 0, 0)
if event.button() == Qt.RightButton:
# when the right-click button is pressed, we don't know yet whether
# the user wants to access the general right-click menu or move
@@ -125,6 +131,9 @@ def mouseMoveEvent(self, event):
if event.buttons() == Qt.LeftButton:
if hasattr(self, 'temp_line') and self.temp_line:
self.temp_line.setLine(QLineF(self.start_position, position))
if hasattr(self, 'rectangle_item'):
width, height = position.x() - self.position.x(), position.y() - self.position.y()
self.rectangle_item.setRect(self.position.x(), self.position.y(), width, height)
# sliding the scrollbar with the right-click button
if event.buttons() == Qt.RightButton:
self.trigger_menu = False
@@ -173,7 +182,7 @@ def refresh_display(self):
pass
## for point in (start, end):
# text = self.scene.addSimpleText(
# '(%d, %d)' % (point.x(), point.y()))
# text.setBrush(Qt.red)
# text.setPos(point)
# text = self.scene.addSimpleText(
# '(%d, %d)' % (point.x(), point.y()))
# text.setBrush(Qt.red)
# text.setPos(point)

0 comments on commit 1ad4b9d

Please sign in to comment.