Package DebTorrent :: Package BT1 :: Module AptListener
[hide private]
[frames] | no frames]

Module AptListener

source code

Listen for download requests from Apt.

Classes [hide private]
  AptListener
Listen for Apt requests to download files.
Functions [hide private]
string
isotime(secs=None)
Create an ISO formatted string of the time.
source code
string
size_format(s)
Format a byte size for reading by the user.
source code
string
hours(n)
Formats seconds into a human-readable time.
source code
Variables [hide private]
logging.Logger logger = logging.getLogger('DebTorrent.BT1.AptListener')
the logger to send all log messages to for this module
string VERSION = 'DebTorrent/T-0.1.4'
the Server identifier sent to all sites
string alas = 'your file may exist elsewhere in the universe\nbut ala...
the message to send when the data is not found

Imports: subnetparse.IP_List, subnetparse.ipv6_to_ipv4, subnetparse.is_ipv4, iprangeparse.IP_List, bencode.bencode, zurllib.quote, zurllib.unquote, Filter.Filter, urlparse.urlparse, os.path.join, cStringIO.StringIO, time.time, time.gmtime, time.strftime, clock.clock, sha.sha, binascii.a2b_hex, binascii.b2a_hex, makemetafile.TorrentCreator, HTTPCache.HTTPCache, btformats.check_message, os, logging, __init__.version, __init__.product_name, __init__.version_short


Function Details [hide private]

isotime(secs=None)

source code 
Create an ISO formatted string of the time.
Parameters:
  • secs (float) - number of seconds since the epoch (optional, default is to use the current time)
Returns: string
the ISO formatted string representation of the time

size_format(s)

source code 
Format a byte size for reading by the user.
Parameters:
  • s (long) - the number of bytes
Returns: string
the formatted size with appropriate units

hours(n)

source code 

Formats seconds into a human-readable time.

Formats a given number of seconds into a human-readable time appropriate for display to the user.
Parameters:
  • n (int) - the number of seconds
Returns: string
a displayable representation of the number of seconds

Variables Details [hide private]

alas

the message to send when the data is not found
Type:
string
Value:
'''your file may exist elsewhere in the universe
but alas, not here
'''