gbp.git.modifier.GitModifier(object) class documentationgbp.git.modifier
(View In Hierarchy)
Stores authorship/committer information
| Method | __init__ | No summary |
| Method | get_date | Return date as a git raw date |
| Method | set_date | Set date from timestamp, git raw date or datetime object |
| Method | datetime | Return the date as datetime object |
| Method | tz_offset | Return the date's UTC offset |
| Method | get_author_env | Get env vars for authorship information |
| Method | get_committer_env | Get env vars for committer information |
| Method | get | Undocumented |
| Method | __getitem__ | Undocumented |
| Static Method | keys | Undocumented |
| Method | items | Undocumented |
| Method | _parse_date | Undocumented |
| Method | _get_env | Get author or committer information as env var dictionary |
@param name: the modifier's name
@type name: C{str}
@param email: the modifier's email
@type email: C{str}
@param date: the date of the modification
@type date: C{str} (git raw date), C{int} (timestamp) or I{datetime} object
Get env vars for authorship information
>>> g = GitModifier("Joey Ramone", "joey@example.com")
>>> g.get_author_env()['GIT_AUTHOR_EMAIL']
'joey@example.com'
>>> g.get_author_env()['GIT_AUTHOR_NAME']
'Joey Ramone'
@return: Author information suitable to use as environment variables
@rtype: C{dict}
Get env vars for committer information
>>> g = GitModifier("Joey Ramone", "joey@example.com")
>>> g.get_committer_env()['GIT_COMMITTER_EMAIL']
'joey@example.com'
>>> g.get_committer_env()['GIT_COMMITTER_NAME']
'Joey Ramone'
@return: Committer information suitable to use as environment variables
@rtype: C{dict}