diff options
Diffstat (limited to 'module/Api.py')
-rw-r--r-- | module/Api.py | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/module/Api.py b/module/Api.py index f0bf5e264..066d490ec 100644 --- a/module/Api.py +++ b/module/Api.py @@ -1,4 +1,3 @@ -#!/usr/bin/env python # -*- coding: utf-8 -*- """ This program is free software; you can redistribute it and/or modify @@ -49,7 +48,7 @@ def permission(bits): def __new__(cls, func, *args, **kwargs): permMap[func.__name__] = bits return func - + return _Dec @@ -160,7 +159,7 @@ class Api(Iface): @permission(PERMS.SETTINGS) def getConfig(self): """Retrieves complete config of core. - + :return: list of `ConfigSection` """ return self._convertConfigFormat(self.core.config.config) @@ -219,7 +218,7 @@ class Api(Iface): @permission(PERMS.LIST) def statusServer(self): """Some general information about the current status of pyLoad. - + :return: `ServerStatus` """ serverStatus = ServerStatus(self.core.threadManager.pause, len(self.core.threadManager.processingIds()), @@ -484,7 +483,7 @@ class Api(Iface): :return: `PackageData` with .fid attribute """ data = self.core.files.getPackageData(int(pid)) - + if not data: raise PackageDoesNotExists(pid) @@ -511,7 +510,7 @@ class Api(Iface): @permission(PERMS.DELETE) def deleteFiles(self, fids): """Deletes several file entries from pyload. - + :param fids: list of file ids """ for id in fids: @@ -584,7 +583,7 @@ class Api(Iface): @permission(PERMS.ADD) def addFiles(self, pid, links): """Adds files to specific package. - + :param pid: package id :param links: list of urls """ @@ -923,10 +922,8 @@ class Api(Iface): """ if self.core.config["remote"]["nolocalauth"] and remoteip == "127.0.0.1": return "local" - if self.core.startedInGui and remoteip == "127.0.0.1": - return "local" - - return self.core.db.checkAuth(username, password) + else: + return self.core.db.checkAuth(username, password) def isAuthorized(self, func, userdata): """checks if the user is authorized for specific method @@ -1011,7 +1008,7 @@ class Api(Iface): def getAllInfo(self): """Returns all information stored by hook plugins. Values are always strings - :return: {"plugin": {"name": value } } + :return: {"plugin": {"name": value}} """ return self.core.hookManager.getAllInfo() @@ -1030,4 +1027,4 @@ class Api(Iface): def setUserPermission(self, user, permission, role): self.core.db.setPermission(user, permission) - self.core.db.setRole(user, role)
\ No newline at end of file + self.core.db.setRole(user, role) |