This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| import argparse | |
| from transmissionrpc import Client, DEFAULT_PORT | |
| """ | |
| Simple script to clean out torrents that are no longer registered with | |
| a tracker. | |
| """ | |
| RM_MESSAGES = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| """ | |
| from __future__ import unicode_literals, absolute_import | |
| from email.mime.multipart import MIMEMultipart | |
| from email.mime.text import MIMEText | |
| import smtplib | |
| from urllib import urlopen | |
| import time |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class BaseReleaseKey(object): | |
| """ | |
| Basic info for a release used to make a unique identifier for a release name | |
| """ | |
| def __init__(self, release_name, name, release_key=None, media_type=constants.MEDIA_UNKNOWN): | |
| self.release_name = release_name | |
| self.name = name | |
| self.release_key = release_key if release_key else name | |
| self.media_type = media_type |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from dogpile.cache import make_region | |
| # Define basic in memory caches | |
| user = make_region().configure('dogpile.cache.memory', expiration_time=300) | |
| ip = make_region().configure('dogpile.cache.memory', expiration_time=300) | |
| def memoize(cache_region, ttl=300, ttl_ignore=False): | |
| """ Memoized value cache decorator with expiration TTL support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- MySQL dump 10.13 Distrib 5.1.61, for redhat-linux-gnu (x86_64) | |
| -- | |
| -- Host: localhost Database: geo | |
| -- ------------------------------------------------------ | |
| -- Server version 5.1.61 | |
| /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; | |
| /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; | |
| /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; | |
| /*!40101 SET NAMES utf8 */; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AD | 02 | Canillo | |
|---|---|---|---|
| AD | 03 | Encamp | |
| AD | 04 | La Massana | |
| AD | 05 | Ordino | |
| AD | 06 | Sant Julia de Loria | |
| AD | 07 | Andorra la Vella | |
| AD | 08 | Escaldes-Engordany | |
| AE | 01 | Abu Dhabi | |
| AE | 02 | Ajman | |
| AE | 03 | Dubai |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| A1 | Anonymous Proxy | |
|---|---|---|
| A2 | Satellite Provider | |
| O1 | Other Country | |
| AD | Andorra | |
| AE | United Arab Emirates | |
| AF | Afghanistan | |
| AG | Antigua and Barbuda | |
| AI | Anguilla | |
| AL | Albania | |
| AM | Armenia |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/python | |
| from __future__ import print_function | |
| from sys import exit | |
| from logging import getLogger, DEBUG, INFO, basicConfig | |
| from urllib2 import urlopen, HTTPError | |
| from urllib import urlretrieve | |
| from gzip import open as gzopen | |
| from datetime import datetime | |
| from collections import defaultdict | |
| from zipfile import ZipFile, is_zipfile |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class CachedContent(object): | |
| """ | |
| Keep track of a objects cache state. This is meant to prevent useless database calls primarily | |
| """ | |
| def __init__(self, mutable_keys=(), strict_keys=False): | |
| """ Initially set the cache to a clean state | |
| :param mutable_keys: List of valid mutable property names | |
| :type mutable_keys: iterable | |
| :param strict_keys: Check for key validity |