[sphinx] generating doc from neighboring folders

2016-11-27 Thread alb
Hi there, we are evaluating the possibility to use Sphinx and rst to document our projects. What we have is a project structure that would look like this: ./sandbox/project/ ├── components │   ├── module1 │   │   ├── doc │   │   │   └── module1.rst │   │   └── src │   └── module2 │   ├── doc

Re: SyntaxError on progress module

2015-05-27 Thread alb
Hi Chris, Chris Angelico ros...@gmail.com wrote: [] Python 3.0 removed the 'u' for unicode in front of strings but due to popular demand to ease porting it was reinstated in 3.3. Strip it away and you should be fine to go. Or upgrade to 3.3 or better; is there anything holding you on 3.2?

Re: SyntaxError on progress module

2015-05-27 Thread alb
Hi Mark, Mark Lawrence breamore...@yahoo.co.uk wrote: [] File /home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py, line 48 empty_fill = u'∙' ^ SyntaxError: invalid syntax [] Python 3.0 removed

SyntaxError on progress module

2015-05-26 Thread alb
Hi everyone, I've installed the 'progress' module (ver 1.2) and I have the following error when used: File /home/debian/repos/2418_IASI-NG/Documents/Tools/tex_tool/venv/local/lib/python3.2/site-packages/progress/bar.py, line 48 empty_fill = u'∙' ^ SyntaxError:

Re: rst and pypandoc

2015-03-03 Thread alb
Hi Gregory, Gregory Ewing greg.ew...@canterbury.ac.nz wrote: [] From a cursory reading of the pypandoc docs, it looks like enabling the raw_tex extension in pypandoc will give you what you want. Search for raw_tex on this page: http://johnmacfarlane.net/pandoc/README.html As far as I

Re: rst and pypandoc

2015-03-03 Thread alb
Hi Mark, Mark Lawrence breamore...@yahoo.co.uk wrote: [] The two inps are *not* the same. My bad. I did not notice the difference, thanks for pointing that out. Al -- https://mail.python.org/mailman/listinfo/python-list

Re: rst and pypandoc

2015-03-03 Thread alb
Hi Steven, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: [] The two results are clearly *not* the same, even though the two inp /claim/ to be the same... The two inp are not the same. Correct. My statement was wrong. [] I'm sure that you know how to do such simple things to

Re: rst and pypandoc

2015-03-03 Thread alb
Hi Steven, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: [] In [43]: print pypandoc.convert(s, 'latex', format='rst') this is \textbackslash{}some restructured text. since a literal backslash gets converted to a literal latex backslash. Why is this a problem? Isn't the

Re: rst and pypandoc

2015-03-02 Thread alb
Hi Dave, Dave Angel da...@davea.name wrote: [] or use a raw string: i = r'\\ref{fig:abc}' Actually that'd be: i = r'\ref{fig:abc}' Could you explain why I then see the following difference: In [56]: inp = r'\\ref{fig:abc}' In [57]: print pypandoc.convert(inp, 'latex', format='rst')

Re: rst and pypandoc

2015-03-02 Thread alb
Hi MRAB, MRAB pyt...@mrabarnett.plus.com wrote: [] Have you tried escaping the escape character by doubling the backslash? inp = 'ref{fig:abc}' In [54]: inp = 'ref{fig:abc}' In [55]: print pypandoc.convert(inp, 'latex', format='rst') \textbackslash{}ref\{fig:abc\} the backslash is

Re: rst and pypandoc

2015-03-02 Thread alb
Hi Dave, Dave Angel da...@davea.name wrote: [] Rst escapes with \, but unfortunately python also uses \ for escaping! Only when the string is in a literal. If you've read it from a file, or built it by combining other strings, or... then the backslash is just another character to

Re: rst and pypandoc

