예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    def test_author_name(self):

        for test_str, result in self.TEST_AUTHORS:
            self.assertEqual(result[0], author_name(test_str))
예제 #4
0
파일: base.py 프로젝트: stardust85/vcs
    def author_name(self):
        """
        Returns Author name for given commit
        """

        return author_name(self.author)
예제 #5
0
파일: base.py 프로젝트: stardust85/vcs
    def committer_name(self):
        """
        Returns Author name for given commit
        """

        return author_name(self.committer)
예제 #6
0
    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:
예제 #7
0
파일: test_utils.py 프로젝트: methane/vcs
    def test_author_name(self):

        for test_str, result in self.TEST_AUTHORS:
            self.assertEqual(result[0], author_name(test_str))
예제 #8
0
    def author_name(self):
        """
        Returns Author name for given commit
        """

        return author_name(self.author)
예제 #9
0
    def committer_name(self):
        """
        Returns Author name for given commit
        """

        return author_name(self.committer)