Commit c34d1cbf authored by Luke Campagnola's avatar Luke Campagnola
Browse files

Bugfixes against python3 updates.

Everything appears wo be working as normal in Python2
Python3 is still only partially functional.
parent 8a9557cf
......@@ -51,7 +51,7 @@ def readConfigFile(fname):
try:
#os.chdir(newDir) ## bad.
fd = open(fname)
s = asUnicode(fd.read(), 'UTF-8')
s = asUnicode(fd.read())
fd.close()
s = s.replace("\r\n", "\n")
s = s.replace("\r", "\n")
......
......@@ -64,6 +64,12 @@ class Dock(QtGui.QWidget, DockDrop):
self.setStretch(*size)
def implements(self, name=None):
if name is None:
return ['dock']
else:
return name == 'dock'
def setStretch(self, x=None, y=None):
#print "setStretch", self, x, y
#self._stretch = (x, y)
......
......@@ -20,7 +20,8 @@ class DockDrop(object):
self.overlay.raise_()
def dragEnterEvent(self, ev):
if isinstance(ev.source(), Dock.Dock):
src = ev.source()
if hasattr(src, 'implements') and src.implements('dock'):
#print "drag enter accept"
ev.accept()
else:
......@@ -125,5 +126,3 @@ class DropAreaOverlay(QtGui.QWidget):
p.setBrush(QtGui.QBrush(QtGui.QColor(100, 100, 255, 50)))
p.setPen(QtGui.QPen(QtGui.QColor(50, 50, 150), 3))
p.drawRect(rgn)
from . import Dock
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment