[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Duplicity-talk] backend query_info question
From: |
edgar . soldin |
Subject: |
Re: [Duplicity-talk] backend query_info question |
Date: |
Sat, 31 Dec 2011 18:28:24 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:8.0) Gecko/20111105 Thunderbird/8.0 |
On 31.12.2011 17:41, Michael Terry wrote:
> On 31 December 2011 07:49, <address@hidden> wrote:
>>> It can guarantee behavior from query_info that
>>> put/get just can't because it wraps the _query_file_info method
>>> provided by those implementations.
>>
>> although i am not finished, while working on the info retrieval for sftp i
>> modified the code so that backends do have to create dummy values if they
>> have none. this makes it more fault tolerant and easier for implementers.
>
> How does having backends create dummy values make things more fault
> tolerant or easier? The existing query_info wrapper already does this
> so that backend implementers don't have to.
sorry miswritten, i meant _don't_ have to.. my modified implementation assumes
that if a filename key is not given the file was not listed (because it is not
there), same for metadata keys.
>
>> on a second thought, having managed that i see no real need for a generic
>> query_info anymore. it could be put in each backend and each decides if it
>> wants to loop or not according to list retrievability or not.
>
> Ugh, I have no particular attachment to an underscore, but I do have
> an attachment to not duplicating code.
me too, absolutely.
on the following suggestion i renamed 'query_info' to 'list_long' as i think it
expresses better what the command does as it is known as the classic way (ls
-l) to retrieve detailed information about a file.
i imagine an implementation analogue to put/get. implement a stub in backend.py
and a list_long(self, filename_list) in the inheriting backends that support
it. use it in a backend.py:put_verified(...) which essentially does a put and
verifies thereafter. verification is skipped on a NotImplementedError for
list_long or if the metadata is missing of course.
this way really _all_ uploaded files would be verified if the backends supports
size metadata.
btw. what did you implement the 'raise_errors' parameter for?
..ede