[Notes] [Git][BuildStream/buildstream][master] 5 commits: doc/source/conf.py: Fix E201, E202 warnings



Title: GitLab

Tristan Van Berkom pushed to branch master at BuildStream / buildstream

Commits:

8 changed files:

Changes:

  • buildstream/plugins/sources/tar.py
    ... ... @@ -127,7 +127,7 @@ class TarSource(DownloadableFileSource):
    127 127
             if not base_dir.endswith(os.sep):
    
    128 128
                 base_dir = base_dir + os.sep
    
    129 129
     
    
    130
    -        l = len(base_dir)
    
    130
    +        L = len(base_dir)
    
    131 131
             for member in tar.getmembers():
    
    132 132
     
    
    133 133
                 # First, ensure that a member never starts with `./`
    
    ... ... @@ -145,9 +145,9 @@ class TarSource(DownloadableFileSource):
    145 145
                     #       base directory.
    
    146 146
                     #
    
    147 147
                     if member.type == tarfile.LNKTYPE:
    
    148
    -                    member.linkname = member.linkname[l:]
    
    148
    +                    member.linkname = member.linkname[L:]
    
    149 149
     
    
    150
    -                member.path = member.path[l:]
    
    150
    +                member.path = member.path[L:]
    
    151 151
                     yield member
    
    152 152
     
    
    153 153
         # We want to iterate over all paths of a tarball, but getmembers()
    

  • buildstream/plugins/sources/zip.py
    ... ... @@ -121,13 +121,13 @@ class ZipSource(DownloadableFileSource):
    121 121
             if not base_dir.endswith(os.sep):
    
    122 122
                 base_dir = base_dir + os.sep
    
    123 123
     
    
    124
    -        l = len(base_dir)
    
    124
    +        L = len(base_dir)
    
    125 125
             for member in archive.infolist():
    
    126 126
                 if member.filename == base_dir:
    
    127 127
                     continue
    
    128 128
     
    
    129 129
                 if member.filename.startswith(base_dir):
    
    130
    -                member.filename = member.filename[l:]
    
    130
    +                member.filename = member.filename[L:]
    
    131 131
                     yield member
    
    132 132
     
    
    133 133
         # We want to iterate over all paths of an archive, but namelist()
    

  • buildstream/utils.py
    ... ... @@ -645,6 +645,7 @@ def _pretty_size(size, dec_places=0):
    645 645
                 psize /= 1024
    
    646 646
         return "{size:g}{unit}".format(size=round(psize, dec_places), unit=unit)
    
    647 647
     
    
    648
    +
    
    648 649
     # A sentinel to be used as a default argument for functions that need
    
    649 650
     # to distinguish between a kwarg set to None and an unset kwarg.
    
    650 651
     _sentinel = object()
    

  • doc/bst2html.py
    ... ... @@ -96,8 +96,8 @@ def _ansi2html_get_styles(palette):
    96 96
     
    
    97 97
             for g in range(24):
    
    98 98
                 i = g + 232
    
    99
    -            l = g * 10 + 8
    
    100
    -            indexed_style['%s' % i] = ''.join('%02X' % c if 0 <= c <= 255 else None for c in (l, l, l))
    
    99
    +            L = g * 10 + 8
    
    100
    +            indexed_style['%s' % i] = ''.join('%02X' % c if 0 <= c <= 255 else None for c in (L, L, L))
    
    101 101
     
    
    102 102
             _ANSI2HTML_STYLES[palette] = (regular_style, bold_style, indexed_style)
    
    103 103
         return _ANSI2HTML_STYLES[palette]
    
    ... ... @@ -455,6 +455,7 @@ def run_bst(directory, force, source_cache, description, palette):
    455 455
     
    
    456 456
         return 0
    
    457 457
     
    
    458
    +
    
    458 459
     if __name__ == '__main__':
    
    459 460
         try:
    
    460 461
             run_bst()
    

  • doc/source/conf.py
    ... ... @@ -19,10 +19,10 @@
    19 19
     #
    
    20 20
     import os
    
    21 21
     import sys
    
    22
    -sys.path.insert(0, os.path.abspath('..'))
    
    23
    -
    
    24 22
     from buildstream import __version__
    
    25 23
     
    
    24
    +sys.path.insert(0, os.path.abspath('..'))
    
    25
    +
    
    26 26
     # -- General configuration ------------------------------------------------
    
    27 27
     
    
    28 28
     # If your documentation needs a minimal Sphinx version, state it here.
    
    ... ... @@ -112,7 +112,7 @@ add_module_names = False
    112 112
     pygments_style = 'sphinx'
    
    113 113
     
    
    114 114
     # A list of ignored prefixes for module index sorting.
    
    115
    -modindex_common_prefix = [ 'buildstream.' ]
    
    115
    +modindex_common_prefix = ['buildstream.']
    
    116 116
     
    
    117 117
     # If true, keep warnings as "system message" paragraphs in the built documents.
    
    118 118
     # keep_warnings = False
    

  • tests/cachekey/cachekey.py
    ... ... @@ -129,6 +129,7 @@ def assert_cache_keys(project_dir, output):
    129 129
                                  "Use tests/cachekey/update.py to automatically " +
    
    130 130
                                  "update this test case")
    
    131 131
     
    
    132
    +
    
    132 133
     ##############################################
    
    133 134
     #             Test Entry Point               #
    
    134 135
     ##############################################
    

  • tests/cachekey/update.py
    ... ... @@ -65,5 +65,6 @@ def update_keys():
    65 65
     
    
    66 66
                     write_expected_key(element_name, actual_keys[element_name])
    
    67 67
     
    
    68
    +
    
    68 69
     if __name__ == '__main__':
    
    69 70
         update_keys()

  • tests/frontend/buildcheckout.py
    ... ... @@ -288,6 +288,7 @@ def test_build_checkout_force_tarball(datafiles, cli):
    288 288
         assert os.path.join('.', 'usr', 'bin', 'hello') in tar.getnames()
    
    289 289
         assert os.path.join('.', 'usr', 'include', 'pony.h') in tar.getnames()
    
    290 290
     
    
    291
    +
    
    291 292
     fetch_build_checkout_combos = \
    
    292 293
         [("strict", kind) for kind in ALL_REPO_KINDS] + \
    
    293 294
         [("non-strict", kind) for kind in ALL_REPO_KINDS]
    



  • [Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]