summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-14 21:53:48 +0200
committerGravatar Walter Purcaro <vuolter@gmail.com> 2014-07-14 21:53:48 +0200
commitd23246547e10382b2244fc34157a2896706ac2c7 (patch)
tree262dbbc1fa59c0ef68f273b356912f6453843777
parent[Plugin] Call api faster (diff)
downloadpyload-d23246547e10382b2244fc34157a2896706ac2c7.tar.xz
Stretch comment separator
-rw-r--r--module/PluginThread.py8
-rw-r--r--module/ThreadManager.py6
-rw-r--r--module/database/DatabaseBackend.py4
-rw-r--r--module/database/FileDatabase.py30
-rw-r--r--module/plugins/AccountManager.py10
5 files changed, 30 insertions, 28 deletions
diff --git a/module/PluginThread.py b/module/PluginThread.py
index 2d0a07e77..5e3519674 100644
--- a/module/PluginThread.py
+++ b/module/PluginThread.py
@@ -40,7 +40,7 @@ from Api import OnlineStatus
class PluginThread(Thread):
"""abstract base class for thread types"""
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def __init__(self, manager):
"""Constructor"""
Thread.__init__(self)
@@ -150,7 +150,7 @@ class PluginThread(Thread):
class DownloadThread(PluginThread):
"""thread for downloading files from 'real' hoster plugins"""
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def __init__(self, manager):
"""Constructor"""
PluginThread.__init__(self, manager)
@@ -160,7 +160,7 @@ class DownloadThread(PluginThread):
self.start()
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def run(self):
"""run method"""
pyfile = None
@@ -422,7 +422,7 @@ class DecrypterThread(PluginThread):
class HookThread(PluginThread):
"""thread for hooks"""
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def __init__(self, m, function, args, kwargs):
"""Constructor"""
PluginThread.__init__(self, m)
diff --git a/module/ThreadManager.py b/module/ThreadManager.py
index b8662c514..20c349694 100644
--- a/module/ThreadManager.py
+++ b/module/ThreadManager.py
@@ -156,7 +156,7 @@ class ThreadManager:
self.infoResults.clear()
self.log.debug("Cleared Result cache")
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def tryReconnect(self):
"""checks if reconnect needed"""
@@ -227,7 +227,7 @@ class ThreadManager:
return ip
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def checkThreadCount(self):
"""checks if there are need for increasing or reducing thread count"""
@@ -251,7 +251,7 @@ class ThreadManager:
self.log.debug("Cleaned up pycurl")
return True
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def assignJob(self):
"""assing a job to a thread if possible"""
diff --git a/module/database/DatabaseBackend.py b/module/database/DatabaseBackend.py
index 6b2099736..010e05735 100644
--- a/module/database/DatabaseBackend.py
+++ b/module/database/DatabaseBackend.py
@@ -190,7 +190,7 @@ class DatabaseBackend(Thread):
except:
print "Filedatabase could NOT be converted."
- #--convert scripts start
+ #convert scripts start-----------------------------------------------------
def _convertV2(self):
self.c.execute('CREATE TABLE IF NOT EXISTS "storage" ("id" INTEGER PRIMARY KEY AUTOINCREMENT, "identifier" TEXT NOT NULL, "key" TEXT NOT NULL, "value" TEXT DEFAULT "")')
@@ -207,7 +207,7 @@ class DatabaseBackend(Thread):
except:
print "Database was converted from v3 to v4."
- #--convert scripts end
+ #convert scripts end-------------------------------------------------------
def _createTables(self):
"""create tables for database"""
diff --git a/module/database/FileDatabase.py b/module/database/FileDatabase.py
index 3536b6306..53bf58fb2 100644
--- a/module/database/FileDatabase.py
+++ b/module/database/FileDatabase.py
@@ -68,12 +68,12 @@ class FileHandler:
return func(*args)
return new
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def save(self):
"""saves all data to backend"""
self.db.commit()
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def syncSave(self):
"""saves all data to backend and waits until all data are written"""
pyfiles = self.cache.values()
@@ -131,7 +131,7 @@ class FileHandler:
#@TODO change from reloadAll event to package update event
self.core.pullManager.addEvent(ReloadAllEvent("collector"))
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
@lock
@change
def addPackage(self, name, folder, queue=0):
@@ -142,7 +142,7 @@ class FileHandler:
self.core.pullManager.addEvent(e)
return lastID
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
@lock
@change
def deletePackage(self, id):
@@ -178,7 +178,7 @@ class FileHandler:
pack.order -= 1
pack.notifyChange()
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
@lock
@change
def deleteLink(self, id):
@@ -213,19 +213,19 @@ class FileHandler:
pyfile.order -= 1
pyfile.notifyChange()
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def releaseLink(self, id):
"""removes pyfile from cache"""
if id in self.cache:
del self.cache[id]
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def releasePackage(self, id):
"""removes package from cache"""
if id in self.packageCache:
del self.packageCache[id]
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def updateLink(self, pyfile):
"""updates link"""
self.db.updateLink(pyfile)
@@ -233,7 +233,7 @@ class FileHandler:
e = UpdateEvent("file", pyfile.id, "collector" if not pyfile.package().queue else "queue")
self.core.pullManager.addEvent(e)
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def updatePackage(self, pypack):
"""updates a package"""
self.db.updatePackage(pypack)
@@ -241,7 +241,7 @@ class FileHandler:
e = UpdateEvent("pack", pypack.id, "collector" if not pypack.queue else "queue")
self.core.pullManager.addEvent(e)
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def getPackage(self, id):
"""return package instance"""
@@ -250,7 +250,7 @@ class FileHandler:
else:
return self.db.getPackage(id)
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def getPackageData(self, id):
"""returns dict with package information"""
pack = self.getPackage(id)
@@ -274,7 +274,7 @@ class FileHandler:
return pack
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def getFileData(self, id):
"""returns dict with file information"""
if id in self.cache:
@@ -282,7 +282,7 @@ class FileHandler:
return self.db.getLinkData(id)
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def getFile(self, id):
"""returns pyfile instance"""
if id in self.cache:
@@ -290,7 +290,7 @@ class FileHandler:
else:
return self.db.getFile(id)
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
@lock
def getJob(self, occ):
"""get suitable job"""
@@ -823,7 +823,7 @@ class FileMethods:
if not r: return None
return PyPackage(self.manager, id, * r)
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
@style.queue
def getFile(self, id):
"""return link instance from id"""
diff --git a/module/plugins/AccountManager.py b/module/plugins/AccountManager.py
index b046ba7a7..b20a5e3b3 100644
--- a/module/plugins/AccountManager.py
+++ b/module/plugins/AccountManager.py
@@ -30,7 +30,7 @@ ACC_VERSION = 1
class AccountManager:
"""manages all accounts"""
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def __init__(self, core):
"""Constructor"""
@@ -66,7 +66,8 @@ class AccountManager:
plugins.append(self.getAccountPlugin(plugin))
return plugins
- #----------------------------------------------------------------------
+
+ #--------------------------------------------------------------------------
def loadAccounts(self):
"""loads all accounts available"""
@@ -112,7 +113,8 @@ class AccountManager:
elif ":" in line:
name, sep, pw = line.partition(":")
self.accounts[plugin][name] = {"password": pw, "options": {}, "valid": True}
- #----------------------------------------------------------------------
+
+ #--------------------------------------------------------------------------
def saveAccounts(self):
"""save all account information"""
@@ -132,7 +134,7 @@ class AccountManager:
f.close()
chmod(f.name, 0600)
- #----------------------------------------------------------------------
+ #--------------------------------------------------------------------------
def initAccountPlugins(self):
"""init names"""
for name in self.core.pluginManager.getAccountPlugins():