On 2014-07-02, Chris Angelico wrote:
> On Wed, Jul 2, 2014 at 7:32 PM, Adam Funk wrote:
>> Well, I've changed it to the following anyway.
>>
>> subdir_glob = subdir + '/*'
>> cursor.execute('SELECT filename FROM files WHERE filename GLOB ?',
>>(subdir_glob,
On Wed, Jul 2, 2014 at 7:32 PM, Adam Funk wrote:
> Well, I've changed it to the following anyway.
>
> subdir_glob = subdir + '/*'
> cursor.execute('SELECT filename FROM files WHERE filename GLOB ?',
>(subdir_glob,))
> rows = cursor.fetchall()
>
On 2014-07-01, Chris Angelico wrote:
> On Wed, Jul 2, 2014 at 1:15 AM, Adam Funk wrote:
>> On 2014-07-01, Chris Angelico wrote:
>>> There is one critical consideration, though. What happens if the
>>> directory name contains an underscore or percent sign? Or can you
>>> absolutely guarantee that
On 2014-07-01, Chris Angelico wrote:
> On Wed, Jul 2, 2014 at 1:15 AM, Adam Funk wrote:
>> On 2014-07-01, Chris Angelico wrote:
>>
>>> On Tue, Jul 1, 2014 at 9:26 PM, Adam Funk wrote:
cursor.execute('SELECT filename FROM files WHERE filename IS ?',
(filename,))
>>>
>>> Shouldn
On Wed, Jul 2, 2014 at 1:15 AM, Adam Funk wrote:
> On 2014-07-01, Chris Angelico wrote:
>
>> On Tue, Jul 1, 2014 at 9:26 PM, Adam Funk wrote:
>>> cursor.execute('SELECT filename FROM files WHERE filename IS ?',
>>> (filename,))
>>
>> Shouldn't this be an equality check rather than IS, wh
On 2014-07-01, Chris Angelico wrote:
> On Tue, Jul 1, 2014 at 9:26 PM, Adam Funk wrote:
>> cursor.execute('SELECT filename FROM files WHERE filename IS ?',
>> (filename,))
>
> Shouldn't this be an equality check rather than IS, which normally I'd
> expect to be "IS NULL" or "IS NOT NULL"
On Tue, Jul 1, 2014 at 10:13 PM, MRAB wrote:
> Anyway, I'm sure there's something in SQL for "insert or update" or "on
> duplicate", but that's an SQL question, not a Python question.
Not in standard SQL, no; there might be in SQLite, as a non-standard
extension, but it's a fundamentally hard pro
On 2014-07-01 12:26, Adam Funk wrote:
I have some code that reads files in a leafnode2 news spool & needs to
check for new files periodically. The full paths are all like
'/var/spool/news/message.id/345/<123...@example.com>' with a 3-digit
subdirectory & a Message-ID for the filename itself. I'
On Tue, Jul 1, 2014 at 9:26 PM, Adam Funk wrote:
> cursor.execute('SELECT filename FROM files WHERE filename IS ?',
> (filename,))
Shouldn't this be an equality check rather than IS, which normally I'd
expect to be "IS NULL" or "IS NOT NULL"?
As to your actual question: Your two databas
I have some code that reads files in a leafnode2 news spool & needs to
check for new files periodically. The full paths are all like
'/var/spool/news/message.id/345/<123...@example.com>' with a 3-digit
subdirectory & a Message-ID for the filename itself. I'm using Python
3 & sqlite3 in the standa
10 matches
Mail list logo