Re: lyx to lyx on the Mac command line

2017-08-09 Thread Dr Eberhard Lisse
Jose,

great, thanks.

Do I need to file a request for feature?


el

On 2017-08-09 16:30 , José Abílio Matos wrote:
> On Wednesday, 9 August 2017 09.56.31 WEST Dr Eberhard Lisse wrote:
[...]
>> lyx2lyx is a python script, so I am wondering whether there is not
>> perhaps a way of doing this inside the script, perhaps with something
>> like --upgrade-in-place (so it's not used by accident) and do this
>> inside the script?
> 
>  
> 
> That can be done. The option could be -i or --in-place for compatibility
> with sed, perl and company.
> 
>  
> 
> Honestly now it is not be best moment, since we are stabilizing the
> release for 2.3 to be out.
> 
>  
> 
> I have added this task for my 2.4 to do list. If we can test the result
> this could be possibly be back-ported to 2.3.
[...]




Re: lyx to lyx on the Mac command line

2017-08-09 Thread José Abílio Matos
On Wednesday, 9 August 2017 09.56.31 WEST Dr Eberhard Lisse wrote:
> Jose,
> 
> thanks, but still no error checking :-)-O
> 
> lyx2lyx is a python script, so I am wondering whether there is not
> perhaps a way of doing this inside the script, perhaps with something
> like --upgrade-in-place (so it's not used by accident) and do this
> inside the script?

That can be done. The option could be -i or --in-place for compatibility with 
sed, perl and 
company.

Honestly now it is not be best moment, since we are stabilizing the release for 
2.3 to be out.

I have added this task for my 2.4 to do list. If we can test the result this 
could be possibly be 
back-ported to 2.3.

> Don't know python myself, unfortunately :-)-O
> 
> el

Regards,
-- 
José Abílio


Re: lyx to lyx on the Mac command line

2017-08-09 Thread Dr Eberhard Lisse
Jose,

thanks, but still no error checking :-)-O

lyx2lyx is a python script, so I am wondering whether there is not
perhaps a way of doing this inside the script, perhaps with something
like --upgrade-in-place (so it's not used by accident) and do this
inside the script?

Don't know python myself, unfortunately :-)-O

el

On 08/08/2017 20:30, José Abílio Matos wrote:
[...]
> Using bash in one line we have (backup file.lyx -> file.old.lyx):
> 
>  
> 
> for lfile in $(find . -name '*lyx' -print); do
> ofile=${lfile%%.lyx}.old.lyx; lyx2lyx < $ofile -o $lfile; done
[...]



Re: lyx to lyx on the Mac command line

2017-08-09 Thread Dr Eberhard Lisse
Stephan,

thanks, but I keep it right there :-)-O

el

On 08/08/2017 22:36, Stephan Witt wrote:
[...]
> On Mac you may have multiple LyX applications on your system.
> The standard location is the folder /Applications and the name
> is LyX.app. There it is located in Contents/Resources/lyx2lyx/.
> 
> So, the standard is 
> /Applications/LyX.app/Contents/Resources/lyx2lyx/lyx2lyx
> 
> But the application bundle is completely relocatable. It is up
> to the owner of the Mac to know where the „current“ LyX.app is
> located.
> 
> Stephan
[...]





Re: lyx to lyx on the Mac command line

2017-08-08 Thread Stephan Witt
Am 08.08.2017 um 17:07 schrieb José Abílio Matos :
> 
> On Tuesday, 8 August 2017 15.50.28 WEST Dr Eberhard Lisse wrote:
>> Hi,
>> 
>> is there a way of changing a lyx file from an older version to the
>> current one on the command line, like opening the file, making a
>> modification to trigger the saving allowed and saving it under the old
>> filename?
>> 
>>  find . -name '*lyx' -exec whatever {} \;
>> 
>> 
>> I wouldn't mind even a Apple Script :-)-O
>> 
>> greetings, el
> 
> I do not use macs, last time I did it was running linux as opposed to macos 
> 9. :-)
> 
> In any case the script responsible for converting the lyx files to a newer 
> format is called lyx2lyx.
> 
> If you get its path (e.g. here on linux it is /usr/share/lyx/lyx2lyx/lyx2lyx) 
> then you can call it directly. It has several options for command line call 
> and it even supports compressed lyx files directly.

