def get_user_name(self, config_file=None): """ Returns user's name from global configuration file. :param config_file: A path to file which should be used to retrieve configuration from (might also be a list of file paths) """ username = self.get_config_value('ui', 'username') if username: return author_name(username) return None
def test_author_name(self): for test_str, result in self.TEST_AUTHORS: self.assertEqual(result[0], author_name(test_str))
def author_name(self): """ Returns Author name for given commit """ return author_name(self.author)
def committer_name(self): """ Returns Author name for given commit """ return author_name(self.committer)
from rhodecode.model.scm import ScmModel return ScmModel().is_following_repo(repo_name, user_id) flash = _Flash() #============================================================================== # SCM FILTERS available via h. #============================================================================== from vcs.utils import author_name, author_email from rhodecode.lib import credentials_filter, age as _age age = lambda x:_age(x) capitalize = lambda x: x.capitalize() email = author_email email_or_none = lambda x: email(x) if email(x) != x else None person = lambda x: author_name(x) short_id = lambda x: x[:12] hide_credentials = lambda x: ''.join(credentials_filter(x)) def bool2icon(value): """Returns True/False values represented as small html image of true/false icons :param value: bool value """ if value is True: return HTML.tag('img', src=url("/images/icons/accept.png"), alt=_('True')) if value is False: