#2515 to_list is not needed in py3 code
Merged 3 years ago by tkopecek. Opened 3 years ago by tkopecek.
tkopecek/koji issue2514  into  master

file modified
+14 -15
@@ -68,7 +68,6 @@ 

      move_and_symlink,

      multi_fnmatch,

      safer_move,

-     to_list

  )

  

  try:
@@ -2189,18 +2188,18 @@ 

      Blocked packages/groups can alternatively also be listed if incl_blocked is set to True

      """

      groups = get_tag_groups(tag, event, inherit, incl_pkgs, incl_reqs)

-     groups = to_list(groups.values())

+     groups = list(groups.values())

      for group in groups:

          # filter blocked entries and collapse to a list

          if 'packagelist' in group:

              if incl_blocked:

-                 group['packagelist'] = to_list(group['packagelist'].values())

+                 group['packagelist'] = list(group['packagelist'].values())

              else:

                  group['packagelist'] = [x for x in group['packagelist'].values()

                                          if not x['blocked']]

          if 'grouplist' in group:

              if incl_blocked:

-                 group['grouplist'] = to_list(group['grouplist'].values())

+                 group['grouplist'] = list(group['grouplist'].values())

              else:

                  group['grouplist'] = [x for x in group['grouplist'].values()

                                        if not x['blocked']]
@@ -2366,7 +2365,7 @@ 

              # in a perfect world, this list would only include canonical

              # arches, but not all admins will undertand that.

              ret[koji.canonArch(arch)] = 1

-     return to_list(ret.keys())

+     return list(ret.keys())

  

  

  def get_active_tasks(host=None):
@@ -5922,7 +5921,7 @@ 

          'package': build['name'],

          'version': build['version'],

          'release': build['release'],

-         'buildroots': to_list(brmap.values()),

+         'buildroots': list(brmap.values()),

          'import': True,

          'import_type': 'rpm',

      }
@@ -7927,7 +7926,7 @@ 

              idx.setdefault(row['id'], row)

          if limit is not None and len(idx) > limit:

              break

-     ret['rpms'] = to_list(idx.values())

+     ret['rpms'] = list(idx.values())

  

      if lazy and ret['rpms']:

          return ret
@@ -7971,7 +7970,7 @@ 

              idx.setdefault(row['id'], row)

          if limit is not None and len(idx) > limit:

              break

-     ret['archives'] = to_list(idx.values())

+     ret['archives'] = list(idx.values())

  

      if lazy and ret['archives']:

          return ret
@@ -8383,7 +8382,7 @@ 

          if from_tag:

              for email in get_notification_recipients(build, from_tag['id'], state):

                  recipients[email] = 1

-     recipients_uniq = to_list(recipients.keys())

+     recipients_uniq = list(recipients.keys())

      if len(recipients_uniq) > 0 and not (is_successful and ignore_success):

          task_id = make_task('tagNotification',

                              [recipients_uniq, is_successful, tag_id, from_id, build_id, user_id,
@@ -8779,7 +8778,7 @@ 

          if not self.data and not self.rawdata:

              return "-- incomplete update: no assigns"

          parts = ['INSERT INTO %s ' % self.table]

-         columns = sorted(to_list(self.data.keys()) + to_list(self.rawdata.keys()))

+         columns = sorted(list(self.data.keys()) + list(self.rawdata.keys()))

          parts.append("(%s) " % ', '.join(columns))

          values = []

          for key in columns:
@@ -8822,7 +8821,7 @@ 

              del data['create_event']

              del data['creator_id']

          clauses = ["%s = %%(%s)s" % (k, k) for k in data]

-         query = QueryProcessor(columns=to_list(data.keys()), tables=[self.table],

+         query = QueryProcessor(columns=list(data.keys()), tables=[self.table],

                                 clauses=clauses, values=data)

          if query.execute():

              return True
@@ -11465,7 +11464,7 @@ 

              # lookup tag id

              tag = get_tag_id(tag, strict=True)

          for mapping in [stops, jumps]:

-             for key in to_list(mapping.keys()):

+             for key in mapping.keys():

                  mapping[int(key)] = mapping[key]

          return readFullInheritance(tag, event, reverse, stops, jumps)

  
@@ -13689,7 +13688,7 @@ 

          scratchdir = koji.pathinfo.scratch()

          username = get_user(task.getOwner())['name']

          destdir = joinpath(scratchdir, username, 'task_%s' % task_id)

-         for reldir, files in to_list(results['files'].items()) + [('', results['logs'])]:

+         for reldir, files in list(results['files'].items()) + [('', results['logs'])]:

              for filename in files:

                  if reldir:

                      relpath = joinpath(reldir, filename)
@@ -13717,7 +13716,7 @@ 

          scratchdir = koji.pathinfo.scratch()

          username = get_user(task.getOwner())['name']

          destdir = joinpath(scratchdir, username, 'task_%s' % task_id)

-         for relpath in to_list(results['output'].keys()) + results['logs']:

+         for relpath in list(results['output'].keys()) + results['logs']:

              filename = joinpath(koji.pathinfo.task(results['task_id']), relpath)

              dest = joinpath(destdir, relpath)

              move_and_symlink(filename, dest, create_dir=True)
@@ -14435,7 +14434,7 @@ 

                              build = get_build(build_id)

                              logger.error("g:a:v supplied by build %(nvr)s", build)

                              logger.error("Build supplies %i archives: %r",

-                                          len(build_archives), to_list(build_archives.keys()))

+                                          len(build_archives), list(build_archives.keys()))

                          if tag_archive:

                              logger.error("Size mismatch, br: %i, db: %i",

                                           fileinfo['size'], tag_archive['size'])

file modified
+1 -1
@@ -155,7 +155,7 @@ 

          return args

  

      def system_listMethods(self):

-         return koji.util.to_list(self.funcs.keys())

+         return list(self.funcs.keys())

  

      def system_methodSignature(self, method):

          # it is not possible to autogenerate this data

file modified
+1 -2
@@ -34,7 +34,6 @@ 

  import koji

  import kojiweb.util

  from koji.server import ServerRedirect

- from koji.util import to_list

  from kojiweb.util import _genHTML, _getValidTokens, _initValues

  

  
@@ -2257,7 +2256,7 @@ 

          if builds > maxBuilds:

              maxBuilds = builds

  

-     kojiweb.util.paginateList(values, to_list(targets.values()), start, 'targets', 'target', order)

+     kojiweb.util.paginateList(values, list(targets.values()), start, 'targets', 'target', order)

  

      values['order'] = order

  

@@ -30,7 +30,7 @@ 

  import koji

  import koji.util

  from koji.server import ServerError, ServerRedirect

- from koji.util import dslice, to_list

+ from koji.util import dslice

  

  

  class URLNotFound(ServerError):
@@ -402,7 +402,7 @@ 

          if isinstance(result, str):

              headers.setdefault('content-length', ('Content-Length', str(len(result))))

          headers.setdefault('content-type', ('Content-Type', 'text/html'))

-         headers = to_list(headers.values()) + extra

+         headers = list(headers.values()) + extra

          self.logger.debug("Headers:")

          self.logger.debug(koji.util.LazyString(pprint.pformat, [headers]))

          start_response(status, headers)