You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Yves Bergeron <yv...@shq.gouv.qc.ca> on 2005/10/11 13:52:59 UTC
Rép. : Re: How to get proplist for a file in a python script
Salut Stéphane,
Where does pysvn come from ?
>>> Stephane Bortzmeyer <bo...@nic.fr> 10/07/05 5:10 am >>>
On Thu, Oct 06, 2005 at 02:29:53PM -0400,
Yves Bergeron <yv...@shq.gouv.qc.ca> wrote
a message of 19 lines which said:
> Hi,
Bonjour,
> I know there is a perl script doing this thing
> (contrib/hook-scripts/check-mime-type.pl) but I prefer python since
> I already done a lot of job in that language.
Here is how I do it:
#!/usr/bin/python
import pysvn
import getopt
import sys
import string
import time
# Options by default
path = "." # Current directory
recurse = False
MAX = 60
try:
optlist, args = getopt.getopt (sys.argv[1:], "p:r",
["path=", "recurse!"])
for option, value in optlist:
if option == "--path" or option == "-p":
path = value
elif option == "--recurse" or option == "-r":
recurse = True
else:
raise Exception ("Unknown option " + str(option))
except getopt.error, reason:
raise Exception ("Usage: " + sys.argv[0] + ": " + str(reason))
if len(args) > 0:
raise Exception ("Usage: " + sys.argv[0] + ": no arguments expected")
client = pysvn.Client()
files = client.ls(path, recurse=recurse)
for file in files:
property = client.propget("svn:eol-style", "%s" % file['name'])
if len(property) > 0:
print file['name']
« Le présent courriel peut contenir des renseignements confidentiels et ne s'adresse qu'au destinataire dont le nom apparaît ci-dessus. Si ce courriel vous est parvenu par mégarde, veuillez le supprimer et nous en aviser aussitôt. Merci. »
Re: Rép. : Re: How to get proplist for a file in a python script
Posted by Barry Scott <ba...@barrys-emacs.org>.
On Oct 11, 2005, at 14:52, Yves Bergeron wrote:
> Salut Stéphane,
>
> Where does pysvn come from ?
From: pysvn.tigris.org
Barry
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org