Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try to sort the list, where <code>A</code> elements will be processed before the <code>M</code> elements, and use a dictionary to save them, so the first entries will be overwritten. Use <code>reverse=True</code> to keep the <code>A</code> entries.</p> <pre><code>lst = ['A /cloudos-ui/branches/bare_metal (from /cloudos-ui/branches/rc4g1build:9930)', 'M /cloudos-ui/branches/bare_metal/misc/cosmos/packaging/DEBIAN/control', 'M /cloudos-ui/branches/bare_metal/misc/cosmos/scripts/create_cosmos_installer.sh', 'M /cloudos-ui/branches/bare_metal/misc/skyline/packaging/DEBIAN/control', 'M /cloudos-ui/branches/bare_metal/misc/skyline/scripts/create_skyline_installer.sh', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/forms.py', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/tables.py', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/templates/flavors/_create.html', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/templates/flavors/_edit.html', 'A /cloudos-ui/branches/bare_metal/misc/skyline/scripts/create_skyline_installer.sh', 'A /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/forms.py', 'A /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/tables.py', 'A /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/templates/flavors/_create.html'] d = {} for elem in sorted(lst): l = elem.split(None, 1) d[l[1]] = elem print(list(d.values())) </code></pre> <p>It yields:</p> <pre><code>['A /cloudos-ui/branches/bare_metal (from /cloudos-ui/branches/rc4g1build:9930)', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/templates/flavors/_edit.html', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/forms.py', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/tables.py', 'M /cloudos-ui/branches/bare_metal/misc/cosmos/packaging/DEBIAN/control', 'M /cloudos-ui/branches/bare_metal/src/horizon/openstack_dashboard/dashboards/admin/flavors/templates/flavors/_create.html', 'M /cloudos-ui/branches/bare_metal/misc/skyline/packaging/DEBIAN/control', 'M /cloudos-ui/branches/bare_metal/misc/cosmos/scripts/create_cosmos_installer.sh', 'M /cloudos-ui/branches/bare_metal/misc/skyline/scripts/create_skyline_installer.sh'] </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload