def __init__(self, server="firmware.diydrones.com",
                 directory="/SRTM/",
                 cachedir=None,
                 offline=0,
                 debug=False):

        if cachedir is None:
            try:
                cachedir = os.path.join(os.environ['HOME'], '.tilecache/SRTM')
            except Exception:
                cachedir = os.path.join(tempfile.gettempdir(), 'MAVProxySRTM')

        self.debug = debug
        self.offline = offline
        self.first_failure = False
        self.server = server
        self.directory = directory
        self.cachedir = cachedir
        '''print "SRTMDownloader - server= %s, directory=%s." % \
              (self.server, self.directory)'''
        if not os.path.exists(cachedir):
            mp_util.mkdir_p(cachedir)
        self.filelist = {}
        self.filename_regex = re.compile(
                r"([NS])(\d{2})([EW])(\d{3})\.hgt\.zip")
        self.filelist_file = os.path.join(self.cachedir, "filelist_python")
        self.min_filelist_len = 14500
def __init__ ( self , server = "firmware.diydrones.com" , directory = "/SRTM/" , cachedir = None , offline = 0 , debug = False ) : if cachedir is None : try : cachedir = os . path . join ( os . environ [ 'HOME' ] , '.tilecache/SRTM' ) except Exception : cachedir = os . path . join ( tempfile . gettempdir ( ) , 'MAVProxySRTM' ) self . debug = debug self . offline = offline self . first_failure = False self . server = server self . directory = directory self . cachedir = cachedir if not os . path . exists ( cachedir ) : mp_util . mkdir_p ( cachedir ) self . filelist = { } self . filename_regex = re . compile ( r"([NS])(\d{2})([EW])(\d{3})\.hgt\.zip" ) self . filelist_file = os . path . join ( self . cachedir , "filelist_python" ) self . min_filelist_len = 14500
print "SRTMDownloader - server= %s, directory=%s." % \
              (self.server, self.directory)