2015-03-02 Thread alb
Hi Steven, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: [] Since \r is an escape character, that will give you carriage return followed by ef{fig:abc. The solution to that is to either escape the backslash: i = '\\ref{fig:abc}' or use a raw string: i =

Re: rst and pypandoc

2015-03-02 Thread alb
Hi Dave, Dave Angel da...@davea.name wrote: [] You should be a lot more explicit with all three parts of that statement. Try: I'm trying to get a string of \ref{fig:A.B} but unfortunately I need to go through a conversion between rst and latex. This is because a simple text like this:

rst and pypandoc

2015-03-02 Thread alb
Hi everyone, I'm writing a document in restructured text and I'd like to convert it to latex for printing. To accomplish this I've used semi-successfully pandoc and the wrapper pypandoc. My biggest issue is with figures and references to them. We've our macro to allocate figures so I'm forced

Re: pypandoc and restructured text

2015-02-21 Thread alb
Hi Chris, Chris Angelico ros...@gmail.com wrote: [] Thanks a lot for the hint. Maybe I should seriously think about upgrading the whole distro. It's just that Gnome3 really sucks to my taste and I'm not in the mood to look for another Desktop Environment...(maybe I should go back to CDE).

Re: pypandoc and restructured text

2015-02-21 Thread alb
Hi Wolfgang, Wolfgang Maier wolfgang.ma...@biologie.uni-freiburg.de wrote: [] I have pandoc 1.12.2.1 and it recognizes the figure directive just fine (tested with html output so I cannot say anything about LaTeX). This reminds me that I need to move sooner or later from squeeze to wheezy...

pypandoc and restructured text

2015-02-20 Thread alb
Hi everyone, I'm trying to convert restructured text to latex with pandoc and it seems to me there's something not correctly working. I have the following text: .. figure:: picture.png :scale: 50 % :alt: map to buried treasure This is the caption of the figure (a simple paragraph).

Re: parsing tree from excel sheet

2015-01-31 Thread alb
Hi Peter, Peter Otten __pete...@web.de wrote: [] Let's start with the simplest: Peter Otten __pete...@web.de wrote: def show2(self): yield str(self) for child in self.children: yield from child.show2() [] Given a tree A -- A1 A2 -- A21

Re: parsing tree from excel sheet

2015-01-30 Thread alb
Hi Peter, I'll try to comment the code below to verify if I understood it correctly or missing some major parts. Comments are just below code with the intent to let you read the code first and my understanding afterwards. Peter Otten __pete...@web.de wrote: [] $ cat parse_column_tree.py

Re: parsing tree from excel sheet

2015-01-29 Thread alb
Hi Peter, Peter Otten __pete...@web.de wrote: [] def show2(self): yield str(self) for child in self.children: yield from child.show2() here is what I get: SyntaxError: invalid syntax debian@debian:example$ python3 export_latex.py doctree.csv File

Re: parsing tree from excel sheet

2015-01-29 Thread alb
Hi MRAB, MRAB pyt...@mrabarnett.plus.com wrote: [] SyntaxError: invalid syntax debian@debian:example$ python3 export_latex.py doctree.csv File export_latex.py, line 36 yield from child.show2() ^ SyntaxError: invalid syntax and I've tried with both python and python3

Re: parsing tree from excel sheet

2015-01-29 Thread alb
Hi Tim, Tim Chase python.l...@tim.thechases.com wrote: [] I know about the xlrd module to get data from excel If I have to get my code to read Excel files, xlrd is usually my first and only stop. It provides quite a good interface to manipulating excel files and I find it pretty easy

Re: parsing tree from excel sheet

2015-01-28 Thread alb
Hi Peter, Peter Otten __pete...@web.de wrote: [] You can save the excel sheet as csv so that you an use the csv module which may be easier to use than xlrd. The rest should be doable by hand. Here's what I hacked together: $ cat parse_column_tree.py import csv def column_index(row):

parsing tree from excel sheet

2015-01-28 Thread alb
Hi everyone, I've a document structure which is extremely simple and represented on a spreadsheet in the following way (a made up example): subsystem | chapter | section | subsection | subsubsec | A | | || | | func0 | |

kbhit/getch python equivalent

2013-04-22 Thread alb
Hi everyone, I'm looking for a kbhit/getch equivalent in python in order to be able to stop my inner loop in a controlled way (communication with external hardware is involved and breaking it abruptly may cause unwanted errors on the protocol). I'm programming on *nix systems, no need to be