Package gbp :: Package git :: Module modifier :: Class GitModifier
[hide private]
[frames] | no frames]

Class GitModifier

object --+
         |
        GitModifier

Stores authorship/committer information

Instance Methods [hide private]
 
__init__(self, name=None, email=None, date=None)
x.__init__(...) initializes x; see help(type(x)) for signature
 
_parse_date(self, date)
 
_get_env(self, who)
Get author or committer information as env var dictionary
 
get_date(self)
Return date as a git raw date
 
set_date(self, date)
Set date from timestamp, git raw date or datetime object
dict
get_author_env(self)
Get env vars for authorship information
dict
get_committer_env(self)
Get env vars for committer information
 
__getitem__(self, key)
 
items(self)

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]
 
keys()
Properties [hide private]
  date
Return date as a git raw date
  datetime
Return the date as datetime object
  tz_offset
Return the date's UTC offset

Inherited from object: __class__

Method Details [hide private]

__init__(self, name=None, email=None, date=None)
(Constructor)

 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • name (str) - the modifier's name
  • email (str) - the modifier's email
  • date (str (git raw date), int (timestamp) or datetime object) - the date of the modification
Overrides: object.__init__

get_author_env(self)

 

Get env vars for authorship information

>>> g = GitModifier("foo", "bar")
>>> g.get_author_env()
{'GIT_AUTHOR_EMAIL': 'bar', 'GIT_AUTHOR_NAME': 'foo'}
Returns: dict
Author information suitable to use as environment variables

get_committer_env(self)

 

Get env vars for committer information

>>> g = GitModifier("foo", "bar")
>>> g.get_committer_env()
{'GIT_COMMITTER_NAME': 'foo', 'GIT_COMMITTER_EMAIL': 'bar'}
Returns: dict
Commiter information suitable to use as environment variables

Property Details [hide private]

date

Return date as a git raw date

Get Method:
get_date(self) - Return date as a git raw date
Set Method:
set_date(self, date) - Set date from timestamp, git raw date or datetime object

datetime

Return the date as datetime object

Get Method:
unreachable.datetime(self) - Return the date as datetime object

tz_offset

Return the date's UTC offset

Get Method:
unreachable.tz_offset(self) - Return the date's UTC offset