On 22/02/2019 20:22, Bruce Dubbs via blfs-dev wrote:
> On 2/22/19 11:32 AM, Bruce Dubbs wrote:
>> On 2/22/19 9:32 AM, Pierre Labastie via blfs-dev wrote:
>>>
>>> On 22/02/2019 16:04, Pierre Labastie via blfs-dev wrote:
>>>>
>>>> On 22/02/2019 14:15, Pierre Labastie via blfs-dev wrote:
>>>>>
>>>>> On 22/02/2019 13:48, Pierre Labastie via blfs-dev wrote:
>>>>>>
>>>>>> On 22/02/2019 11:27, Thomas Trepl via blfs-dev wrote:
>>>>>>> Am Freitag, den 22.02.2019, 10:59 +0100 schrieb Thomas Trepl via blfs-
>>>>>>> dev:
>>>>>>>> Am Freitag, den 22.02.2019, 10:19 +0100 schrieb Pierre Labastie via
>>>>>>>> blfs-dev:
>>>>>>>>> On 22/02/2019 07:11, Bruce Dubbs via blfs-dev wrote:
>>>>>>>>>> We only have a few tags left:
>>>>>>>>>>
>>>>>>>>>> lfs83 tags:  33
>>>>>>>>>> ;fs84 tags: 803
>>>>>>>>>>
>>>>>>>>>> ...
>>>>>>>>>> networking/mailnews/fetchmail.xml: &lfs83_checked;
>>>>>>>>>> ...
>>>>>>>> Just looking at fetchmail. I got
>>>>>>>>
>>>>>>>> ...
>>>>>>>> test -z "/usr/lib/python3.7/site-packages" || /bin/mkdir -p
>>>>>>>> "/home/lfs/tmp/fetchmail/bin/fetchmail/usr/lib/python3.7/site-
>>>>>>>> packages"
>>>>>>>>   /usr/bin/install -c -m 644 fetchmailconf.py
>>>>>>>> '/home/lfs/tmp/fetchmail/bin/fetchmail/usr/lib/python3.7/site-
>>>>>>>> packages'
>>>>>>>> Byte-compiling python modules...
>>>>>>>> fetchmailconf.py
>>>>>>>> Sorry: TabError: inconsistent use of tabs and spaces in indentation
>>>>>>>> (fetchmailconf.py, line 19)
>>>>>>>> Byte-compiling python modules (optimized versions) ...
>>>>>>>> fetchmailconf.py
>>>>>>>> ...
>>>>>>>>
>>>>>>>> Looks like it compiles and installs anyway. Maybe a little patch will
>>>>>>>> remove that error. I'll have a look.
>>>>>>> Adding
>>>>>>>      2to3 -w fetchmailconf.py
>>>>>>>      sed -e "s/^\t\t\t/                        /" -i fetchmailconf.py
>>>>>>>      sed -e "s/^\t\t/                /" -i fetchmailconf.py
>>>>>>>      sed -e "s/^\t/        /" -i fetchmailconf.py
>>>>>>> removes all the errors and it compiles fine but the tree seds doesn't
>>>>>>> look very 'pretty'. Simply replacing all tabs with eight blanks does
>>>>>>> the job too but it destroys the visual apperance of that python script
>>>>>>> (while not important to functionality).
>>>>>>> Is there a better way to replace all tabs by spaces but only if they
>>>>>>> occur at line beginning?
>>>>>>
>>>>>> Maybe awk? or perl RE? But I'm not a specialist.
>>>>>
>>>>>
>>>>> There is also an utility built with tidy-html5, whose name is
>>>>> "tab2space": how about using that? (tidy is a short build)
>>>>>
>>>> "tab2space -t8 fetchmailconf.py fetchmailconf.py.out &&
>>>>
>>>> mv fetchmailconf.py.out fetchmailconf.py"
>>>>
>>>> Note that Python 2 (with Tk) is required for using this: "2to3" is not
>>>> enough to ensure P3 can be used: still generates errors like:
>>>> AttributeError: module 'string' has no attribute 'atoi'
>>>>
>>>> In summary: recommend tidy, add the 2 lines above, tell that Tk should be
>>>> built before Python 2 in the optional deps.
>>>
>>> Well, this script seems buggy, it does not work either with P2...
>>
>> Let me see if I can come up with a vim script.
> 
> Try this:
> 
> vim -s <(echo -e "gg=G\n:et\n:retab\nZZ") fetchmailconf.py
> 
> Note that this is a py2 file.  It doesn't work for me with py3.
> 

Sorry, I was not clear: the "buggy" (I think) script is fetchmailconf.py
(generates warnings or errors when clicking on "Edit" buttons, even when run
under P2).
The command above with tab2space works well (and tab2space is not a script
actually).

Note that there is no need to fix the tabs when running fetchmailconf.py with 
P2.

Pierre

-- 
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to