コード例 #1
0
    def test_new(self):
        project = GitHubProject(name='foo',
                                owner='damien',
                                description='just a test',
                                is_public=True)

        eq_('foo', project.name)
        eq_('damien', project.owner)
        eq_('just a test', project.description)
        eq_(True, project.is_public)
        eq_('http://github.com/damien/foo', str(project.url))
        eq_('http://github.com/damien/foo', project.url.http)
        eq_('[email protected]:damien/foo.git', project.url.ssh)
        eq_('git://github.com/damien/foo.git', project.url.git)
コード例 #2
0
ファイル: template.py プロジェクト: nguyenkaos2/github-tools
 def pre(self, command, output_dir, vars):
     """
     Set extra template variables:
     
     * "year", current year.
     * "gitignore", set to ".gitignore".
     * "licence_body", licence notice of the package.
     * "gpl_type", for gpl licences
     """
     vars['gitignore'] = '.gitignore'
     try:
         project = GitHubProject(name=vars['project'])
         vars['project_url'] = project.url.http
         vars['issue_url'] = project.url.issue
     except AttributeError:
         vars['project_url'] = ('http://github.com/<GITHUB USER NAME>/%s' %
                                vars['project'])
         vars['issue_url'] = (
             'http://github.com/<GITHUB USER NAME>/%s/issues' %
             vars['project'])