Import cleanup

This commit is contained in:
Ruud
2014-09-01 14:23:26 +02:00
parent 356322c5b1
commit c97bd38c83
5 changed files with 6 additions and 7 deletions
+4 -4
View File
@@ -1,5 +1,4 @@
from datetime import timedelta
from operator import itemgetter
import time
import traceback
from string import ascii_lowercase
@@ -313,7 +312,8 @@ class MediaPlugin(MediaBase):
def addSingleListView(self):
for media_type in fireEvent('media.types', merge = True):
tempList = lambda media_type = media_type, *args, **kwargs : self.listView(type = media_type, **kwargs)
tempList = lambda *args, **kwargs : self.listView(type = media_type, **kwargs)
print tempList
addApiView('%s.list' % media_type, tempList, docs = {
'desc': 'List media',
'params': {
@@ -395,7 +395,7 @@ class MediaPlugin(MediaBase):
def addSingleCharView(self):
for media_type in fireEvent('media.types', merge = True):
tempChar = lambda media_type = media_type, *args, **kwargs : self.charView(type = media_type, **kwargs)
tempChar = lambda *args, **kwargs : self.charView(type = media_type, **kwargs)
addApiView('%s.available_chars' % media_type, tempChar)
def delete(self, media_id, delete_from = None):
@@ -464,7 +464,7 @@ class MediaPlugin(MediaBase):
def addSingleDeleteView(self):
for media_type in fireEvent('media.types', merge = True):
tempDelete = lambda media_type = media_type, *args, **kwargs : self.deleteView(type = media_type, **kwargs)
tempDelete = lambda *args, **kwargs : self.deleteView(type = media_type, **kwargs)
addApiView('%s.delete' % media_type, tempDelete, docs = {
'desc': 'Delete a ' + media_type + ' from the wanted list',
'params': {
@@ -1,4 +1,3 @@
import os
import traceback
import time
@@ -1,6 +1,5 @@
import time
from couchpotato import tryInt
from couchpotato.core.logger import CPLog
from couchpotato.api import addApiView
from couchpotato.core.event import addEvent,fireEvent
+1 -1
View File
@@ -277,7 +277,7 @@ class MovieSearcher(SearcherBase, MovieTypeBase):
# Contains lower quality string
contains_other = fireEvent('searcher.contains_other_quality', nzb, movie_year = media['info']['year'], preferred_quality = preferred_quality, single = True)
if contains_other != False:
if contains_other and isinstance(contains_other, dict):
log.info2('Wrong: %s, looking for %s, found %s', (nzb['name'], quality['label'], [x for x in contains_other] if contains_other else 'no quality'))
return False
+1
View File
@@ -190,6 +190,7 @@ class Manage(Plugin):
delete_me = {}
# noinspection PyTypeChecker
for folder in self.in_progress:
if self.in_progress[folder]['to_go'] <= 0:
delete_me[folder] = True