[Pywikipedia-l] [Pywikipedia-svn] SVN: [6756] trunk/pywikipedia

Francesco Cosoleto cosoleto at gmail.com
Thu Apr 30 18:49:33 UTC 2009


nicdumz at svn.wikimedia.org ha scritto:
> Revision: 6756
> Author:   nicdumz
> Date:     2009-04-30 01:47:36 +0000 (Thu, 30 Apr 2009)
> 
> Log Message:
> -----------
> Adding an experimental contents_on_disk feature:
> save the Page contents on disk, in a python shelf, and load them
> only when needed, instead of loading the contents in RAM.
> 
> Activating this option might slow down a bit the whole interwiki
> process: fetching an entry on disk is slower than simply fetching in
> RAM the attribute. This should however greatly reduce the memory consumption.
[...]

> Modified: trunk/pywikipedia/interwiki.py
[...]
>  # (C) Rob W.W. Hooft, 2003
>  # (C) Daniel Herding, 2004
>  # (C) Yuri Astrakhan, 2005-2006
> +# (C) Pywikipedia bot team, 2007-2009

I think you should put your name instead of a generic "Pywikipedia bot 
team" copyright statement. A comment from original authors would be 
preferable though.

> +            index = 1
> +            while True:
> +                path = config.datafilepath('cache', 'pagestore' + str(index))       
> +                if not os.path.exists(path): break
> +                index += 1

At least this looks nice for diskcache module too, so we can easily get 
rid of the imported random module and the ugly '*-abfdexjwi' like filenames.

> +
> +        It's also not necessary to set theses line as a Subject destructor:

these

-- 
Francesco Cosoleto

"Resteranno però gli altri Achei lunghi capelli,
finché abbatteremo Troia: e se pure questi...
ma sì, sulle navi fuggite verso la patria terra!
Noi due, Stènelo e io, lotteremo, fino a che il termine
fatale d'Ilio troviamo, perché con nume propizio venimmo." (Omero)




More information about the Pywikipedia-l mailing list