コード例 #1
0
ファイル: toolbox.py プロジェクト: Anidetrix/torrt
def unregister_torrent(hash_str):
    """Unregisters torrent from torrt. That doesn't remove torrent
    from torrent clients.

    :param hash_str: str - torrent identifying hash
    :return:
    """
    LOGGER.info('Unregistering `%s` torrent ...', hash_str)
    try:
        cfg = TorrtConfig.load()
        del cfg['torrents'][hash_str]
        TorrtConfig.save(cfg)
    except KeyError:
        pass  # Torrent was not known by torrt
コード例 #2
0
ファイル: toolbox.py プロジェクト: ALTracer/torrt
def remove_notifier(alias):
    """Removes notifier by alias

    :param alias: str - Notifier alias to remove.

    :return:
    """
    LOGGER.info('Removing `%s` notifier ...', alias)
    try:
        cfg = TorrtConfig.load()
        del cfg['notifiers'][alias]
        TorrtConfig.save(cfg)
    except KeyError:
        pass
コード例 #3
0
ファイル: toolbox.py プロジェクト: ALTracer/torrt
def unregister_torrent(hash_str):
    """Unregisters torrent from torrt. That doesn't remove torrent
    from torrent clients.

    :param hash_str: str - torrent identifying hash
    :return:
    """
    LOGGER.debug('Unregistering `%s` torrent ...', hash_str)
    try:
        cfg = TorrtConfig.load()
        del cfg['torrents'][hash_str]
        TorrtConfig.save(cfg)
    except KeyError:
        pass  # Torrent was not known by torrt
コード例 #4
0
ファイル: toolbox.py プロジェクト: dmzkrsk/torrt
def remove_notifier(alias):
    """Removes notifier by alias

    :param alias: str - Notifier alias to remove.

    :return:
    """
    LOGGER.info('Removing `%s` notifier ...', alias)
    try:
        cfg = TorrtConfig.load()
        del cfg['notifiers'][alias]
        TorrtConfig.save(cfg)
    except KeyError:
        pass