Feature Requests item #1791272, was opened at 2007-09-10 00:32
Message generated for change (Comment added) made by cosoleto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1791272&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: lusum (lusum)
Assigned to: Nobody/Anonymous (nobody)
Summary: Version management in wikipedia.py
Initial Comment:
It should be fine for find easly copyright violation to explore the history of a page. It is possible to have the pare with wikipedia.get. It should be possible to have all the history of a page ( or a particular version ) in a list returned by a function wikipedia.getHistory?
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto)
Date: 2007-09-17 19:04
Message:
Logged In: YES
user_id=181280
Originator: NO
Hey Lusum. You can use fullVersionHistory() to download history of a page
with page contents. Do you want bot build diffs data and send related
queries to search engine?
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1791272&group_…
Bugs item #1795683, was opened at 2007-09-16 10:05
Message generated for change (Comment added) made by cosoleto
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1795683&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jani Patokallio (jpatokal)
Assigned to: Nobody/Anonymous (nobody)
Summary: No error message if download is interrupted
Initial Comment:
I'm using imagetransfer.py to download some images off a Mediawiki site, using the following very straightforward code:
uo = wikipedia.MyURLopener()
img = uo.open(url)
file = open(targetFile, "w");
file.write(img.read())
file.close()
img.close()
However, I found out the hard way that there is no warning of any kind if the download is interrupted halfway through for any reason. Worse yet, there is no practical way to check if the file was downloaded successfully: the MD5 checksum function requires downloading the image and is thus subject to the same bug! The only way to determine even the file's actual size requires hacking through the file version history, and the getFileVersionHistory() command seems to break against the Mediawiki version of Wikitravel anyway.
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto)
Date: 2007-09-17 18:23
Message:
Logged In: YES
user_id=181280
Originator: NO
Try this:
http://sourceforge.net/tracker/index.php?func=detail&aid=1796316&group_id=9….
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-09-17 04:11
Message:
Logged In: NO
So I managed to fix getFileVersionHistory by borrowing the code from an
older version of pywikipediabot that works with Mediawiki 1.10.1, and now I
can at least compare sizes. Can you make your patch available?
----------------------------------------------------------------------
Comment By: Francesco Cosoleto (cosoleto)
Date: 2007-09-16 19:05
Message:
Logged In: YES
user_id=181280
Originator: NO
I have tried to fix your getVersionHistory() problem. You can read file
length in HTTP headers too:
f.info().getheader('Content-Length')
I have written a improvised and fully untested patch to wikipedia.getUrl()
with check length and transfer resume feature, but I am not sure it's
useful.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603138&aid=1795683&group_…
Patches item #1796316, was opened at 2007-09-17 18:20
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1796316&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Francesco Cosoleto (cosoleto)
Assigned to: Nobody/Anonymous (nobody)
Summary: upload.py, upload_image(), check length and resume feature
Initial Comment:
Untested.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603140&aid=1796316&group_…
Revision: 4318
Author: russblau
Date: 2007-09-17 15:39:18 +0000 (Mon, 17 Sep 2007)
Log Message:
-----------
Additional data file updates
Modified Paths:
--------------
trunk/pywikipedia/login.py
trunk/pywikipedia/watchlist.py
Modified: trunk/pywikipedia/login.py
===================================================================
--- trunk/pywikipedia/login.py 2007-09-17 15:31:23 UTC (rev 4317)
+++ trunk/pywikipedia/login.py 2007-09-17 15:39:18 UTC (rev 4318)
@@ -62,26 +62,7 @@
}
}
-def makepath(path):
- """ creates missing directories for the given path and
- returns a normalized absolute version of the path.
- - if the given path already exists in the filesystem
- the filesystem is not modified.
-
- - otherwise makepath creates directories along the given path
- using the dirname() of the path. You may append
- a '/' to the path if you want it to be a directory path.
-
- from holger(a)trillke.net 2002/03/18
- """
- from os import makedirs
- from os.path import normpath,dirname,exists,abspath
-
- dpath = normpath(dirname(path))
- if not exists(dpath): makedirs(dpath)
- return normpath(abspath(path))
-
class LoginManager:
def __init__(self, password = None, sysop = False, site = None):
self.site = site or wikipedia.getSite()
@@ -177,8 +158,10 @@
The argument data is the raw data, as returned by getCookie().
Returns nothing."""
- filename = 'login-data/%s-%s-%s-login.data' % (self.site.family.name, self.site.lang, self.username)
- f = open(makepath(filename), 'w')
+ filename = wikipedia.datafilepath('login-data',
+ '%s-%s-%s-login.data'
+ % (self.site.family.name, self.site.lang, self.username))
+ f = open(filename, 'w')
f.write(data)
f.close()
Modified: trunk/pywikipedia/watchlist.py
===================================================================
--- trunk/pywikipedia/watchlist.py 2007-09-17 15:31:23 UTC (rev 4317)
+++ trunk/pywikipedia/watchlist.py 2007-09-17 15:39:18 UTC (rev 4318)
@@ -34,7 +34,8 @@
# Use cached copy if it exists.
watchlist = cache[site]
else:
- fn = 'watchlists/watchlist-%s-%s.dat' % (site.family.name, site.lang)
+ fn = wikipedia.datafilepath('watchlists',
+ 'watchlist-%s-%s.dat' % (site.family.name, site.lang))
try:
# find out how old our saved dump is (in seconds)
file_age = time.time() - os.path.getmtime(fn)
@@ -55,26 +56,6 @@
def isWatched(pageName, site=None):
watchlist = get(site)
return pageName in watchlist
-
-def makepath(path):
- """ creates missing directories for the given path and
- returns a normalized absolute version of the path.
-
- - if the given path already exists in the filesystem
- the filesystem is not modified.
-
- - otherwise makepath creates directories along the given path
- using the dirname() of the path. You may append
- a '/' to the path if you want it to be a directory path.
-
- from holger(a)trillke.net 2002/03/18
- """
- from os import makedirs
- from os.path import normpath,dirname,exists,abspath
-
- dpath = normpath(dirname(path))
- if not exists(dpath): makedirs(dpath)
- return normpath(abspath(path))
def refresh(site):
# get watchlist special page's URL
@@ -91,13 +72,14 @@
watchlist.append(pageName)
# Save the watchlist to disk
# The file is stored in the watchlists subdir. Create if necessary.
- f = open(makepath('watchlists/watchlist-%s-%s.dat' % (site.family.name, site.lang)), 'w')
+ f = open(wikipedia.datafilepath('watchlists',
+ 'watchlist-%s-%s.dat' % (site.family.name, site.lang)), 'w')
pickle.dump(watchlist, f)
f.close()
def refresh_all():
import dircache, time
- filenames = dircache.listdir('watchlists')
+ filenames = dircache.listdir(wikipedia.datafilepath('watchlists'))
watchlist_filenameR = re.compile('watchlist-([a-z\-:]+).dat')
for filename in filenames:
match = watchlist_filenameR.match(filename)
Feature Requests item #1636098, was opened at 2007-01-15 09:59
Message generated for change (Comment added) made by nobody
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1636098&group_…
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Interface Improvements (example)
Group: None
Status: Open
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: -file: option for category.py
Initial Comment:
Similar to that of replace.py's, so that a list of articles to change categories on can be given in a local file.
----------------------------------------------------------------------
Comment By: Nobody/Anonymous (nobody)
Date: 2007-09-17 05:26
Message:
Logged In: NO
I agree, this MUST be implemented!
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=603141&aid=1636098&group_…