Code cleanup
This commit is contained in:
1 parent
79cb716ced
commit
876c602710
33 files changed
+56
-53
No files matched your search
@@ -166,7 +166,7 @@ class Plugin(object):
|
||||
log.error('Couldn\'t remove empty directory %s: %s', (folder, traceback.format_exc()))
|
||||
|
||||
# http request
|
||||
def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True, verify_ssl = True):
|
||||
def urlopen(self, url, timeout = 30, data = None, headers = None, files = None, show_error = True):
|
||||
url = quote(ss(url), safe = "%/:=&?~#+!$,;'@()*[]")
|
||||
|
||||
if not headers: headers = {}
|
||||
|
||||
@@ -49,8 +49,8 @@ class FileManager(Plugin):
|
||||
files.extend(file_dict[x])
|
||||
|
||||
for f in os.listdir(cache_dir):
|
||||
if os.path.splitext(f.name)[1] in ['.png', '.jpg', '.jpeg']:
|
||||
file_path = os.path.join(cache_dir, f.name)
|
||||
if os.path.splitext(f)[1] in ['.png', '.jpg', '.jpeg']:
|
||||
file_path = os.path.join(cache_dir, f)
|
||||
if toUnicode(file_path) not in files:
|
||||
os.remove(file_path)
|
||||
except:
|
||||
|
||||
@@ -134,8 +134,8 @@ class Logging(Plugin):
|
||||
logs_raw = toUnicode(log_content).split('[0m\n')
|
||||
|
||||
logs = []
|
||||
for log in logs_raw:
|
||||
split = splitString(log, '\x1b')
|
||||
for log_line in logs_raw:
|
||||
split = splitString(log_line, '\x1b')
|
||||
if split:
|
||||
try:
|
||||
date, time, log_type = splitString(split[0], ' ')
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.page.log .nav li:hover:not(.active, .filter) {
|
||||
.page.log .nav li:hover:not(.active):not(.filter) {
|
||||
background: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
|
||||
|
||||
@@ -456,7 +456,7 @@ class Renamer(Plugin):
|
||||
mdia['last_edit'] = int(time.time())
|
||||
db.update(mdia)
|
||||
|
||||
except Exception as e:
|
||||
except:
|
||||
log.error('Failed marking movie finished: %s', (traceback.format_exc()))
|
||||
|
||||
# Go over current movie releases
|
||||
|
||||
@@ -90,7 +90,7 @@ Page.Wizard = new Class({
|
||||
self.parent(action, params);
|
||||
|
||||
self.addEvent('create', function(){
|
||||
self.order();
|
||||
self.orderGroups();
|
||||
});
|
||||
|
||||
self.initialized = true;
|
||||
@@ -106,7 +106,7 @@ Page.Wizard = new Class({
|
||||
}).delay(1)
|
||||
},
|
||||
|
||||
order: function(){
|
||||
orderGroups: function(){
|
||||
var self = this;
|
||||
|
||||
var form = self.el.getElement('.uniForm');
|
||||
|
||||
Reference in new issue
Block a user