Changeset - 21f7b699d467
[Not reviewed]
kallithea/lib/colored_formatter.py
Show inline comments
 
@@ -15,7 +15,7 @@
 
import logging
 

	
 

	
 
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
 
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(30, 38)
 

	
 
# Sequences
 
RESET_SEQ = "\033[0m"
kallithea/lib/helpers.py
Show inline comments
 
@@ -366,7 +366,7 @@ def gen_color(n=10000):
 
    golden_ratio = 0.618033988749895
 
    h = 0.22717784590367374
 

	
 
    for _unused in xrange(n):
 
    for _unused in range(n):
 
        h += golden_ratio
 
        h %= 1
 
        HSV_tuple = [h, 0.95, 0.95]
kallithea/lib/timerproxy.py
Show inline comments
 
@@ -20,7 +20,7 @@ from sqlalchemy.interfaces import Connec
 

	
 
log = logging.getLogger('timerproxy')
 

	
 
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = xrange(30, 38)
 
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(30, 38)
 

	
 

	
 
def color_sql(sql):
kallithea/lib/vcs/utils/progressbar.py
Show inline comments
 
@@ -43,7 +43,7 @@ class ProgressBar(object):
 
    def __iter__(self):
 
        start = self.step
 
        end = self.steps + 1
 
        for x in xrange(start, end):
 
        for x in range(start, end):
 
            self.render(x)
 
            yield x
 

	
 
@@ -359,7 +359,7 @@ def main():
 

	
 
    print("Standard progress bar...")
 
    bar = ProgressBar(30)
 
    for x in xrange(1, 31):
 
    for x in range(1, 31):
 
        bar.render(x)
 
        time.sleep(0.02)
 
    bar.stream.write('\n')
 
@@ -410,7 +410,7 @@ def main():
 
    bar.width = 50
 
    bar.elements.remove('steps')
 
    bar.elements += ['transfer', 'time', 'eta', 'speed']
 
    for x in xrange(0, bar.steps, 1024):
 
    for x in range(0, bar.steps, 1024):
 
        bar.render(x)
 
        time.sleep(0.01)
 
        now = datetime.datetime.now()
kallithea/model/gist.py
Show inline comments
 
@@ -50,7 +50,7 @@ def make_gist_access_id():
 
    rnd = random.SystemRandom() # use cryptographically secure system PRNG
 
    alphabet = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjklmnpqrstuvwxyz'
 
    length = 20
 
    return u''.join(rnd.choice(alphabet) for _ in xrange(length))
 
    return u''.join(rnd.choice(alphabet) for _ in range(length))
 

	
 

	
 
class GistModel(object):
kallithea/tests/other/test_vcs_operations.py
Show inline comments
 
