Esempio n. 1
0
    def save(self):
        if not self.slug:
            self.slug = slugify(self.name)

        super(GitRepoRepository, self).save()
        repodir = self.get_dir()
        if not self.fs.exists(repodir):
            self.fs.mkdir(repodir)

        self.fs.pushd(repodir)
        self._run_sync('git init --bare')
        self.fs.popd()
Esempio n. 2
0
    def create_repository(self, name, description):
        GitRepository = meta.get_model('GitRepository')

        title = unicode(name)
        repo = GitRepository.create(
            name=title,
            slug=slugify(title),
            description=unicode(description),
            owner=self
        )

        return repo
Esempio n. 3
0
 def test_full_accents(self):
     "slugify should be able to slugify a much accented sentence"
     original = "Ação é bordô à síri tãmisa"
     got = slugify(original)
     assert_equals(got, "acao-e-bordo-a-siri-tamisa")
Esempio n. 4
0
 def test_special_chars(self):
     "slugify should remove any special chars"
     original = "here!@#$%*-()_+and{}[]-~^`'´/?\|there"
     got = slugify(original)
     assert_equals(got, "here-and-there")
Esempio n. 5
0
 def test_my_name(self):
     "slugify should be able to slugify my name :)"
     original = "Gabriel Falcão"
     got = slugify(original)
     assert_equals(got, "gabriel-falcao")
Esempio n. 6
0
 def test_simple_spaces(self):
     "slugify should replace blank spaces with a dash"
     original = "simple string with spaces"
     assert_equals(slugify(original), "simple-string-with-spaces")
Esempio n. 7
0
 def test_full_accents(self):
     "slugify should be able to slugify a much accented sentence"
     original = "Ação é bordô à síri tãmisa"
     got = slugify(original)
     assert_equals(got, "acao-e-bordo-a-siri-tamisa")
Esempio n. 8
0
 def test_my_name(self):
     "slugify should be able to slugify my name :)"
     original = "Gabriel Falcão"
     got = slugify(original)
     assert_equals(got, "gabriel-falcao")
Esempio n. 9
0
 def test_special_chars(self):
     "slugify should remove any special chars"
     original = "here!@#$%*-()_+and{}[]-~^`'´/?\|there"
     got = slugify(original)
     assert_equals(got, "here-and-there")
Esempio n. 10
0
 def test_simple_spaces(self):
     "slugify should replace blank spaces with a dash"
     original = "simple string with spaces"
     assert_equals(slugify(original),
                   "simple-string-with-spaces")