diff options
author | Camil Staps | 2016-05-02 16:12:13 +0200 |
---|---|---|
committer | Camil Staps | 2016-05-02 16:12:13 +0200 |
commit | ce38b1cc4cd55e3acbc40e664e4ee473afa35b18 (patch) | |
tree | e13341cfee008f1c465b52abe441b7ade31a4505 /project2/proj2_s4498062/dns/cache.py | |
parent | dos2unix (diff) |
pylint project 2
Diffstat (limited to 'project2/proj2_s4498062/dns/cache.py')
-rw-r--r-- | project2/proj2_s4498062/dns/cache.py | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/project2/proj2_s4498062/dns/cache.py b/project2/proj2_s4498062/dns/cache.py index eab51c5..3ef14b3 100644 --- a/project2/proj2_s4498062/dns/cache.py +++ b/project2/proj2_s4498062/dns/cache.py @@ -1,5 +1,3 @@ -#!/usr/bin/env python2 - """A cache for resource records This module contains a class which implements a cache for DNS resource records, @@ -17,7 +15,7 @@ from dns.classes import Class class ResourceEncoder(json.JSONEncoder): """ Conver ResourceRecord to JSON - + Usage: string = json.dumps(records, cls=ResourceEncoder, indent=4) """ @@ -35,7 +33,7 @@ class ResourceEncoder(json.JSONEncoder): def resource_from_json(dct): """ Convert JSON object to ResourceRecord - + Usage: records = json.loads(string, object_hook=resource_from_json) """ @@ -52,7 +50,7 @@ class RecordCache(object): def __init__(self, ttl): """ Initialize the RecordCache - + Args: ttl (int): TTL of cached entries (if > 0) """ @@ -64,22 +62,22 @@ class RecordCache(object): Lookup for the resource records for a domain name with a specific type and class. - + Args: dname (str): domain name type_ (Type): type class_ (Class): class """ pass - + def add_record(self, record): """ Add a new Record to the cache - + Args: record (ResourceRecord): the record added to the cache """ pass - + def read_cache_file(self): """ Read the cache file from disk """ pass @@ -87,5 +85,3 @@ class RecordCache(object): def write_cache_file(self): """ Write the cache file to disk """ pass - - |