Ejemplo n.º 1
0
    def __init__(self, bokor):
        self.bokor = bokor
        self.db = self.get('memory', 'sqlitedir', '/tmp') + '/' + 'post.db'
        self.memory = PostMemory(self.db)
        self.path_session = self.get("rtorrent",
                                     "path_session").rstrip('/') + '/'
        self.path_dl = self.get("rtorrent", "path_dl").rstrip('/') + '/'
        self.path_log = self.get("rtorrent", "path_log").rstrip('/') + '/'
        self.base_url = self.get("post", "base_url", "")
        self.protocol = self.get("post", "protocol")
        self.post_thread = PostThread(self.db)

        self.post_thread.setName('post')
        self.post_thread.start()
Ejemplo n.º 2
0
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation,
Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

@file bokor_master_rtorrent.py
@author Olivier ANDRE <*****@*****.**>
@date 2014
@brief update relative path in order to allow post treatement
"""
import sys
from bokor.memory.postdlmemory import PostMemory

if __name__ == "__main__":

    hash_file = sys.argv[1]
    src = sys.argv[3] + '/' + sys.argv[2]

    post = PostMemory(sys.argv[4])

    rps = post.get_relative_path('info_hash', hash_file, '=', False)
    for rp in rps:
        rp['status'] = 'todo'
        rp['src'] = src
        post.update_relative_path(rp)
Ejemplo n.º 3
0
    def __init__(self, db):
        Thread.__init__(self)
        logging.info("init post thread")

        self.setDaemon(True)
        self.memory = PostMemory(db)