On Mac you may have multiple LyX applications on your system.
The standard location is the folder /Applications and the name
is LyX.app. There it is located in Contents/Resources/lyx2lyx/.

So, the standard is 
/Applications/LyX.app/Contents/Resources/lyx2lyx/lyx2lyx

But the application bundle is completely relocatable. It is up
to the owner of the Mac to know where the „current“ LyX.app is
located.

Stephan

> 
> I can help further if you need.
> 
> Regards,
> -- 
> José Abílio



Re: lyx to lyx on the Mac command line

2017-08-08 Thread José Abílio Matos
On Tuesday, 8 August 2017 17.24.30 WEST Dr Eberhard Lisse wrote:
> José
> 
> thank you, but it lyx2lyx does not do what I need.
> 
>   lyx2lyx file.lyx -o file.lyx
> 
> clobbers file.lyx
> 
> Something like
> 
>   PID=$$
>   cp file.lyx file.$PID.lyx
>   lyx2lyx file.$PID.lyx file.lyx
> 
> doesn't fit on the command line so needs refinement as a bash script to
> take arguments and do further error checking...
> 
> not what would call 'one the command line'
> 
> 
> el

Using bash in one line we have (backup file.lyx -> file.old.lyx):

for lfile in $(find . -name '*lyx' -print); do ofile=${lfile%%.lyx}.old.lyx; 
lyx2lyx < $ofile -o $lfile; 
done

:-)
-- 
José Abílio


Re: lyx to lyx on the Mac command line

2017-08-08 Thread Dr Eberhard Lisse
José

thank you, but it lyx2lyx does not do what I need.

lyx2lyx file.lyx -o file.lyx

clobbers file.lyx

Something like

PID=$$
cp file.lyx file.$PID.lyx
lyx2lyx file.$PID.lyx file.lyx

doesn't fit on the command line so needs refinement as a bash script to
take arguments and do further error checking...

not what would call 'one the command line'


el

On 08/08/2017 16:07, José Abílio Matos wrote:
> On Tuesday, 8 August 2017 15.50.28 WEST Dr Eberhard Lisse wrote:
> 
>> Hi,
> 
>>
> 
>> is there a way of changing a lyx file from an older version to the
> 
>> current one on the command line, like opening the file, making a
> 
>> modification to trigger the saving allowed and saving it under the old
> 
>> filename?
> 
>>
> 
>> find . -name '*lyx' -exec whatever {} \;
> 
>>
> 
>>
> 
>> I wouldn't mind even a Apple Script :-)-O
> 
>>
> 
>> greetings, el
> 
>  
> 
> I do not use macs, last time I did it was running linux as opposed to
> macos 9. :-)
> 
>  
> 
> In any case the script responsible for converting the lyx files to a
> newer format is called lyx2lyx.
> 
>  
> 
> If you get its path (e.g. here on linux it is
> /usr/share/lyx/lyx2lyx/lyx2lyx) then you can call it directly. It has
> several options for command line call and it even supports compressed
> lyx files directly.
> 
>  
> 
> I can help further if you need.
> 
>  
> 
> Regards,
> 
> -- 
> 
> José Abílio
> 




Re: lyx to lyx on the Mac command line

2017-08-08 Thread José Abílio Matos
On Tuesday, 8 August 2017 15.50.28 WEST Dr Eberhard Lisse wrote:
> Hi,
> 
> is there a way of changing a lyx file from an older version to the
> current one on the command line, like opening the file, making a
> modification to trigger the saving allowed and saving it under the old
> filename?
> 
>   find . -name '*lyx' -exec whatever {} \;
> 
> 
> I wouldn't mind even a Apple Script :-)-O
> 
> greetings, el

I do not use macs, last time I did it was running linux as opposed to macos 9. 
:-)

In any case the script responsible for converting the lyx files to a newer 
format is called lyx2lyx.

If you get its path (e.g. here on linux it is /usr/share/lyx/lyx2lyx/lyx2lyx) 
then you can call it 
directly. It has several options for command line call and it even supports 
compressed lyx files 
directly.

I can help further if you need.

Regards,
-- 
José Abílio