diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 16:49:05 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2009-10-11 16:49:05 +0200 |
commit | 9374a916588d9fe7169937ba262c86ad710cfa74 (patch) | |
tree | dfe77a02cfa3fbe34563326cea95e92694d21b9a /lib/git/actor.py | |
parent | 20f202d83bdf1f332a3cb8f010bcf8bf3c2807bd (diff) | |
download | gitpython-9374a916588d9fe7169937ba262c86ad710cfa74.tar.gz |
converted all spaces to tabs ( 4 spaces = 1 tab ) just to allow me and my editor to work with the files properly. Can convert it back for releaes
Diffstat (limited to 'lib/git/actor.py')
-rw-r--r-- | lib/git/actor.py | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/lib/git/actor.py b/lib/git/actor.py index 28f50e73..f1aeda9b 100644 --- a/lib/git/actor.py +++ b/lib/git/actor.py @@ -7,40 +7,40 @@ import re class Actor(object): - """Actors hold information about a person acting on the repository. They - can be committers and authors or anything with a name and an email as - mentioned in the git log entries.""" - # precompiled regex - name_only_regex = re.compile( r'<.+>' ) - name_email_regex = re.compile( r'(.*) <(.+?)>' ) - - def __init__(self, name, email): - self.name = name - self.email = email - - def __str__(self): - return self.name - - def __repr__(self): - return '<git.Actor "%s <%s>">' % (self.name, self.email) - - @classmethod - def from_string(cls, string): - """ - Create an Actor from a string. - - ``str`` - is the string, which is expected to be in regular git format - - Format - John Doe <jdoe@example.com> - - Returns - Actor - """ - if cls.name_only_regex.search(string): - m = cls.name_email_regex.search(string) - name, email = m.groups() - return Actor(name, email) - else: - return Actor(string, None) + """Actors hold information about a person acting on the repository. They + can be committers and authors or anything with a name and an email as + mentioned in the git log entries.""" + # precompiled regex + name_only_regex = re.compile( r'<.+>' ) + name_email_regex = re.compile( r'(.*) <(.+?)>' ) + + def __init__(self, name, email): + self.name = name + self.email = email + + def __str__(self): + return self.name + + def __repr__(self): + return '<git.Actor "%s <%s>">' % (self.name, self.email) + + @classmethod + def from_string(cls, string): + """ + Create an Actor from a string. + + ``str`` + is the string, which is expected to be in regular git format + + Format + John Doe <jdoe@example.com> + + Returns + Actor + """ + if cls.name_only_regex.search(string): + m = cls.name_email_regex.search(string) + name, email = m.groups() + return Actor(name, email) + else: + return Actor(string, None) |