git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [StGit PATCH] compressed import v3

From
CWClark Williams <clark.williams@gmail.com>
Date
Jun 14, 2008, 15:49 UTC
Message-ID
<4853E86F.1050504@gmail.com>
In-Reply-To
<20080614102646.GD14282@diana.vm.bytemark.co.uk>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Karl Hasselström wrote:
Show 21 quoted lines
> On 2008-06-13 09:53:49 -0500, Clark Williams wrote:
> 
>> I'm interested to hear how you'd condense the code in
>> __gethandleandname().
> 
> Like this, for example:
> 
>     import bz2, gzip
>     for copen, ext in [(gzip.open, '.gz'), (bz2.BZ2File, '.bz2')]:
>         try:
>             f = copen(filename)
>             f.read(1)
>             f.seek(0)
>             return (f, __mkpatchname(filename, ext))
>         except IOError, e:
>             pass
> 
> If you don't mind, I'll just fix that up directly in your patch. (I
> also took the liberty to rename the function to __get_handle_and_name,
> since that's more consistent with other functions in that file.)
> 
Ah, that's very nice. Your changes work for me.
Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iEYEARECAAYFAkhT6G8ACgkQqA4JVb61b9cCeQCfedD0BjOeRa3sbGvkRNe2BPMq 6roAoJE7klMbgymRCJ3B+pEjzgnTWO2l =uZ+n -----END PGP SIGNATURE-----

Previous: Karl Hasselström
Message 5 of 5 in “compressed import v3”
  1. compressed import v3Clark Williams, Jun 12, 2008
  2. Karl HasselströmJun 13, 2008
  3. Clark WilliamsJun 13, 2008
  4. Karl HasselströmJun 14, 2008
  5. Clark WilliamsJun 14, 2008

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.