Beispiel #1
0
    def __init__(self, identifier, uri, name, type):
        if identifier is None:
            self.identifier = DBRepository.id_counter
            DBRepository.id_counter += 1
        else:
            self.identifier = identifier

        self.uri = to_unicode(uri)
        self.name = to_unicode(name)
        self.type = to_unicode(type)
Beispiel #2
0
    def __init__(self, identifier, uri, name, type):
        if identifier is None:
            self.identifier = DBRepository.id_counter
            DBRepository.id_counter += 1
        else:
            self.identifier = identifier

        self.uri = to_unicode(uri)
        self.name = to_unicode(name)
        self.type = to_unicode(type)
Beispiel #3
0
    def __init__(self, identifier, commit):
        if identifier is None:
            self.identifier = DBLog.id_counter
            DBLog.id_counter += 1
        else:
            self.identifier = identifier

        self.rev = to_unicode(commit.revision)
        self.committer = None
        self.author = None
        self.date = commit.date
        self.date_tz = commit.date_tz
        self.author_date = commit.author_date
        self.author_date_tz = commit.author_date_tz
        self.message = to_unicode(commit.message)
        self.composed_rev = commit.composed_rev
Beispiel #4
0
    def __init__(self, identifier, commit):
        if identifier is None:
            self.identifier = DBLog.id_counter
            DBLog.id_counter += 1
        else:
            self.identifier = identifier

        self.rev = to_unicode(commit.revision)
        self.committer = None
        self.author = None
        self.date = commit.date
        self.date_tz = commit.date_tz
        self.author_date = commit.author_date
        self.author_date_tz = commit.author_date_tz
        self.message = to_unicode(commit.message)
        self.composed_rev = commit.composed_rev
Beispiel #5
0
    def __init__(self, identifier, name):
        if identifier is None:
            self.identifier = DBTag.id_counter
            DBTag.id_counter += 1
        else:
            self.identifier = identifier

        self.name = to_unicode(name)
Beispiel #6
0
    def __init__(self, identifier, name):
        if identifier is None:
            self.identifier = DBTag.id_counter
            DBTag.id_counter += 1
        else:
            self.identifier = identifier

        self.name = to_unicode(name)
Beispiel #7
0
 def _get_file_contents(self):
     """Returns contents of the file, stripped of whitespace 
         at either end
         """
     # An encode will fail if the source code can't be converted to
     # unicode, ie. it's not already utf-8, or latin-1, or something
     # obvious. This almost always means that the file isn't source
     # code at all.
     return to_unicode(self._file_contents)
Beispiel #8
0
    def __init__(self, identifier, file_name):
        if identifier is None:
            self.identifier = DBFile.id_counter
            DBFile.id_counter += 1
        else:
            self.identifier = identifier

        self.file_name = to_unicode(file_name)
        self.repository_id = None
Beispiel #9
0
    def __init__(self, identifier, person):
        if identifier is None:
            self.identifier = DBPerson.id_counter
            DBPerson.id_counter += 1
        else:
            self.identifier = identifier

        self.name = to_unicode(person.name)
        self.email = person.email or None
Beispiel #10
0
 def _get_file_contents(self):
         """Returns contents of the file, stripped of whitespace 
         at either end
         """
         # An encode will fail if the source code can't be converted to
         # unicode, ie. it's not already utf-8, or latin-1, or something
         # obvious. This almost always means that the file isn't source
         # code at all. 
         return to_unicode(self._file_contents)
Beispiel #11
0
    def __init__(self, identifier, file_name):
        if identifier is None:
            self.identifier = DBFile.id_counter
            DBFile.id_counter += 1
        else:
            self.identifier = identifier

        self.file_name = to_unicode(file_name)
        self.repository_id = None
Beispiel #12
0
    def __init__(self, identifier, person):
        if identifier is None:
            self.identifier = DBPerson.id_counter
            DBPerson.id_counter += 1
        else:
            self.identifier = identifier

        self.name = to_unicode(person.name)
        self.email = person.email or None
Beispiel #13
0
 def testLatin1String(self):
     latin1String = "Hell\xf3 W\xe4rld"
     self.assertEqual (u"Helló Wärld", utils.to_unicode(latin1String))
Beispiel #14
0
 def testAsciiString(self):
     asciiString = "HelloWorld"
     self.assertEqual (u"HelloWorld", utils.to_unicode(asciiString))
Beispiel #15
0
 def testUtf8String(self):
     utf8String = "\xC3\x96\xE1\x9B\x96\x61"
     self.assertEqual (u"\u00d6\u16d6a", utils.to_unicode(utf8String))
Beispiel #16
0
 def testUnicode(self):
     self.assertEqual (u"Hello World", utils.to_unicode(u"Hello World"))