Skip to content

Instantly share code, notes, and snippets.

View comet0's full-sized avatar

Cometo comet0

View GitHub Profile
@comet0
comet0 / proxy.py
Last active August 29, 2015 14:26 — forked from bxt/proxy.py
A very basic caching python HTTP proxy server.
# Originally from http://sharebear.co.uk/blog/2009/09/17/very-simple-python-caching-proxy/
#
# Usage:
# A call to http://localhost:80000/example.com/foo.html will cache the file
# at http://example.com/foo.html on disc and not redownload it again.
# To clear the cache simply do a `rm *.cached`. To stop the server simply
# send SIGINT (Ctrl-C). It does not handle any headers or post data.
import BaseHTTPServer
import hashlib
Index: src/eve-common/CMakeLists.txt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/eve-common/CMakeLists.txt (date 1462488560000)
+++ src/eve-common/CMakeLists.txt (revision )
@@ -225,9 +225,6 @@
${tables_SOURCE}
${utils_SOURCE} )
GetAllInfo
Returns:
utillib.KeyVal: [allInfo]
shipModifiedCharAttribs
PyNone (Only ever seen PyNone)
----
locationInfo
PyNone (Only ever seen PyNone)
diff --git a/gns3/graphics_view.py b/gns3/graphics_view.py
index d027c72..8ce7b9e 100644
--- a/gns3/graphics_view.py
+++ b/gns3/graphics_view.py
@@ -521,6 +521,11 @@ class GraphicsView(QtWidgets.QGraphicsView):
"""
item = self.itemAt(event.pos())
+ if isinstance(item, NodeItem):
+ item.setPos(float(75 * round(item.x() / 75)), float(75 * round(item.y() / 75)))
diff --git a/gns3/items/node_item.py b/gns3/items/node_item.py
index c6c7be3..2fa0aef 100644
--- a/gns3/items/node_item.py
+++ b/gns3/items/node_item.py
@@ -377,6 +377,10 @@ class NodeItem():
:param value: value of the change
"""
+ if change == 9: # Unsure but seems to alternate between 0/9 while dragging
+ GRID_SIZE = 75
diff --git a/gns3/ui/main_window_ui.py b/gns3/ui/main_window_ui.py
index 51cdc73..9105caa 100644
--- a/gns3/ui/main_window_ui.py
+++ b/gns3/ui/main_window_ui.py
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-
-# Form implementation generated from reading ui file '/home/grossmj/PycharmProjects/gns3-gui/gns3/ui/main_window.ui'
+# Form implementation generated from reading ui file '/home/cometo/dev/gns3-gui/gns3/ui/main_window.ui'
#
diff --git a/gns3/items/node_item.py b/gns3/items/node_item.py
index 128f6fc..a7a64b6 100644
--- a/gns3/items/node_item.py
+++ b/gns3/items/node_item.py
@@ -380,7 +380,9 @@ class NodeItem():
# was causing infinite recursion loops when placed within the below if statements
if change == QtWidgets.QGraphicsItem.ItemPositionHasChanged and self._main_window.uiSnapToGridAction.isChecked():
GRID_SIZE = 75
- self.setPos(float(GRID_SIZE * round(self.x() / GRID_SIZE)), float(GRID_SIZE * round(self.y() / GRID_SIZE)))
+ tmp_x = (GRID_SIZE * round(self.x() / GRID_SIZE)) - ((self.boundingRect().width() / 2) % GRID_SIZE)
diff --git a/src/eve-server/Client.cpp b/src/eve-server/Client.cpp
index c5098a0..eedb89e 100644
--- a/src/eve-server/Client.cpp
+++ b/src/eve-server/Client.cpp
@@ -767,8 +767,7 @@ void Client::_SendSessionChange()
SessionChangeNotification scn;
scn.changes = new PyDict;
- // TO-DO: This should be a unique value for each login.
Index: src/eve-common/python/PyRep.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/eve-common/python/PyRep.cpp (revision 9499ec6bdb7f03ac3e02a99431d2397a749c7b54)
+++ src/eve-common/python/PyRep.cpp (revision 5b2ef08ded975f75c9f80700ba8656e6304162ae)
@@ -1177,6 +1177,16 @@
}
Index: src/eve-common/marshal/EVEMarshalStringTable.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- src/eve-common/marshal/EVEMarshalStringTable.cpp (date 1469126431000)
+++ src/eve-common/marshal/EVEMarshalStringTable.cpp (revision )
@@ -27,7 +27,15 @@
#include "marshal/EVEMarshalStringTable.h"