Commit 77bf5f23 by rfkelly0

fix EVENT.clone() in subclasses

parent 29cab8cf
...@@ -80,7 +80,7 @@ class MODIFIED(EVENT): ...@@ -80,7 +80,7 @@ class MODIFIED(EVENT):
self.data_changed = data_changed self.data_changed = data_changed
def clone(self,fs=None,path=None,data_changed=None): def clone(self,fs=None,path=None,data_changed=None):
evt = super(MODIFIED,self).clone() evt = super(MODIFIED,self).clone(fs,path)
if data_changed is None: if data_changed is None:
data_changed = self.data_changed data_changed = self.data_changed
evt.data_changd = data_changed evt.data_changd = data_changed
...@@ -94,8 +94,11 @@ class MOVED_DST(EVENT): ...@@ -94,8 +94,11 @@ class MOVED_DST(EVENT):
source = abspath(normpath(source)) source = abspath(normpath(source))
self.source = source self.source = source
def __unicode__(self):
return u"<fs.watch.%s object (path=%r,src=%r) at %s>" % (self.__class__.__name__,self.path,self.source,hex(id(self)))
def clone(self,fs=None,path=None,source=None): def clone(self,fs=None,path=None,source=None):
evt = super(MOVED_DST,self).clone() evt = super(MOVED_DST,self).clone(fs,path)
if source is None: if source is None:
source = self.source source = self.source
evt.source = source evt.source = source
...@@ -109,8 +112,11 @@ class MOVED_SRC(EVENT): ...@@ -109,8 +112,11 @@ class MOVED_SRC(EVENT):
destination = abspath(normpath(destination)) destination = abspath(normpath(destination))
self.destination = destination self.destination = destination
def __unicode__(self):
return u"<fs.watch.%s object (path=%r,dst=%r) at %s>" % (self.__class__.__name__,self.path,self.destination,hex(id(self)))
def clone(self,fs=None,path=None,destination=None): def clone(self,fs=None,path=None,destination=None):
evt = super(MOVED_SRC,self).clone() evt = super(MOVED_SRC,self).clone(fs,path)
if destination is None: if destination is None:
destination = self.destination destination = self.destination
evt.destination = destination evt.destination = destination
......
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