@@ -187,7 +187,7 @@ def _add_files(vcs, dest_dir, files_no=3
 
        author_str = 'User <%s>' % email
 
    else:
 
        author_str = 'User ǝɯɐᴎ <%s>' % email
 
    for i in xrange(files_no):
 
    for i in range(files_no):
 
        cmd = """echo "added_line%s" >> %s""" % (i, added_file)
 
        Command(dest_dir).execute(cmd)
 
        if vcs == 'hg':
kallithea/tests/vcs/test_archives.py
Show inline comments
 
@@ -18,7 +18,7 @@ class ArchivesTestCaseMixin(_BackendTest
 
    @classmethod
 
    def _get_commits(cls):
 
        start_date = datetime.datetime(2010, 1, 1, 20)
 
        for x in xrange(5):
 
        for x in range(5):
 
            yield {
 
                'message': 'Commit %d' % x,
 
                'author': 'Joe Doe <joe.doe@example.com>',
 
@@ -35,7 +35,7 @@ class ArchivesTestCaseMixin(_BackendTest
 
            self.tip.fill_archive(stream=f, kind='zip', prefix='repo')
 
        out = zipfile.ZipFile(path)
 

	
 
        for x in xrange(5):
 
        for x in range(5):
 
            node_path = '%d/file_%d.txt' % (x, x)
 
            decompressed = out.read('repo/' + node_path)
 
            assert decompressed == self.tip.get_node(node_path).content
 
@@ -49,7 +49,7 @@ class ArchivesTestCaseMixin(_BackendTest
 
        outfile = tarfile.open(path, 'r|gz')
 
        outfile.extractall(outdir)
 

	
 
        for x in xrange(5):
 
        for x in range(5):
 
            node_path = '%d/file_%d.txt' % (x, x)
 
            assert open(os.path.join(outdir, 'repo/' + node_path), 'rb').read() == self.tip.get_node(node_path).content
 

	
 
@@ -62,7 +62,7 @@ class ArchivesTestCaseMixin(_BackendTest
 
        outfile = tarfile.open(path, 'r|bz2')
 
        outfile.extractall(outdir)
 

	
 
        for x in xrange(5):
 
        for x in range(5):
 
            node_path = '%d/file_%d.txt' % (x, x)
 
            assert open(os.path.join(outdir, 'repo/' + node_path), 'rb').read() == self.tip.get_node(node_path).content
 

	
kallithea/tests/vcs/test_changesets.py
Show inline comments
 
@@ -45,7 +45,7 @@ class _ChangesetsWithCommitsTestCaseixin
 
    @classmethod
 
    def _get_commits(cls):
 
        start_date = datetime.datetime(2010, 1, 1, 20)
 
        for x in xrange(5):
 
        for x in range(5):
 
            yield {
 
                'message': 'Commit %d' % x,
 
                'author': 'Joe Doe <joe.doe@example.com>',
 
@@ -143,7 +143,7 @@ class _ChangesetsTestCaseMixin(_BackendT
 
    @classmethod
 
    def _get_commits(cls):
 
        start_date = datetime.datetime(2010, 1, 1, 20)
 
        for x in xrange(5):
 
        for x in range(5):
 
            yield {
 
                'message': u'Commit %d' % x,
 
                'author': u'Joe Doe <joe.doe@example.com>',
 
@@ -238,7 +238,7 @@ class _ChangesetsTestCaseMixin(_BackendT
 
    def test_get_filenodes_generator(self):
 
        tip = self.repo.get_changeset()
 
        filepaths = [node.path for node in tip.get_filenodes_generator()]
 
        assert filepaths == ['file_%d.txt' % x for x in xrange(5)]
 
        assert filepaths == ['file_%d.txt' % x for x in range(5)]
 

	
 
    def test_size(self):
 
        tip = self.repo.get_changeset()
kallithea/tests/vcs/test_getitem.py
Show inline comments
 
@@ -9,7 +9,7 @@ class GetitemTestCaseMixin(_BackendTestM
 
    @classmethod
 
    def _get_commits(cls):
 
        start_date = datetime.datetime(2010, 1, 1, 20)
 
        for x in xrange(5):
 
        for x in range(5):
 
            yield {
 
                'message': 'Commit %d' % x,
 
                'author': 'Joe Doe <joe.doe@example.com>',
 
@@ -23,7 +23,7 @@ class GetitemTestCaseMixin(_BackendTestM
 
        assert self.repo[-1] == self.repo.get_changeset()
 

	
 
    def test__getitem__returns_correct_items(self):
 
        changesets = [self.repo[x] for x in xrange(len(self.repo.revisions))]
 
        changesets = [self.repo[x] for x in range(len(self.repo.revisions))]
 
        assert changesets == list(self.repo.get_changesets())
 

	
 

	
kallithea/tests/vcs/test_getslice.py
Show inline comments
 
@@ -9,7 +9,7 @@ class GetsliceTestCaseMixin(_BackendTest
 
    @classmethod
 
    def _get_commits(cls):
 
        start_date = datetime.datetime(2010, 1, 1, 20)
 
        for x in xrange(5):
 
        for x in range(5):
 
            yield {
 
                'message': 'Commit %d' % x,
 
                'author': 'Joe Doe <joe.doe@example.com>',
kallithea/tests/vcs/test_inmemchangesets.py
Show inline comments
 
@@ -300,7 +300,7 @@ class InMemoryChangesetTestMixin(_Backen
 
    def test_multiple_commits(self):
 
        N = 3  # number of commits to perform
 
        last = None
 
        for x in xrange(N):
 
        for x in range(N):
 
            fname = 'file%s' % str(x).rjust(5, '0')
 
            content = 'foobar\n' * x
 
            node = FileNode(fname, content=content)
0 comments (0 inline, 0 general)