[elbe-devel] [PATCH 1/3] soapclient, templates, virtapt, xmldefaults: fix style errors

Akash Satamkar akash at linutronix.de
Mon Sep 30 13:04:15 CEST 2019


----------------------------------------------------------------
             for url in self.xml.node('project/mirror/url-list'):
                 if url.has('raw-key'):
                     buf = []
                     for line in url.text('raw-key').splitlines():
                         if len(line) > 1:
                             buf.append(key_strip(line))
                     key = '\n'.join(buf)
                     self.add_key(key)

     def key_strip(self, k):
         key = textwrap.dedent(k)
         key = key.strip('\n')
         return key
------------------------------------------
this logic can remove multiple indentations and tabs in the public key 
block.
However,I am not sure whether we need these two lines:

-----BEGIN PGP PUBLIC KEY BLOCK-----
-----END PGP PUBLIC KEY BLOCK-----

for further processing.

On 9/30/19 9:02 AM, Torben Hohn wrote:
> On Sat, Sep 28, 2019 at 10:15:40AM -0400, Olivier Dion wrote:
>>
>> On 2019-09-27T22:12:37-0400, Olivier Dion <dion at linutronix.de> wrote:
>>
>>> ----------------------------------------------------------------------
>>>>>> import textwrap
>>>>>> a = "\n\n\tHello\n\t\tWorld!\n\n"
>>>>>> textwrap.dedent(a)
>>> '\n\nHello\n\tWorld!\n\n'
>>> ---------------------------------------------------------------------
>>> as you can see, if indentation are not at the same level, which in
>>> theory chould happen with some bad editor .. VSCode .., this result
>>> in some indentation not being striped.  Try the example above and mix
>>> some space and tab, there you have it.
>>
>> Forget that example, I got confused.  This is only true if you dedent a
>> text, but dedent individual lines is fine.
> 
> The plan is to dedent the whole Text.
> 
> an ascii armored key is pretty immune to indention, as long, as the
> first line is not indented.
> 
> for example... even this key is valid:
> 
> -----------------------------------------------------------------------------
> -----BEGIN PGP PUBLIC KEY BLOCK-----
>      
>      mQINBFxB7LsBEADCI/xhv0Ud/euxG2pudyeRo0i2aRai16bRY3XMfJnGV6XOaLtX
>      vs/vqILbJmSuR0/AC2ccUQDbssEID4INKoUL6nKlpYqDbnfiPTHFzFOImysd/zEp
>      5gvS3hko+GH84QA+B60wegEQ+K8SXtHMKh3EgSYUbsf2esncRpmrqt5DGkoenvZH
>      GaMjZ7XCh0cKK3adxhvuuU7bulsplOecfoCpiOlaWotpJ33zKIl4+JhrPpCk5ABv
>      M+zTZCTB0YyeSedw/O3EtD2Bv/Kf+Sqdx1T1bFwy5bNA1qB2+Q4EexbG/tDeQXok
>      WnDhUbakSFLmIx3JGEQK7SskN3mMbbq0s1+VmdO+cZOxoUtUaGKCmKf8lX+XXiGV
>      wA+G3S/m2IGbQlAZaYTCcHzqGojXaqEZNHAJ5x3bwGZWGRPHJkGMHcqqmcnHXoZs
>      5j3h6Ds8hj9rGB0cLDLsaG03vtNRXI+R6RYAy/lq+R1aQeX7iIKNZd2RmAQFy/SJ
>      DGkD8hvoZgvW/EyalZOiGz3/QiZkOUHCJ5+ib8MZsNSjub2o7PUK58QvsMfZNIrG
>      Fboh3TLhddZj3XY4oJQJKw6gocllHScXEYD43klpgWIIgC8AFA3TtFGoEreB6GvD
>      jOLp2NS8A/foMIXvlwvOb83s4nOK9F1l3Ny2y2yLD0P5h214XhLa+BMWxwARAQAB
>      tCtWb2xrZXIgSGFzcGVsIDx2b2xrZXIuaGFzcGVsQGxpbnV0cm9uaXguZGU+iQJU
>      BBMBCAA+FiEEu6ObeCfmxsAHs47wMVbdr+4FyroFAlxB7LsCGwMFCQWjmoAFCwkI
>      BwIGFQgJCgsCBBYCAwECHgECF4AACgkQMVbdr+4Fyrov+BAAioFBCQUF6rtf7rRM
>      4v+Eo0P4Pp8OsJYsQfvWuA4e4YXBoodMNANr3ZvbJHLGhZwsyS2RZAtanNl7BhHZ
>      r6rqkZ9w8NRWguXWBN8ykddi2S9ke34bUQjCJFIvV1/3G+GT54jlFSXjxuUSxmob
>      g9i3YEohidckHYv9VWYMCsU/k6I0U8Lpt7MIzca0/Y9oyvyQFMK7zoGDRIMdzffM
>         8qgwInpsaiMwTVrFHK0bl7XUWT7/4f/FjOslAHtqypXrcvIadc8/35fKtFW1oFlo
>         4nljDOSbIph0j8Rqr/Y11vSSqZQkrMk1lHreNG04Wyn3NgRA7H6GmpFi7cifaRMi
>         Ew0DUyjAPwdLWZiRrYSL/0Fv2Lj9RT+j4H2xEZkOYw8QJbdmUOIFmJPrBog05ya6
>      9wwawOUQInHXqlX+wuPf0De56jiw17ESRGcqHI8cdTwSKi+N1WEM15kNFXIC07Ot
>      Ah44uTGoE8X+I5QlHGjvzPYjMFm7lfTeHaReP27JGte/MaXWqgnBXNZPD0Tgnj+O
>      Qms2IHJ3qZbzI4khy80cfPLMKnrl59laAx534IeBfN1/ape5jtG2fPbWjQ38j+he
>      CHAQjTEe6IOYplYps42clqPZpi+ms2Ct9UubcuKzPen8lTGGmYTsWbqkVOVFjH5u
>      2NHdi/fY1pDH3EgJ98yxhLgw3liJATMEEAEIAB0WIQTEVrp0klDnppmyPHFEkjpY
>      LdsHOwUCXEnllwAKCRBEkjpYLdsHOy30B/sGbzhY0Jz7dVz4O4YPJ+icM/Ha6mbx
>      eEjvIa6WqCKxhL4GIAf+GWtruPOYGuPS488Ofj9XXc94cdEPWSfiwmMpiY3lMVo2
>      UDLpxX+J+MtCz9EPqzj5ABIiaDvE51V55VP0PNwidpdXSwuFhOnsMzJV6zpZvkmf
>      jWkPyk4q6GKQ+PtcewZ06GZtAJqyUOvydYzUY80LaZy8fziLRxPfL4ki7DYSxXlZ
>      sWjB9QU4hi301k49K0IS7EsUi0xWlh5GVGTBl2v95Vo0/Z0AE5EVFlI5BTaynRii
>      nSYOF782nQVlSoskSXaB8UIh/++nH031Ip8sG4rD/qQXTvYl5t6iN4M4uQINBFxB
>      7LsBEACy7ii9iNSb/Nr5G4QDXu61SwvFYZTCP0ldJtJ4qQbVj2/S0AaxxAq42XwR
>      JEndw4b/jl0gapmZARtosie6HaytSgoExtTnjsPOHnDuIGWbbod6Q2E/u2fqaP2P
>      qaC3Ja/ufAZ7ZhP83wj/22OBx0KNCkcOFwWUdLQa3Wu+pjP88hvJyjefDCq4CVnD
>      WtlhQjaHPnhfetaENvv6tL9wbuiC3LVT0PTHuMLKeITJD+3sffB4CrusbtiykAcV
>      Mn4Dfm56J9yCyzM452mZv6d2ltRub7QIXrngU979RbH1doMHtYFClKtEHT9Qd7o5
>      9tJ3yMGUMnzd50wTNY4pOGrkaaA6MgJnSOkDMzvaOOu8akgBUqTkwYEQ+1bSa1hH
>      KyFQNN1xhEcLnUvEXPqi/UZBMTvmhkLQ/0qR/O7liKSKIWcRQI3UTDBwAz5dgp4d
>      W+P3q6OoG73tzvE52JGHGqXEGwl+4znKfz8y0i7JbhNJr6Ym54j8IiN8HecoYUTa
>      WkuX6OFsEdhl0PlfpbW/neL1vqqj/ZHuu63YqioMYebzFvgM8E2TgNfmNW0VJhdm
>      SyWgmyUQ7AyJvcWd3aQhfPmnLEXezx5YnO2a8x7jMEcTy1O3ZxVTBAqL5/7qJwjd
>      ORl4hALYMBcUvM1aG9Wc5AhspYp7n7A0nRtg5kf86KtWDxs0qQARAQABiQI8BBgB
>      CAAmFiEEu6ObeCfmxsAHs47wMVbdr+4FyroFAlxB7LsCGwwFCQWjmoAACgkQMVbd
>      r+4FyrpgiQ//ceHAjporGrjSG/yguh5CceFAswx1ZGvThEupScaqvj1/XuQG3Vpr
>      aI7weSd/j6hlB1fyu1kmTnpGvgyblepioXcLa0D9AXavGtgPrq4wQ8T/iVw3hio2
>      WpyfEJ34gKMQTqxyEjH+yh3o9mrZxBwgmogT8Kxw4ha9l0rLOPwiavzm+SlBIjbw
>      PYoieejjZnpHU4HXqXQ5mF9OxBeaukUDTDP9js4Ox2CT3jiQw1fYSNktz9dKrS0d
>      d3+6/YX+h236Ie2NYDPduXlwyYjXP0GELrJjHHLXwtzGwqzidTdb+7dK9Wa1uZ3l
>      ymXDpLJSZl2by9whH6xO2Ww28h6KL+mw3MwFFhIAgJDdg1u5Q2SEinRJZKdOZOe3
>      3xbE2xJtvRTfR1UWKKfJ7WGsn3sTgkU6yu9PB7q+NDARQcv0VCMfFuvkPS4O4+7m
>      Zm3vlxVNjGYKmDNsj7aY5rDv6sZvQwQoRDmjeWNXd0m/435IVc4IzTAEU88OfxIk
>      JJ3/hh6ekTVso/DNlugfKMYaoB1aQGvN+pT5p4Sk9Q+TCtPrdBoc5+NXBnakWMy+
>      5i2gXkvEq9Wrj2uBgOLdV463vqp7vB+AmzuHcFZ4pc3HcGtScE54liCPNhe8pbJc
>      9FHePLY+xZUrn6Z6jWjTqcRM9ttG69e5ouGq4sPzF4qd9fUfRru6m9A=
>      =1rsw
>      -----END PGP PUBLIC KEY BLOCK-----
>      
>      
>      
>      
>      
>      
>      Buh
> -----------------------------------------------------------------------------
> 
>>
>> --
>> Olivier Dion Linutronix GmbH | Bahnhofstrasse 3 | D-88690
>> Uhldingen-Mühlhofen
> 



More information about the elbe-devel mailing list