Re: no modules availables

2020-08-14 Thread José Abílio Matos
On Friday, 14 August 2020 16.28.22 WEST Jose Ramom Flores das Seixas wrote:
> Hi:
> 
> I take a long time without using LyX, but my package manager has been
> updating lyx when new versions come out. Nowadays, I have installed version
> 2.3.5.2 (OS: Ubuntu 18.04).
> 
> Today I tried to edit a file, with lyxformat 544, but LyX tells me a module
> is missing. Looking at the module dialogue I found that no module is
> available.
> 
> I've checked that the standard module files are in /usr/share/lyx/layouts,
> and besides them I have some other modules in ~/.lyx/layouts.
> 
> When I run LyX from a terminal I can notice the following error:
> 
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xa9 in position 395:
> invalid start byte support/Systemcall.cpp (276): Systemcall: 'python -tt
> "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with exit
> code 1
> 
>  LyX: Done!

From experience this means that you have a old layout file or module that have 
an encoding that is not utf-8. In your case I assume that the culprit is 
either in latin1 or latin9 (the difference between those is the presence/
absence of the euro sign).

Also I thought that we had fixed all the remainder errors like this in 2.3.5.2

So my suggestion is to go to your personal lyx directory and check the 
encoding of file. By default in linux the location of the personal directory 
is ~/.lyx. You can see this in LyX using the menu: Help->About LyX->Version 
and see the User dir entry there.

Using the shell in my case I have:

