Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'builtin': 0.07; 'root,': 0.07; 'compute': 0.09; 'files:': 0.09; 'received:151': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; ':-)': 0.13; 'dirs,': 0.16; 'emanuele': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'set()': 0.16; 'subject:based': 0.16; 'subject:values': 0.16; 'variable': 0.20; 'header:User- Agent:1': 0.26; 'right.': 0.27; 'header:X-Complaints-To:1': 0.28; 'node': 0.29; 'writes:': 0.29; 'probably': 0.29; 'error': 0.30; 'file': 0.32; 'subject:data': 0.33; 'to:addr:python-list': 0.33; 'thanks': 0.34; 'list': 0.35; 'path': 0.35; 'received:org': 0.36; 'bad': 0.37; 'rather': 0.37; 'subject:: ': 0.38; 'files': 0.38; 'to:addr:python.org': 0.39; 'header:Received:5': 0.40; 'most': 0.61; 'quando': 0.84; 'angel': 0.93; 'join.': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Lele Gaifax Subject: Re: sync databse table based on current directory data without losign previous values Date: Wed, 06 Mar 2013 15:16:09 +0100 Organization: Nautilus Entertainments References: <390f0dc5-5750-4849-9433-a19d90cc8566@googlegroups.com> <3958fc2b-a2fe-4c85-a104-4c6f551cf787@googlegroups.com> <28828019-279a-4d8c-a7ea-ba677b4a8165@googlegroups.com> <87r4jsj019.fsf@nautilus.nautilus> <5137453C.8070405@davea.name> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 151.62.76.222 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:zAubKcBfOv5J8URk1CaYEfZ6Oi0= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 24 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1362579381 news.xs4all.nl 6951 [2001:888:2000:d::a6]:42030 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:40639 Dave Angel writes: >> # Compute a set of current fullpaths >> current_fullpaths = set() >> for root, dirs, files in os.walk(path): >> for fullpath in files: > > 'fullpath' is a rather misleading name to use, since the 'files' list > contains only the terminal node of the file name. It's only a full > path after you do the following join. Yes, you're right. Dunno what urged me to ``M-x replace-string file fullpath`` introducing both an error and a bad variable name, most probably the unconscious desire of not clobbering builtin names... :-) Thanks for pointing it out, ciao, lele. -- nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia. lele@metapensiero.it | -- Fortunato Depero, 1929.