[Biopython-dev] [biopython] Missing DTD files (#260)
Michiel de Hoon
mjldehoon at yahoo.com
Mon Dec 9 14:20:23 UTC 2013
Can somebody with a Windows computer check what os.path.expanduser('~') refers to on Windows? Or how matplotlib solves this on Windows (they are storing files under $HOME/.matplotlib on unix-like systems; I don't know what they use on Windows).
Thanks,
-Michiel.
--------------------------------------------
On Mon, 12/9/13, Peter Cock <p.j.a.cock at googlemail.com> wrote:
Subject: Re: [Biopython-dev] [biopython] Missing DTD files (#260)
To: "Michiel de Hoon" <mjldehoon at yahoo.com>
Cc: "Biopython-Dev Mailing List" <biopython-dev at lists.open-bio.org>
Date: Monday, December 9, 2013, 5:13 AM
On Mon, Dec 9, 2013 at 6:33 AM,
Michiel de Hoon <mjldehoon at yahoo.com>
wrote:
> Current we are using os.path.expanduser('~')
/.biopython/Bio/Entrez/DTDs to look for locally stored
DTDs.
> This should work on Windows also.
Well partly - it would create a "scary" .biopython folder
which would NOT be hidden by default. On Windows
we could deliberately mark that folder as hidden (a
file system attribute, used instead of the leading dot
convention from Unix). However, I think we should
really be using something under:
$HOME\Local Settings\Application Data
A little research might be needed for how to get that
setting (if possible without reading the registry and the
additional Python dependency that would entail).
> Then I would suggest the following if a DTD file is
missing:
> 1) Print a non-scary warning message that we will
attempt to download the DTD;
> 2) Download the DTD;
> 3) Try to store it in the local DTD directory. If this
fails (e.g. due to file permissions or whatnot), print
another warning message;
> 4) Use the downloaded DTD to parse the XML.
> Any final objections?
Only with regard to the location of the cache on Windows.
Peter
More information about the Biopython-dev
mailing list