$ cd ~/.lyx
$ file bind/*
bind/user.bind: ASCII text

My suggestion is to check the layouts directory that could be the likely 
source of the problem:

$ file layouts/*


What happens if from the command line you run directly:

$ python /usr/share/lyx/configure.py

That will tells where does the code fails and it will be easier to diagnose 
the issue.

> Finally, when executing Reconfigure, an error dialog appears with the
> following message:
> 
> The system reconfiguration has failed.
> 
> Default textclass is used but LyX may
> 
> not be able to work properly.
> 
> Please reconfigure again if needed.
> 
> 
> 
> I've run Reconfigure several times, but the modules still don't appear. Any
> leads on what's not going well?
> 
> 
> 
> Cheers
> 
> Ramom

Regards,
-- 
José Abílio-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: no modules availables

2020-08-14 Thread Paul A. Rubin

On 8/14/20 11:28 AM, Jose Ramom Flores das Seixas wrote:


Hi:

I take a long time without using /LyX/, but my package manager has 
been updating lyx when new versions come out. Nowadays, I have 
installed version 2.3.5.2 (OS: Ubuntu 18.04).


Today I tried to edit a file, with lyxformat 544, but /LyX/ tells me a 
module is missing. Looking at the module dialogue I found that no 
module is available.


I've checked that the standard module files are in 
/usr/share/lyx/layouts, and besides them I have some other modules in 
~/.lyx/layouts.


When I run /LyX/ from a terminal I can notice the following error:

UnicodeDecodeError: 'utf8' codec can't decode byte 0xa9 in position 
395: invalid start byte support/Systemcall.cpp (276): Systemcall: 
'python -tt "/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' 
finished with exit code 1


LyX: Done!

Finally, when executing *Reconfigure*, an error dialog appears with 
the following message:


The system reconfiguration has failed.

Default textclass is used but LyX may

not be able to work properly.

Please reconfigure again if needed.

I've run *Reconfigure* several times, but the modules still don't 
appear.Any leads on what's not going well?


Cheers

Ramom


It would be nice to know if the alleged non-UTF8 character is in 
configure.py or in some file it is trying to read.


I've attached configure.py from my system (Linux Mint 19.3). You might 
start by comparing it to the one on your system (in /usr/share/lyx) 
using diff, meld or whatever tool you prefer. If there is a discrepancy, 
try reconfiguring using my copy.


If there's no difference in the script files, I would suggest trying to 
run the configuration script directly in a terminal (python -tt 
"/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"). If you get the 
same error message, check ~/.lyx/configure.log to see if you can figure 
out where the error occurred, and maybe post the log here.


Paul

#! /usr/bin/python2
# -*- coding: utf-8 -*-
#
# file configure.py
# This file is part of LyX, the document processor.
# Licence details can be found in the file COPYING.

# \author Bo Peng
# Full author contact details are available in file CREDITS.

from __future__ import print_function
import glob, logging, os, re, shutil, subprocess, sys, stat

if sys.version_info[0] < 3:
import codecs
open = codecs.open


# set up logging
logging.basicConfig(level = logging.DEBUG,
format = '%(levelname)s: %(message)s', # ignore application name
filename = 'configure.log',
filemode = 'w')
#
# Add a handler to log to console
console = logging.StreamHandler()
console.setLevel(logging.INFO) # the console only print out general information
formatter = logging.Formatter('%(message)s') # only print out the message itself
console.setFormatter(formatter)
logger = logging.getLogger('LyX')
logger.addHandler(console)

def quoteIfSpace(name):
" utility function: quote name if it contains spaces "
if ' ' in name:
return '"' + name + '"'
else:
return name

def writeToFile(filename, lines, append = False):
" utility function: write or append lines to filename "
if append:
file = open(filename, 'a')
else:
file = open(filename, 'w')
file.write(lines)
file.close()


def addToRC(lines):
''' utility function: shortcut for appending lines to outfile
add newline at the end of lines.
'''
if lines.strip():
writeToFile(outfile, lines + '\n', append = True)
logger.debug('Add to RC:\n' + lines + '\n\n')


def removeFiles(filenames):
'''utility function: 'rm -f'
ignore errors when file does not exist, or is a directory.
'''
for file in filenames:
try:
os.remove(file)
logger.debug('Removing file %s' % file)
except:
logger.debug('Failed to remove file %s' % file)
pass


def cmdOutput(cmd, asynchronous = False):
'''utility function: run a command and get its output as a string
cmd: command to run
asynchronous: if False, return whole output as a string, otherwise
   return the stdout handle from which the output can be
   read (the caller is then responsible for closing it)
'''
if os.name == 'nt':
b = False
if sys.version_info[0] < 3:
cmd = 'cmd /d /c pushd ' + shortPath(os.getcwdu()) + '&' + cmd
else:
cmd = 'cmd /d /c pushd ' + shortPath(os.getcwd()) + '&' + cmd
else:
b = True
pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, universal_newlines=True)
pipe.stdin.close()
if asynchronous:
return pipe.stdout
output = pipe.stdout.read()
pipe.stdout.close()
return output.strip()


def shortPath(path):
''' On Windows, return the short version of "path" if possible '''
if os.name == 'nt':
from ctypes import windll,

no modules availables

2020-08-14 Thread Jose Ramom Flores das Seixas

Hi:

I take a long time without using /LyX/, but my package manager has been 
updating lyx when new versions come out. Nowadays, I have installed 
version 2.3.5.2 (OS: Ubuntu 18.04).


Today I tried to edit a file, with lyxformat 544, but /LyX/ tells me a 
module is missing. Looking at the module dialogue I found that no module 
is available.


I've checked that the standard module files are in 
/usr/share/lyx/layouts, and besides them I have some other modules in 
~/.lyx/layouts.


When I run /LyX/ from a terminal I can notice the following error:

UnicodeDecodeError: 'utf8' codec can't decode byte 0xa9 in position 395: 
invalid start byte support/Systemcall.cpp (276): Systemcall: 'python -tt 
"/usr/share/lyx/configure.py" --binary-dir="/usr/bin/"' finished with 
exit code 1


LyX: Done!

Finally, when executing *Reconfigure*, an error dialog appears with the 
following message:


The system reconfiguration has failed.

Default textclass is used but LyX may

not be able to work properly.

Please reconfigure again if needed.

I've run *Reconfigure* several times, but the modules still don't 
appear.Any leads on what's not going well?


Cheers

Ramom

-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users


Re: LyX --> markdown

2020-08-14 Thread Saša Janiška
On Tue, 11 Aug 2020 19:32:19 +0200
Peter GAAL  wrote:

On Tue, 11 Aug 2020 12:47:13 -0400
Richard Kimberly Heck  wrote:

> or LyX's XHTML export. I'd suggest you experiment with both and see what
> works best. (I'll guess the latter.)  

Triedthe letter and it works very nicely, although it's possibly a little bit
bloated, but will try Markdown via Pandoc...

> LyX 2.4.0 will have enhanced DocBook output, so that will become an
> option. If you can compile from source, you could test it out now. (I
> will probably build a development snapshot at some point, too.)  

For some time I was considering to use Asciidoc(tor), but decided to go back to
LyX instead, but, yes, DocBook output might be better fit semantically...will
try it out.


Sincerely,
Gour

-- 
Whatever action a great man performs, common men follow. And
whatever standards he sets by exemplary acts, all the world pursues.


-- 
lyx-users mailing list
lyx-users@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-users