cc-4105: fixed bug where mixed case extensions would be ignored
This commit is contained in:
parent
088f655033
commit
166a724d9d
|
@ -31,15 +31,13 @@ class EventRegistry(object):
|
|||
EventRegistry.unregister(event)
|
||||
return event
|
||||
|
||||
|
||||
# It would be good if we could parameterize this class by the attribute
|
||||
# that would contain the path to obtain the meta data. But it would be too much
|
||||
# work
|
||||
class HasMetaData(object):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
@LazyProperty
|
||||
def metadata(self):
|
||||
return Metadata(self.path)
|
||||
def metadata(self): return Metadata(self.path)
|
||||
|
||||
class BaseEvent(Loggable):
|
||||
__metaclass__ = abc.ABCMeta
|
||||
|
@ -55,11 +53,9 @@ class BaseEvent(Loggable):
|
|||
@LazyProperty
|
||||
def cookie(self):
|
||||
return getattr( self._raw_event, 'cookie', None )
|
||||
def __str__(self):
|
||||
return "Event. Path: %s" % self.__raw_event.pathname
|
||||
|
||||
def is_dir_event(self):
|
||||
return self._raw_event.dir
|
||||
def __str__(self): return "Event. Path: %s" % self.__raw_event.pathname
|
||||
def is_dir_event(self): return self._raw_event.dir
|
||||
|
||||
# As opposed to unsafe_pack...
|
||||
def safe_pack(self):
|
||||
|
@ -90,7 +86,6 @@ class FakePyinotify(object):
|
|||
def __init__(self, path):
|
||||
self.pathname = path
|
||||
|
||||
|
||||
class OrganizeFile(BaseEvent, HasMetaData):
|
||||
def __init__(self, *args, **kwargs): super(OrganizeFile, self).__init__(*args, **kwargs)
|
||||
def pack(self):
|
||||
|
|
|
@ -43,7 +43,7 @@ class IncludeOnly(object):
|
|||
def _wrap(moi, event, *args, **kwargs):
|
||||
ext = extension(event.pathname)
|
||||
# Checking for emptiness b/c we don't want to skip direcotries
|
||||
if (ext in self.exts) or event.dir:
|
||||
if (ext.lower() in self.exts) or event.dir:
|
||||
return func(moi, event, *args, **kwargs)
|
||||
return _wrap
|
||||
|
||||
|
@ -59,7 +59,7 @@ def partition(f, alist):
|
|||
|
||||
def is_file_supported(path):
|
||||
# TODO : test and document this function
|
||||
return extension(path) in supported_extensions
|
||||
return extension(path).lower() in supported_extensions
|
||||
|
||||
# In the future we would like a better way to find out
|
||||
# whether a show has been recorded
|
||||
|
|
|
@ -44,7 +44,8 @@ class RequestSync(threading.Thread,Loggable):
|
|||
self.logger.info("An evil exception occured")
|
||||
import ipdb; ipdb.set_trace()
|
||||
self.logger.error( traceback.format_exc() )
|
||||
def make_req(): self.apiclient.send_media_monitor_requests( packed_requests )
|
||||
def make_req():
|
||||
self.apiclient.send_media_monitor_requests( packed_requests )
|
||||
# Is this retry shit even necessary? Consider getting rid of this.
|
||||
for try_index in range(0,self.retries):
|
||||
try: make_req()
|
||||
|
|
Loading…
Reference in New Issue