You can subscribe to this list here.
| 2011 |
Jan
(16) |
Feb
(23) |
Mar
(42) |
Apr
|
May
(8) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
|
Oct
(13) |
Nov
(54) |
Dec
(75) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2012 |
Jan
(8) |
Feb
(131) |
Mar
(34) |
Apr
|
May
(2) |
Jun
(1) |
Jul
(22) |
Aug
(2) |
Sep
(3) |
Oct
(3) |
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
(3) |
Mar
|
Apr
(22) |
May
(2) |
Jun
|
Jul
(2) |
Aug
(14) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
(1) |
Feb
(8) |
Mar
(6) |
Apr
(4) |
May
(5) |
Jun
|
Jul
(16) |
Aug
(6) |
Sep
(8) |
Oct
(18) |
Nov
(8) |
Dec
|
| 2015 |
Jan
(13) |
Feb
(7) |
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2016 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
(1) |
Apr
(2) |
May
|
Jun
(4) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2019 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(7) |
Dec
|
| 2020 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2022 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ala...@us...> - 2011-03-08 11:17:12
|
Revision: 212
http://latex-access.svn.sourceforge.net/latex-access/?rev=212&view=rev
Author: alastair-irving
Date: 2011-03-08 11:17:06 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
Further tidying of variables. The variables we need are now initialised in __init__. Removed matrix variables because we've got lots to sort out before thinking about matrices.
Modified Paths:
--------------
nvda/latex_access.py
Modified: nvda/latex_access.py
===================================================================
--- nvda/latex_access.py 2011-03-08 09:52:21 UTC (rev 211)
+++ nvda/latex_access.py 2011-03-08 11:17:06 UTC (rev 212)
@@ -30,17 +30,12 @@
class GlobalPlugin (globalPluginHandler.GlobalPlugin):
"""main class for the global plugin, in which all key bindings/scripts and NVDA events are handled."""
- processMaths = False
- latex_access = None
- matrix = None
- row = None
- column = None
def __init__ (self):
"""Constructor. Here we initialise what we need: we create the latex_access com object. We interface with the matrix later."""
super (GlobalPlugin, self).__init__ ()
-
+ self.processMaths = False
self.latex_access = CreateObject ("latex_access")
def event_caret (self, obj, nextHandler):
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nsc...@us...> - 2011-03-08 09:52:28
|
Revision: 211
http://latex-access.svn.sourceforge.net/latex-access/?rev=211&view=rev
Author: nschmidt19
Date: 2011-03-08 09:52:21 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
Since text-to-tags doesn't let blockquotes be used inside lists, I wrote the html by hand inside readme.t2t. Works fine now. Oh and just in case noone knows, here's a very basic guide for using txt2tags.
* to compile/convert the document, type txt2tags filename.t2t (no more command-line options are necesary, they are defined in the file itself).
* The syntax is mostly self explanitory, except for a couple of things.
That should do for now.
Modified Paths:
--------------
nvda/readme.t2t
Added Paths:
-----------
nvda/readme.html
Added: nvda/readme.html
===================================================================
--- nvda/readme.html (rev 0)
+++ nvda/readme.html 2011-03-08 09:52:21 UTC (rev 211)
@@ -0,0 +1,159 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+<META NAME="generator" CONTENT="http://txt2tags.sf.net">
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
+<TITLE>The latex-access GlobalPlugin for NVDA.</TITLE>
+</HEAD><BODY BGCOLOR="white" TEXT="black">
+<CENTER>
+<H2>The latex-access GlobalPlugin for NVDA.</H2>
+<FONT SIZE="4"><I>Nathaniel Schmidt</I></FONT><BR>
+<FONT SIZE="4">Monday, 7th March 2011</FONT>
+</CENTER>
+
+
+<A NAME="toc"></A>
+<H2>Table of Contents</H2>
+
+
+ <UL>
+
+ <LI><A HREF="#intro">1. Introduction.</A>
+ <UL>
+ <LI><A HREF="#l-a">1.1. What is latex-access?</A>
+ <LI><A HREF="#gpfor">1.2. What is this globalPlugin for?</A>
+ </UL>
+ <LI><A HREF="#require">2. Requirements.</A>
+ <LI><A HREF="#Register">3. Registering the COM object and installing the globalPlugin.</A>
+ <LI><A HREF="#toggle">4. Toggling translation on and off.</A>
+ <UL>
+ <LI><A HREF="#edit">4.1. A note about edit fields</A>
+ </UL>
+ <LI><A HREF="#dollar">5. Toggling of dollar signs.</A>
+ <LI><A HREF="#preproc">6. Using the Preprocessor</A>
+ <UL>
+ <LI><A HREF="#addcomm">6.1. Adding a Command:</A>
+ </UL>
+ <LI><A HREF="#matproc">7. The Matrix Processor.</A>
+ </UL>
+
+<A NAME="intro"></A>
+<H2>1. Introduction.</H2>
+
+<A NAME="l-a"></A>
+<H3>1.1. What is latex-access?</H3>
+
+<P>
+Latex-access is a set of python scripts that provides realtime translation of a line of LaTeX into nemeth braille and speech, making the mathematics more readable to the blind user. To find out more, <A HREF="http://latex-access.sf.net">visit this webpage</A>, although you have probably already been there if you are viewing this readme file.
+</P>
+
+<A NAME="gpfor"></A>
+<H3>1.2. What is this globalPlugin for?</H3>
+
+<P>
+This global plugin implements Communication between NVDA 2011.1 or later and the latex-access COM objects, letting the user read translated LaTeX documents in an easier fashion.
+</P>
+
+<A NAME="require"></A>
+<H2>2. Requirements.</H2>
+
+<P>
+To use this plugin, you will need to install the following software/libraries:
+</P>
+
+<UL>
+<LI>NVDA, version 2011.1 or later. The NVDA website can be found at <A HREF="http://www.nvda-project.org">http://www.nvda-project.org</A>, and the download page can be found <A HREF="http://www.nvda-project.org/download/">here</A>.
+<LI>The latest build of version 2 of the python programming language. Official website: <A HREF="http://www.python.org/">http://www.python.org/</A>.
+<LI>The python for windows extentions, which can be downloaded at <A HREF="http://sourceforge.net/projects/pywin32/">http://sourceforge.net/projects/pywin32/</A>. This package is required to registor the latex-access COM object and the matrix.
+<LI>The latex-access scripts. You probably already have these, but if not, you will need subversion. How to use this VCS is beyond the scope of this readme, but the svn repository can be found at: <A HREF="https://latex-access.svn.sourceforge.net/svnroot/latex-access">https://latex-access.svn.sourceforge.net/svnroot/latex-access</A>. Please remember the exact location where you installed the scripts! I recommend using <A HREF="http://tortoisesvn.net/">tortoise svn</A> as your subversion client, it's accessible, and easy to use.
+</UL>
+
+<A NAME="Register"></A>
+<H2>3. Registering the COM object and installing the globalPlugin.</H2>
+
+<P>
+Assuming you have followed the steps above and installed everything you need, you can install the plugin and register the COM object by doing the following:
+</P>
+<P>
+For registering the COM object:
+<ol>
+<li> Type windows and r to go into the run dialog, then type cmd and press enter.
+<li> type "cd", then type in the location where you installed the latex-access scripts. E.G.
+<blockquote>
+cd C:\latex-access\
+</blockquote>
+<li> to register the COM object for latex-access translation, type:
+<blockquote>
+latex_access_COM.py
+</blockquote>
+<li> To register the matrix, type:
+<blockquote>
+matrix_processor.py
+</blockquote>
+ In both cases, you should hear iether the message "latex_access registered," or "latex_access_matrix registered" which indicates that what you just did was successful. If not, then something is obviously wrong. Remember that if you change the location of the latex-access scripts, you have to register the COM objects again.
+<li> Note: the object here is to run the specified python files with python, so the above will only work if python is the default program associated with .py files. If it is not then try :
+<blockquote>
+python latex_access_COM.py
+</blockquote>
+however this only works if you have python in your path variable. if this fails then use the full path to your python installation, for example :
+<blockquote>
+c:\python26\python.exe latex_access_COM.py
+</blockquote>
+then repeat with matrix_processor.py.
+<li> type "exit" (without the quotes) in your currently open cmd shell.
+</ol>
+
+To install the plugin:
+<ol>
+<li> Go to the nvda subdirectory in the latex-access folder, select latex_access.py and copy it, either by pressing ctrl and C or right clicking on it and choosing "copy."
+<li> Now you need to paste this file in the appropriate folder so that the plugin will be recognised by NVDA. Depending on your distribution/installation, the globalPlugins directory will be in one of the following places by default:
+<ul>
+<li> Installed version of NVDA:
+<ul>
+<li> For Windows XP:
+<blockquote>
+C:\Documents and Settings\username\Application Data\NVDA\globalPlugins\
+</blockquote>
+<li> for Windows Vista/7:
+<blockquote>
+C:\Users\username\AppData\Roaming\NVDA\globalPlugins\
+</blockquote>
+</ul>
+<li> Portable archive or running from source:
+<blockquote>
+DirectoryOfArchive/distribution\userConfig\globalPlugins\
+</blockquote>
+</ul>
+<li> Once latex_access.py is pasted, launch NVDa by what ever means possible, and if the error sound doesn't play, everything should go smoothly.
+</ol>
+</P>
+
+<A NAME="toggle"></A>
+<H2>4. Toggling translation on and off.</H2>
+
+<P>
+To turn translation on, press ctrl and M. You should be able to here the translation of LaTeX mathematics via speech output. To turn the translation off, press ctrl and M again. You should then be able to navigate the document as normal.
+</P>
+
+<A NAME="edit"></A>
+<H3>4.1. A note about edit fields</H3>
+
+<P>
+This keystroke should only work if you are in an edit field, and one that has accessible text enabled at that. You will get errors if you try to use the latex_access global plugin in edit fields that are not native controls. I'm afraid that's just the way windows works. I know for a fact that notepad works with the plugin quite well, but in and editor such as EdSharp it does not.
+</P>
+
+<A NAME="dollar"></A>
+<H2>5. Toggling of dollar signs.</H2>
+
+<A NAME="preproc"></A>
+<H2>6. Using the Preprocessor</H2>
+
+<A NAME="addcomm"></A>
+<H3>6.1. Adding a Command:</H3>
+
+<A NAME="matproc"></A>
+<H2>7. The Matrix Processor.</H2>
+
+<!-- html code generated by txt2tags 2.6b1 (http://txt2tags.sf.net) -->
+<!-- cmdline: txt2tags readme.t2t -->
+</BODY></HTML>
Modified: nvda/readme.t2t
===================================================================
--- nvda/readme.t2t 2011-03-08 06:29:12 UTC (rev 210)
+++ nvda/readme.t2t 2011-03-08 09:52:21 UTC (rev 211)
@@ -35,44 +35,68 @@
To use this plugin, you will need to install the following software/libraries:
- NVDA, version 2011.1 or later. The NVDA website can be found at http://www.nvda-project.org, and the download page can be found [here http://www.nvda-project.org/download/].
-- python 2.6 or later (I use python 2.7.1). Official website: http://www.python.org/.
+- The latest build of version 2 of the python programming language. Official website: http://www.python.org/.
- The python for windows extentions, which can be downloaded at http://sourceforge.net/projects/pywin32/. This package is required to registor the latex-access COM object and the matrix.
- The latex-access scripts. You probably already have these, but if not, you will need subversion. How to use this VCS is beyond the scope of this readme, but the svn repository can be found at: https://latex-access.svn.sourceforge.net/svnroot/latex-access. Please remember the exact location where you installed the scripts! I recommend using [tortoise svn http://tortoisesvn.net/] as your subversion client, it's accessible, and easy to use.
--
+-
+Registering the COM object and installing the globalPlugin.+[Register]
Assuming you have followed the steps above and installed everything you need, you can install the plugin and register the COM object by doing the following:
+
For registering the COM object:
-+ Type windows and r to go into the run dialog, then type cmd and press enter.
-+ type "cd", then type in the location where you installed the latex-access scripts. E.G.
- cd C:\latex-access\
-+ to register the COM object for latex-access translation, type:
- latex_access_COM.py
-+ To register the matrix, type:
- matrix_processor.py
+% BlockQuotes don't work within lists, so the html is written by hand.
+'''
+<ol>
+<li> Type windows and r to go into the run dialog, then type cmd and press enter.
+<li> type "cd", then type in the location where you installed the latex-access scripts. E.G.
+<blockquote>
+cd C:\latex-access\
+</blockquote>
+<li> to register the COM object for latex-access translation, type:
+<blockquote>
+latex_access_COM.py
+</blockquote>
+<li> To register the matrix, type:
+<blockquote>
+matrix_processor.py
+</blockquote>
In both cases, you should hear iether the message "latex_access registered," or "latex_access_matrix registered" which indicates that what you just did was successful. If not, then something is obviously wrong. Remember that if you change the location of the latex-access scripts, you have to register the COM objects again.
-+Note: the object here is to run the specified python files with python, so the above will only work if python is the default program associated with .py files. If it is not then try :
- python latex_access_COM.py
-and if this fails then use the full path to your python installation, for example :
- c:\python26\python.exe latex_access_COM.py
+<li> Note: the object here is to run the specified python files with python, so the above will only work if python is the default program associated with .py files. If it is not then try :
+<blockquote>
+python latex_access_COM.py
+</blockquote>
+however this only works if you have python in your path variable. if this fails then use the full path to your python installation, for example :
+<blockquote>
+c:\python26\python.exe latex_access_COM.py
+</blockquote>
then repeat with matrix_processor.py.
-+ type "exit" (without the quotes) in your currently open cmd shell.
-+
+<li> type "exit" (without the quotes) in your currently open cmd shell.
+</ol>
To install the plugin:
-+ Go to the nvda subdirectory in the latex-access folder, select latex_access.py and copy it, either by pressing ctrl and C or right clicking on it and choosing "copy."
-+ Now you need to paste this file in the appropriate folder so that the plugin will be recognised by NVDA. Depending on your distribution/installation, the globalPlugins directory will be in one of the following places by default:
- - Installed version of NVDA:
- - For Windows XP:
- C:\Documents and Settings\username\Application Data\NVDA\globalPlugins\
- - for Windows Vista/7:
- C:\Users\username\AppData\Roaming\NVDA\globalPlugins\
- -
- - Portable archive or running from source:
- DirectoryOfArchive/distribution\userConfig\globalPlugins\
- -
-+ Once latex_access.py is pasted, launch NVDa by what ever means possible, and if the error sound doesn't play, everything should go smoothly.
-+
+<ol>
+<li> Go to the nvda subdirectory in the latex-access folder, select latex_access.py and copy it, either by pressing ctrl and C or right clicking on it and choosing "copy."
+<li> Now you need to paste this file in the appropriate folder so that the plugin will be recognised by NVDA. Depending on your distribution/installation, the globalPlugins directory will be in one of the following places by default:
+<ul>
+<li> Installed version of NVDA:
+<ul>
+<li> For Windows XP:
+<blockquote>
+C:\Documents and Settings\username\Application Data\NVDA\globalPlugins\
+</blockquote>
+<li> for Windows Vista/7:
+<blockquote>
+C:\Users\username\AppData\Roaming\NVDA\globalPlugins\
+</blockquote>
+</ul>
+<li> Portable archive or running from source:
+<blockquote>
+DirectoryOfArchive/distribution\userConfig\globalPlugins\
+</blockquote>
+</ul>
+<li> Once latex_access.py is pasted, launch NVDa by what ever means possible, and if the error sound doesn't play, everything should go smoothly.
+</ol>
+'''
+Toggling translation on and off.+[toggle]
To turn translation on, press ctrl and M. You should be able to here the translation of LaTeX mathematics via speech output. To turn the translation off, press ctrl and M again. You should then be able to navigate the document as normal.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nsc...@us...> - 2011-03-08 06:29:18
|
Revision: 210
http://latex-access.svn.sourceforge.net/latex-access/?rev=210&view=rev
Author: nschmidt19
Date: 2011-03-08 06:29:12 +0000 (Tue, 08 Mar 2011)
Log Message:
-----------
Removed comtypes from the list of required dependencies in readme.t2t. A binary user of NVDA will already have this packaged in library.zip, and users running from source will have already installed it.
Modified Paths:
--------------
nvda/readme.t2t
Modified: nvda/readme.t2t
===================================================================
--- nvda/readme.t2t 2011-03-07 21:18:44 UTC (rev 209)
+++ nvda/readme.t2t 2011-03-08 06:29:12 UTC (rev 210)
@@ -37,7 +37,6 @@
- NVDA, version 2011.1 or later. The NVDA website can be found at http://www.nvda-project.org, and the download page can be found [here http://www.nvda-project.org/download/].
- python 2.6 or later (I use python 2.7.1). Official website: http://www.python.org/.
- The python for windows extentions, which can be downloaded at http://sourceforge.net/projects/pywin32/. This package is required to registor the latex-access COM object and the matrix.
-- Comtypes version 0.6.2: http://sourceforge.net/projects/Comtypes/. Comtypes is required to interface with the COM objects.
- The latex-access scripts. You probably already have these, but if not, you will need subversion. How to use this VCS is beyond the scope of this readme, but the svn repository can be found at: https://latex-access.svn.sourceforge.net/svnroot/latex-access. Please remember the exact location where you installed the scripts! I recommend using [tortoise svn http://tortoisesvn.net/] as your subversion client, it's accessible, and easy to use.
-
@@ -46,34 +45,31 @@
For registering the COM object:
+ Type windows and r to go into the run dialog, then type cmd and press enter.
+ type "cd", then type in the location where you installed the latex-access scripts. E.G.
- cd C:\latex-access\
+ cd C:\latex-access\
+ to register the COM object for latex-access translation, type:
- latex_access_COM.py
+ latex_access_COM.py
+ To register the matrix, type:
- matrix_processor.py
+ matrix_processor.py
In both cases, you should hear iether the message "latex_access registered," or "latex_access_matrix registered" which indicates that what you just did was successful. If not, then something is obviously wrong. Remember that if you change the location of the latex-access scripts, you have to register the COM objects again.
-+Note: the object here is to run the specified python files with
- python, so the above will only work if python is the default program
- associated with .py files. If it is not then try
- python latex_access_COM.py
- and if this fails then use the full path to your python installation,
- for example :
- c:\python26\python.exe latex_access_COM.py
- then repeat with matrix_processor.py
++Note: the object here is to run the specified python files with python, so the above will only work if python is the default program associated with .py files. If it is not then try :
+ python latex_access_COM.py
+and if this fails then use the full path to your python installation, for example :
+ c:\python26\python.exe latex_access_COM.py
+then repeat with matrix_processor.py.
+ type "exit" (without the quotes) in your currently open cmd shell.
-+
++
To install the plugin:
+ Go to the nvda subdirectory in the latex-access folder, select latex_access.py and copy it, either by pressing ctrl and C or right clicking on it and choosing "copy."
+ Now you need to paste this file in the appropriate folder so that the plugin will be recognised by NVDA. Depending on your distribution/installation, the globalPlugins directory will be in one of the following places by default:
- Installed version of NVDA:
- For Windows XP:
- C:\Documents and Settings\username\Application Data\NVDA\globalPlugins\
+ C:\Documents and Settings\username\Application Data\NVDA\globalPlugins\
- for Windows Vista/7:
- C:\Users\username\AppData\Roaming\NVDA\globalPlugins\
+ C:\Users\username\AppData\Roaming\NVDA\globalPlugins\
-
- Portable archive or running from source:
- DirectoryOfArchive/distribution\userConfig\globalPlugins\
+ DirectoryOfArchive/distribution\userConfig\globalPlugins\
-
+ Once latex_access.py is pasted, launch NVDa by what ever means possible, and if the error sound doesn't play, everything should go smoothly.
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nsc...@us...> - 2011-03-07 21:18:53
|
Revision: 209
http://latex-access.svn.sourceforge.net/latex-access/?rev=209&view=rev
Author: nschmidt19
Date: 2011-03-07 21:18:44 +0000 (Mon, 07 Mar 2011)
Log Message:
-----------
Class static variables are now object variables of the already existing GlobalPlugin instance. I did this last night but had something on so didn't commit it. Added readme.t2t, and the txt2tags script to go along with it.
Modified Paths:
--------------
nvda/bugs.txt
nvda/latex_access.py
nvda/todo.txt
Added Paths:
-----------
nvda/readme.t2t
nvda/txt2tags.py
Modified: nvda/bugs.txt
===================================================================
--- nvda/bugs.txt 2011-03-05 09:49:20 UTC (rev 208)
+++ nvda/bugs.txt 2011-03-07 21:18:44 UTC (rev 209)
@@ -5,4 +5,9 @@
* Repetitive speech: Because NVDA's default
behaviour is not being overidden, the current line is being spoken as
normal, and then the plugin is causing that same line to be spoken again,
-whether translation is on or off. I need to find a way around this soon.
\ No newline at end of file
+whether translation is on or off. Also the
+line is being spoken whenever the user moves by character and word,
+not just by line. Also the GetLine method
+in the GlobalPlugin class does not honour any config settings
+in NVDA such as speakTypedCharacters and SpeakTypedWords.
+I need to find a way around this soon.
\ No newline at end of file
Modified: nvda/latex_access.py
===================================================================
--- nvda/latex_access.py 2011-03-05 09:49:20 UTC (rev 208)
+++ nvda/latex_access.py 2011-03-07 21:18:44 UTC (rev 209)
@@ -28,40 +28,31 @@
import globalPluginHandler
import textInfos# to get information such as the current line.
-### Global variables:
-### I know this is probably not the best way to do this, but I wasn't sure exactly how to successfully do it another way and keep the values of the variables
-### the same throughout classes and other functions.
-### End of global variable declarations
-
class GlobalPlugin (globalPluginHandler.GlobalPlugin):
"""main class for the global plugin, in which all key bindings/scripts and NVDA events are handled."""
- initialised = False
processMaths = False
latex_access = None
- currentLine = None
matrix = None
row = None
column = None
def __init__ (self):
- """Constructor. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later."""
+ """Constructor. Here we initialise what we need: we create the latex_access com object. We interface with the matrix later."""
super (GlobalPlugin, self).__init__ ()
- if not GlobalPlugin.initialised:# is the latex_access com object created yet?
- GlobalPlugin.latex_access = CreateObject ("latex_access")
- GlobalPlugin.initialised = True
+ self.latex_access = CreateObject ("latex_access")
def event_caret (self, obj, nextHandler):
"""This event is called when the system caret moves, and it is being overidden so that latex-access speech translation can be used if the user wishes."""
- if GlobalPlugin.processMaths:
- GlobalPlugin.currentLine = self.GetLine ()
- if not GlobalPlugin.currentLine:# Is it a blank line?
- GlobalPlugin.currentLine = _("blank")
+ if self.processMaths:
+ currentLine = self.GetLine ()
+ if not currentLine:# Is it a blank line?
+ currentLine = _("blank")
else:
- GlobalPlugin.currentLine = GlobalPlugin.latex_access.speech (GlobalPlugin.currentLine)
- speech.speakMessage (GlobalPlugin.currentLine)
+ currentLine = self.latex_access.speech (currentLine)
+ speech.speakMessage (currentLine)
else:
self.SayLine ()
@@ -74,11 +65,11 @@
@type gesture: keypress.
"""
- if GlobalPlugin.processMaths:# is translation on?
- GlobalPlugin.processMaths = False
+ if self.processMaths:# is translation on?
+ self.processMaths = False
speech.speakMessage (_("Maths to be read as plain latex"))
else:
- GlobalPlugin.processMaths = True
+ self.processMaths = True
speech.speakMessage (_("Maths to be processed to a more verbal form"))
script_toggleMaths.__doc__ = _("Toggles the speaking of mathematical expressions as either straight latex or a more verbal rendering.")
Added: nvda/readme.t2t
===================================================================
--- nvda/readme.t2t (rev 0)
+++ nvda/readme.t2t 2011-03-07 21:18:44 UTC (rev 209)
@@ -0,0 +1,94 @@
+The latex-access GlobalPlugin for NVDA.
+Nathaniel Schmidt
+Monday, 7th March 2011
+
+
+%!Target: html
+%!Encoding: UTF-8
+%!Options: -o readme.html --toc
+
+% taken from NVDA source code:
+% Remove the Table of Contents heading from the toc.
+%!PostProc(html): '^.*\<LI\>\<A HREF="#toc"\>.*\</A\>.*$' ''
+
+% h1 in html should really be the document title only.
+% Therefore, change h1 through h5 in the output to h2 through h6.
+%!PostProc(html): ^<H5>(.*)</H5>$ <H6>\1</H6>
+%!PostProc(html): ^<H4>(.*)</H4>$ <H5>\1</H5>
+%!PostProc(html): ^<H3>(.*)</H3>$ <H4>\1</H4>
+%!PostProc(html): ^<H2>(.*)</H2>$ <H3>\1</H3>
+%!PostProc(html): ^<H1>(.*)</H1>$ <H2>\1</H2>
+
+
+=Table of Contents=[toc]
+%%toc
+
++Introduction.+[intro]
+
+++What is latex-access?++[l-a]
+Latex-access is a set of python scripts that provides realtime translation of a line of LaTeX into nemeth braille and speech, making the mathematics more readable to the blind user. To find out more, [visit this webpage http://latex-access.sf.net], although you have probably already been there if you are viewing this readme file.
+
+++What is this globalPlugin for?++[gpfor]
+This global plugin implements Communication between NVDA 2011.1 or later and the latex-access COM objects, letting the user read translated LaTeX documents in an easier fashion.
+
++Requirements.+[require]
+To use this plugin, you will need to install the following software/libraries:
+
+- NVDA, version 2011.1 or later. The NVDA website can be found at http://www.nvda-project.org, and the download page can be found [here http://www.nvda-project.org/download/].
+- python 2.6 or later (I use python 2.7.1). Official website: http://www.python.org/.
+- The python for windows extentions, which can be downloaded at http://sourceforge.net/projects/pywin32/. This package is required to registor the latex-access COM object and the matrix.
+- Comtypes version 0.6.2: http://sourceforge.net/projects/Comtypes/. Comtypes is required to interface with the COM objects.
+- The latex-access scripts. You probably already have these, but if not, you will need subversion. How to use this VCS is beyond the scope of this readme, but the svn repository can be found at: https://latex-access.svn.sourceforge.net/svnroot/latex-access. Please remember the exact location where you installed the scripts! I recommend using [tortoise svn http://tortoisesvn.net/] as your subversion client, it's accessible, and easy to use.
+-
+
++Registering the COM object and installing the globalPlugin.+[Register]
+Assuming you have followed the steps above and installed everything you need, you can install the plugin and register the COM object by doing the following:
+For registering the COM object:
++ Type windows and r to go into the run dialog, then type cmd and press enter.
++ type "cd", then type in the location where you installed the latex-access scripts. E.G.
+ cd C:\latex-access\
++ to register the COM object for latex-access translation, type:
+ latex_access_COM.py
++ To register the matrix, type:
+ matrix_processor.py
+ In both cases, you should hear iether the message "latex_access registered," or "latex_access_matrix registered" which indicates that what you just did was successful. If not, then something is obviously wrong. Remember that if you change the location of the latex-access scripts, you have to register the COM objects again.
++Note: the object here is to run the specified python files with
+ python, so the above will only work if python is the default program
+ associated with .py files. If it is not then try
+ python latex_access_COM.py
+ and if this fails then use the full path to your python installation,
+ for example :
+ c:\python26\python.exe latex_access_COM.py
+ then repeat with matrix_processor.py
++ type "exit" (without the quotes) in your currently open cmd shell.
++
+
+To install the plugin:
++ Go to the nvda subdirectory in the latex-access folder, select latex_access.py and copy it, either by pressing ctrl and C or right clicking on it and choosing "copy."
++ Now you need to paste this file in the appropriate folder so that the plugin will be recognised by NVDA. Depending on your distribution/installation, the globalPlugins directory will be in one of the following places by default:
+ - Installed version of NVDA:
+ - For Windows XP:
+ C:\Documents and Settings\username\Application Data\NVDA\globalPlugins\
+ - for Windows Vista/7:
+ C:\Users\username\AppData\Roaming\NVDA\globalPlugins\
+ -
+ - Portable archive or running from source:
+ DirectoryOfArchive/distribution\userConfig\globalPlugins\
+ -
++ Once latex_access.py is pasted, launch NVDa by what ever means possible, and if the error sound doesn't play, everything should go smoothly.
++
+
++Toggling translation on and off.+[toggle]
+To turn translation on, press ctrl and M. You should be able to here the translation of LaTeX mathematics via speech output. To turn the translation off, press ctrl and M again. You should then be able to navigate the document as normal.
+
+++A note about edit fields++[edit]
+This keystroke should only work if you are in an edit field, and one that has accessible text enabled at that. You will get errors if you try to use the latex_access global plugin in edit fields that are not native controls. I'm afraid that's just the way windows works. I know for a fact that notepad works with the plugin quite well, but in and editor such as EdSharp it does not.
+
++Toggling of dollar signs.+[dollar]
+
++Using the Preprocessor+[preproc]
+
+++Adding a Command:++[addcomm]
+
++The Matrix Processor.+[matproc]
+
Modified: nvda/todo.txt
===================================================================
--- nvda/todo.txt 2011-03-05 09:49:20 UTC (rev 208)
+++ nvda/todo.txt 2011-03-07 21:18:44 UTC (rev 209)
@@ -5,7 +5,7 @@
however hard to implement as certain events can be unreliable
in different situations, and there is no real list of all
events so they are hard to find. The best event to use would
- probably be the IAcessible event, event_caret, but I haven't
+ probably be the IAccessible event, event_caret, but I haven't
written the code for that yet.
* Add translations of braille without the message timing out
Added: nvda/txt2tags.py
===================================================================
--- nvda/txt2tags.py (rev 0)
+++ nvda/txt2tags.py 2011-03-07 21:18:44 UTC (rev 209)
@@ -0,0 +1,6000 @@
+#!/usr/bin/env python
+# txt2tags - generic text conversion tool
+# http://txt2tags.sf.net
+#
+# Copyright 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Aurelio Jargas
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, version 2.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You have received a copy of the GNU General Public License along
+# with this program, on the COPYING file.
+#
+########################################################################
+#
+# BORING CODE EXPLANATION AHEAD
+#
+# Just read it if you wish to understand how the txt2tags code works.
+#
+########################################################################
+#
+# The code that [1] parses the marked text is separated from the
+# code that [2] insert the target tags.
+#
+# [1] made by: def convert()
+# [2] made by: class BlockMaster
+#
+# The structures of the marked text are identified and its contents are
+# extracted into a data holder (Python lists and dictionaries).
+#
+# When parsing the source file, the blocks (para, lists, quote, table)
+# are opened with BlockMaster, right when found. Then its contents,
+# which spans on several lines, are feeded into a special holder on the
+# BlockMaster instance. Just when the block is closed, the target tags
+# are inserted for the full block as a whole, in one pass. This way, we
+# have a better control on blocks. Much better than the previous line by
+# line approach.
+#
+# In other words, whenever inside a block, the parser *holds* the tag
+# insertion process, waiting until the full block is read. That was
+# needed primary to close paragraphs for the XHTML target, but
+# proved to be a very good adding, improving many other processing.
+#
+# -------------------------------------------------------------------
+#
+# These important classes are all documented:
+# CommandLine, SourceDocument, ConfigMaster, ConfigLines.
+#
+# There is a RAW Config format and all kind of configuration is first
+# converted to this format. Then a generic method parses it.
+#
+# These functions get information about the input file(s) and take
+# care of the init processing:
+# get_infiles_config(), process_source_file() and convert_this_files()
+#
+########################################################################
+
+#XXX Python coding warning
+# Avoid common mistakes:
+# - do NOT use newlist=list instead newlist=list[:]
+# - do NOT use newdic=dic instead newdic=dic.copy()
+# - do NOT use dic[key] instead dic.get(key)
+# - do NOT use del dic[key] without has_key() before
+
+#XXX Smart Image Align don't work if the image is a link
+# Can't fix that because the image is expanded together with the
+# link, at the linkbank filling moment. Only the image is passed
+# to parse_images(), not the full line, so it is always 'middle'.
+
+#XXX Paragraph separation not valid inside Quote
+# Quote will not have <p></p> inside, instead will close and open
+# again the <blockquote>. This really sux in CSS, when defining a
+# different background color. Still don't know how to fix it.
+
+#XXX TODO (maybe)
+# New mark or macro which expands to an anchor full title.
+# It is necessary to parse the full document in this order:
+# DONE 1st scan: HEAD: get all settings, including %!includeconf
+# DONE 2nd scan: BODY: expand includes & apply %!preproc
+# 3rd scan: BODY: read titles and compose TOC info
+# 4th scan: BODY: full parsing, expanding [#anchor] 1st
+# Steps 2 and 3 can be made together, with no tag adding.
+# Two complete body scans will be *slow*, don't know if it worths.
+# One solution may be add the titles as postproc rules
+
+
+##############################################################################
+
+# User config (1=ON, 0=OFF)
+
+USE_I18N = 1 # use gettext for i18ned messages? (default is 1)
+COLOR_DEBUG = 1 # show debug messages in colors? (default is 1)
+BG_LIGHT = 0 # your terminal background color is light (default is 0)
+HTML_LOWER = 0 # use lowercased HTML tags instead upper? (default is 0)
+
+##############################################################################
+
+
+# These are all the core Python modules used by txt2tags (KISS!)
+import re, os, sys, time, getopt
+
+# The CSV module is new in Python version 2.3
+try:
+ import csv
+except ImportError:
+ csv = None
+
+# Program information
+my_url = 'http://txt2tags.sf.net'
+my_name = 'txt2tags'
+my_email = 've...@au...'
+my_version = '2.6b1'
+
+# i18n - just use if available
+if USE_I18N:
+ try:
+ import gettext
+ # If your locale dir is different, change it here
+ cat = gettext.Catalog('txt2tags',localedir='/usr/share/locale/')
+ _ = cat.gettext
+ except:
+ _ = lambda x:x
+else:
+ _ = lambda x:x
+
+# FLAGS : the conversion related flags , may be used in %!options
+# OPTIONS : the conversion related options, may be used in %!options
+# ACTIONS : the other behavior modifiers, valid on command line only
+# MACROS : the valid macros with their default values for formatting
+# SETTINGS: global miscellaneous settings, valid on RC file only
+# NO_TARGET: actions that don't require a target specification
+# NO_MULTI_INPUT: actions that don't accept more than one input file
+# CONFIG_KEYWORDS: the valid %!key:val keywords
+#
+# FLAGS and OPTIONS are configs that affect the converted document.
+# They usually have also a --no-<option> to turn them OFF.
+#
+# ACTIONS are needed because when doing multiple input files, strange
+# behavior would be found, as use command line interface for the
+# first file and gui for the second. There is no --no-<action>.
+# --version and --help inside %!options are also odd
+#
+TARGETS = 'html xhtml sgml dbk tex lout man mgp wiki gwiki doku pmw moin pm6 txt art adoc creole'.split()
+TARGETS.sort()
+
+FLAGS = {'headers' :1 , 'enum-title' :0 , 'mask-email' :0 ,
+ 'toc-only' :0 , 'toc' :0 , 'rc' :1 ,
+ 'css-sugar' :0 , 'css-suggar' :0 , 'css-inside' :0 ,
+ 'quiet' :0 , 'slides' :0 }
+OPTIONS = {'target' :'', 'toc-level' :3 , 'style' :'',
+ 'infile' :'', 'outfile' :'', 'encoding' :'',
+ 'config-file':'', 'split' :0 , 'lang' :'',
+ 'width' :0 , 'height' :0 , 'art-chars' :'',
+ 'show-config-value':''}
+ACTIONS = {'help' :0 , 'version' :0 , 'gui' :0 ,
+ 'verbose' :0 , 'debug' :0 , 'dump-config':0 ,
+ 'dump-source':0 , 'targets' :0}
+MACROS = {'date' : '%Y%m%d', 'infile': '%f',
+ 'mtime': '%Y%m%d', 'outfile': '%f'}
+SETTINGS = {} # for future use
+NO_TARGET = ['help', 'version', 'gui', 'toc-only', 'dump-config', 'dump-source', 'targets']
+NO_MULTI_INPUT = ['gui','dump-config','dump-source']
+CONFIG_KEYWORDS = [
+ 'target', 'encoding', 'style', 'options', 'preproc','postproc',
+ 'guicolors']
+
+TARGET_NAMES = {
+ 'html' : _('HTML page'),
+ 'xhtml' : _('XHTML page'),
+ 'sgml' : _('SGML document'),
+ 'dbk' : _('DocBook document'),
+ 'tex' : _('LaTeX document'),
+ 'lout' : _('Lout document'),
+ 'man' : _('UNIX Manual page'),
+ 'mgp' : _('MagicPoint presentation'),
+ 'wiki' : _('Wikipedia page'),
+ 'gwiki' : _('Google Wiki page'),
+ 'doku' : _('DokuWiki page'),
+ 'pmw' : _('pmWiki page'),
+ 'moin' : _('MoinMoin page'),
+ 'pm6' : _('PageMaker document'),
+ 'txt' : _('Plain Text'),
+ 'art' : _('ASCII Art text'),
+ 'adoc' : _('AsciiDoc document'),
+ 'creole' : _('Creole 1.0 document')
+}
+
+DEBUG = 0 # do not edit here, please use --debug
+VERBOSE = 0 # do not edit here, please use -v, -vv or -vvv
+QUIET = 0 # do not edit here, please use --quiet
+GUI = 0 # do not edit here, please use --gui
+AUTOTOC = 1 # do not edit here, please use --no-toc or %%toc
+
+DFT_TEXT_WIDTH = 72 # do not edit here, please use --width
+DFT_SLIDE_WIDTH = 80 # do not edit here, please use --width
+DFT_SLIDE_HEIGHT = 25 # do not edit here, please use --height
+
+# ASCII Art config
+AA_KEYS = 'corner border side bar1 bar2 level2 level3 level4 level5'.split()
+AA_VALUES = '+-|-==-^"' # do not edit here, please use --art-chars
+AA = dict(zip(AA_KEYS, AA_VALUES))
+AA_COUNT = 0
+AA_TITLE = ''
+
+RC_RAW = []
+CMDLINE_RAW = []
+CONF = {}
+BLOCK = None
+TITLE = None
+regex = {}
+TAGS = {}
+rules = {}
+
+# Gui globals
+askopenfilename = None
+showinfo = None
+showwarning = None
+showerror = None
+
+lang = 'english'
+TARGET = ''
+
+STDIN = STDOUT = '-'
+MODULEIN = MODULEOUT = '-module-'
+ESCCHAR = '\x00'
+SEPARATOR = '\x01'
+LISTNAMES = {'-':'list', '+':'numlist', ':':'deflist'}
+LINEBREAK = {'default':'\n', 'win':'\r\n', 'mac':'\r'}
+
+# Platform specific settings
+LB = LINEBREAK.get(sys.platform[:3]) or LINEBREAK['default']
+
+VERSIONSTR = _("%s version %s <%s>")%(my_name,my_version,my_url)
+
+USAGE = '\n'.join([
+'',
+_("Usage: %s [OPTIONS] [infile.t2t ...]") % my_name,
+'',
+_(" --targets print a list of all the available targets and exit"),
+_(" -t, --target=TYPE set target document type. currently supported:"),
+ ' %s,' % ', '.join(TARGETS[:9]),
+ ' %s' % ', '.join(TARGETS[9:]),
+_(" -i, --infile=FILE set FILE as the input file name ('-' for STDIN)"),
+_(" -o, --outfile=FILE set FILE as the output file name ('-' for STDOUT)"),
+_(" --encoding=ENC set target file encoding (utf-8, iso-8859-1, etc)"),
+_(" --toc add an automatic Table of Contents to the output"),
+_(" --toc-level=N set maximum TOC level (depth) to N"),
+_(" --toc-only print the Table of Contents and exit"),
+_(" -n, --enum-title enumerate all titles as 1, 1.1, 1.1.1, etc"),
+_(" --style=FILE use FILE as the document style (like HTML CSS)"),
+_(" --css-sugar insert CSS-friendly tags for HTML/XHTML"),
+_(" --css-inside insert CSS file contents inside HTML/XHTML headers"),
+_(" -H, --no-headers suppress header and footer from the output"),
+_(" --mask-email hide email from spam robots. x@y.z turns <x (a) y z>"),
+_(" --slides format output as presentation slides (used by -t art)"),
+_(" --width=N set the output's width to N columns (used by -t art)"),
+_(" --height=N set the output's height to N rows (used by -t art)"),
+_(" -C, --config-file=F read configuration from file F"),
+_(" --gui invoke Graphical Tk Interface"),
+_(" -q, --quiet quiet mode, suppress all output (except errors)"),
+_(" -v, --verbose print informative messages during conversion"),
+_(" -h, --help print this help information and exit"),
+_(" -V, --version print program version and exit"),
+_(" --dump-config print all the configuration found and exit"),
+_(" --dump-source print the document source, with includes expanded"),
+'',
+_("Turn OFF options:"),
+" --no-css-inside, --no-css-sugar, --no-dump-config, --no-dump-source,",
+" --no-encoding, --no-enum-title, --no-headers, --no-infile,",
+" --no-mask-email, --no-outfile, --no-quiet, --no-rc, --no-slides,",
+" --no-style, --no-targets, --no-toc, --no-toc-only",
+'',
+_("Example:"),
+" %s -t html --toc %s" % (my_name, _("file.t2t")),
+'',
+_("By default, converted output is saved to 'infile.<target>'."),
+_("Use --outfile to force an output file name."),
+_("If input file is '-', reads from STDIN."),
+_("If output file is '-', dumps output to STDOUT."),
+'',
+'Site: %s' % my_url,
+'Bugs: http://code.google.com/p/txt2tags/issues/list',
+'SVN : http://code.google.com/p/txt2tags/source/browse/trunk',
+''
+])
+
+
+##############################################################################
+
+
+# Here is all the target's templates
+# You may edit them to fit your needs
+# - the %(HEADERn)s strings represent the Header lines
+# - the %(STYLE)s string is changed by --style contents
+# - the %(ENCODING)s string is changed by --encoding contents
+# - if any of the above is empty, the full line is removed
+# - use %% to represent a literal %
+#
+HEADER_TEMPLATE = {
+ 'art':"""
+Fake template to respect the general process.
+""",
+ 'txt': """\
+%(HEADER1)s
+%(HEADER2)s
+%(HEADER3)s
+""",
+
+ 'sgml': """\
+<!doctype linuxdoc system>
+<article>
+<title>%(HEADER1)s
+<author>%(HEADER2)s
+<date>%(HEADER3)s
+""",
+
+ 'html': """\
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+<META NAME="generator" CONTENT="http://txt2tags.sf.net">
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=%(ENCODING)s">
+<LINK REL="stylesheet" TYPE="text/css" HREF="%(STYLE)s">
+<TITLE>%(HEADER1)s</TITLE>
+</HEAD><BODY BGCOLOR="white" TEXT="black">
+<CENTER>
+<H1>%(HEADER1)s</H1>
+<FONT SIZE="4"><I>%(HEADER2)s</I></FONT><BR>
+<FONT SIZE="4">%(HEADER3)s</FONT>
+</CENTER>
+""",
+
+ 'htmlcss': """\
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<HTML>
+<HEAD>
+<META NAME="generator" CONTENT="http://txt2tags.sf.net">
+<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=%(ENCODING)s">
+<LINK REL="stylesheet" TYPE="text/css" HREF="%(STYLE)s">
+<TITLE>%(HEADER1)s</TITLE>
+</HEAD>
+<BODY>
+
+<DIV CLASS="header" ID="header">
+<H1>%(HEADER1)s</H1>
+<H2>%(HEADER2)s</H2>
+<H3>%(HEADER3)s</H3>
+</DIV>
+""",
+
+ 'xhtml': """\
+<?xml version="1.0"
+ encoding="%(ENCODING)s"
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>%(HEADER1)s</title>
+<meta name="generator" content="http://txt2tags.sf.net" />
+<link rel="stylesheet" type="text/css" href="%(STYLE)s" />
+</head>
+<body bgcolor="white" text="black">
+<div align="center">
+<h1>%(HEADER1)s</h1>
+<h2>%(HEADER2)s</h2>
+<h3>%(HEADER3)s</h3>
+</div>
+""",
+
+ 'xhtmlcss': """\
+<?xml version="1.0"
+ encoding="%(ENCODING)s"
+?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"\
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>%(HEADER1)s</title>
+<meta name="generator" content="http://txt2tags.sf.net" />
+<link rel="stylesheet" type="text/css" href="%(STYLE)s" />
+</head>
+<body>
+
+<div class="header" id="header">
+<h1>%(HEADER1)s</h1>
+<h2>%(HEADER2)s</h2>
+<h3>%(HEADER3)s</h3>
+</div>
+""",
+
+ 'dbk': """\
+<?xml version="1.0"
+ encoding="%(ENCODING)s"
+?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"\
+ "docbook/dtd/xml/4.5/docbookx.dtd">
+<article lang="en">
+ <articleinfo>
+ <title>%(HEADER1)s</title>
+ <authorgroup>
+ <author><othername>%(HEADER2)s</othername></author>
+ </authorgroup>
+ <date>%(HEADER3)s</date>
+ </articleinfo>
+""",
+
+ 'man': """\
+.TH "%(HEADER1)s" 1 "%(HEADER3)s" "%(HEADER2)s"
+""",
+
+# TODO style to <HR>
+ 'pm6': """\
+<PMTags1.0 win><C-COLORTABLE ("Preto" 1 0 0 0)
+><@Normal=
+ <FONT "Times New Roman"><CCOLOR "Preto"><SIZE 11>
+ <HORIZONTAL 100><LETTERSPACE 0><CTRACK 127><CSSIZE 70><C+SIZE 58.3>
+ <C-POSITION 33.3><C+POSITION 33.3><P><CBASELINE 0><CNOBREAK 0><CLEADING -0.05>
+ <GGRID 0><GLEFT 7.2><GRIGHT 0><GFIRST 0><G+BEFORE 7.2><G+AFTER 0>
+ <GALIGNMENT "justify"><GMETHOD "proportional"><G& "ENGLISH">
+ <GPAIRS 12><G%% 120><GKNEXT 0><GKWIDOW 0><GKORPHAN 0><GTABS $>
+ <GHYPHENATION 2 34 0><GWORDSPACE 75 100 150><GSPACE -5 0 25>
+><@Bullet=<@-PARENT "Normal"><FONT "Abadi MT Condensed Light">
+ <GLEFT 14.4><G+BEFORE 2.15><G%% 110><GTABS(25.2 l "")>
+><@PreFormat=<@-PARENT "Normal"><FONT "Lucida Console"><SIZE 8><CTRACK 0>
+ <GLEFT 0><G+BEFORE 0><GALIGNMENT "left"><GWORDSPACE 100 100 100><GSPACE 0 0 0>
+><@Title1=<@-PARENT "Normal"><FONT "Arial"><SIZE 14><B>
+ <GCONTENTS><GLEFT 0><G+BEFORE 0><GALIGNMENT "left">
+><@Title2=<@-PARENT "Title1"><SIZE 12><G+BEFORE 3.6>
+><@Title3=<@-PARENT "Title1"><SIZE 10><GLEFT 7.2><G+BEFORE 7.2>
+><@Title4=<@-PARENT "Title3">
+><@Title5=<@-PARENT "Title3">
+><@Quote=<@-PARENT "Normal"><SIZE 10><I>>
+
+%(HEADER1)s
+%(HEADER2)s
+%(HEADER3)s
+""",
+
+ 'mgp': """\
+#!/usr/X11R6/bin/mgp -t 90
+%%deffont "normal" xfont "utopia-medium-r", charset "iso8859-1"
+%%deffont "normal-i" xfont "utopia-medium-i", charset "iso8859-1"
+%%deffont "normal-b" xfont "utopia-bold-r" , charset "iso8859-1"
+%%deffont "normal-bi" xfont "utopia-bold-i" , charset "iso8859-1"
+%%deffont "mono" xfont "courier-medium-r", charset "iso8859-1"
+%%default 1 size 5
+%%default 2 size 8, fore "yellow", font "normal-b", center
+%%default 3 size 5, fore "white", font "normal", left, prefix " "
+%%tab 1 size 4, vgap 30, prefix " ", icon arc "red" 40, leftfill
+%%tab 2 prefix " ", icon arc "orange" 40, leftfill
+%%tab 3 prefix " ", icon arc "brown" 40, leftfill
+%%tab 4 prefix " ", icon arc "darkmagenta" 40, leftfill
+%%tab 5 prefix " ", icon arc "magenta" 40, leftfill
+%%%%------------------------- end of headers -----------------------------
+%%page
+
+
+
+
+
+%%size 10, center, fore "yellow"
+%(HEADER1)s
+
+%%font "normal-i", size 6, fore "white", center
+%(HEADER2)s
+
+%%font "mono", size 7, center
+%(HEADER3)s
+""",
+
+ 'moin': """\
+'''%(HEADER1)s'''
+
+''%(HEADER2)s''
+
+%(HEADER3)s
+""",
+
+ 'gwiki': """\
+*%(HEADER1)s*
+
+%(HEADER2)s
+
+_%(HEADER3)s_
+""",
+
+ 'adoc': """\
+= %(HEADER1)s
+%(HEADER2)s
+%(HEADER3)s
+""",
+
+ 'doku': """\
+===== %(HEADER1)s =====
+
+**//%(HEADER2)s//**
+
+//%(HEADER3)s//
+""",
+
+ 'pmw': """\
+(:Title %(HEADER1)s:)
+
+(:Description %(HEADER2)s:)
+
+(:Summary %(HEADER3)s:)
+""",
+
+ 'wiki': """\
+'''%(HEADER1)s'''
+
+%(HEADER2)s
+
+''%(HEADER3)s''
+""",
+
+ 'tex': \
+r"""\documentclass{article}
+\usepackage{graphicx}
+\usepackage{paralist} %% needed for compact lists
+\usepackage[normalem]{ulem} %% needed by strike
+\usepackage[urlcolor=blue,colorlinks=true]{hyperref}
+\usepackage[%(ENCODING)s]{inputenc} %% char encoding
+\usepackage{%(STYLE)s} %% user defined
+
+\title{%(HEADER1)s}
+\author{%(HEADER2)s}
+\begin{document}
+\date{%(HEADER3)s}
+\maketitle
+\clearpage
+""",
+
+ 'lout': """\
+@SysInclude { doc }
+@Document
+ @InitialFont { Times Base 12p } # Times, Courier, Helvetica, ...
+ @PageOrientation { Portrait } # Portrait, Landscape
+ @ColumnNumber { 1 } # Number of columns (2, 3, ...)
+ @PageHeaders { Simple } # None, Simple, Titles, NoTitles
+ @InitialLanguage { English } # German, French, Portuguese, ...
+ @OptimizePages { Yes } # Yes/No smart page break feature
+//
+@Text @Begin
+@Display @Heading { %(HEADER1)s }
+@Display @I { %(HEADER2)s }
+@Display { %(HEADER3)s }
+#@NP # Break page after Headers
+""",
+ 'creole': """\
+%(HEADER1)s
+%(HEADER2)s
+%(HEADER3)s
+"""
+# @SysInclude { tbl } # Tables support
+# setup: @MakeContents { Yes } # show TOC
+# setup: @SectionGap # break page at each section
+}
+
+
+##############################################################################
+
+
+def getTags(config):
+ "Returns all the known tags for the specified target"
+
+ keys = """
+ title1 numtitle1
+ title2 numtitle2
+ title3 numtitle3
+ title4 numtitle4
+ title5 numtitle5
+ title1Open title1Close
+ title2Open title2Close
+ title3Open title3Close
+ title4Open title4Close
+ title5Open title5Close
+ blocktitle1Open blocktitle1Close
+ blocktitle2Open blocktitle2Close
+ blocktitle3Open blocktitle3Close
+
+ paragraphOpen paragraphClose
+ blockVerbOpen blockVerbClose
+ blockQuoteOpen blockQuoteClose blockQuoteLine
+ blockCommentOpen blockCommentClose
+
+ fontMonoOpen fontMonoClose
+ fontBoldOpen fontBoldClose
+ fontItalicOpen fontItalicClose
+ fontUnderlineOpen fontUnderlineClose
+ fontStrikeOpen fontStrikeClose
+
+ listOpen listClose
+ listOpenCompact listCloseCompact
+ listItemOpen listItemClose listItemLine
+ numlistOpen numlistClose
+ numlistOpenCompact numlistCloseCompact
+ numlistItemOpen numlistItemClose numlistItemLine
+ deflistOpen deflistClose
+ deflistOpenCompact deflistCloseCompact
+ deflistItem1Open deflistItem1Close
+ deflistItem2Open deflistItem2Close deflistItem2LinePrefix
+
+ bar1 bar2
+ url urlMark
+ email emailMark
+ img imgAlignLeft imgAlignRight imgAlignCenter
+ _imgAlignLeft _imgAlignRight _imgAlignCenter
+
+ tableOpen tableClose
+ _tableBorder _tableAlignLeft _tableAlignCenter
+ tableRowOpen tableRowClose tableRowSep
+ tableTitleRowOpen tableTitleRowClose
+ tableCellOpen tableCellClose tableCellSep
+ tableTitleCellOpen tableTitleCellClose tableTitleCellSep
+ _tableColAlignLeft _tableColAlignRight _tableColAlignCenter
+ _tableCellAlignLeft _tableCellAlignRight _tableCellAlignCenter
+ _tableCellColSpan tableColAlignSep
+ _tableCellMulticolOpen
+ _tableCellMulticolClose
+
+ bodyOpen bodyClose
+ cssOpen cssClose
+ tocOpen tocClose TOC
+ anchor
+ comment
+ pageBreak
+ EOD
+ """.split()
+
+ # TIP: \a represents the current text on the mark
+ # TIP: ~A~, ~B~ and ~C~ are expanded to other tags parts
+
+ alltags = {
+
+ 'art': {
+ 'title1' : '\a' ,
+ 'title2' : '\a' ,
+ 'title3' : '\a' ,
+ 'title4' : '\a' ,
+ 'title5' : '\a' ,
+ 'blockQuoteLine' : '\t' ,
+ 'listItemOpen' : '- ' ,
+ 'numlistItemOpen' : '\a. ' ,
+ 'bar1' : aa_line(AA['bar1'], config['width']),
+ 'bar2' : aa_line(AA['bar2'], config['width']),
+ 'url' : '\a' ,
+ 'urlMark' : '\a (\a)' ,
+ 'email' : '\a' ,
+ 'emailMark' : '\a (\a)' ,
+ 'img' : '[\a]' ,
+ },
+
+ 'txt': {
+ 'title1' : ' \a' ,
+ 'title2' : '\t\a' ,
+ 'title3' : '\t\t\a' ,
+ 'title4' : '\t\t\t\a' ,
+ 'title5' : '\t\t\t\t\a',
+ 'blockQuoteLine' : '\t' ,
+ 'listItemOpen' : '- ' ,
+ 'numlistItemOpen' : '\a. ' ,
+ 'bar1' : '\a' ,
+ 'url' : '\a' ,
+ 'urlMark' : '\a (\a)' ,
+ 'email' : '\a' ,
+ 'emailMark' : '\a (\a)' ,
+ 'img' : '[\a]' ,
+ },
+
+ 'html': {
+ 'paragraphOpen' : '<P>' ,
+ 'paragraphClose' : '</P>' ,
+ 'title1' : '~A~<H1>\a</H1>' ,
+ 'title2' : '~A~<H2>\a</H2>' ,
+ 'title3' : '~A~<H3>\a</H3>' ,
+ 'title4' : '~A~<H4>\a</H4>' ,
+ 'title5' : '~A~<H5>\a</H5>' ,
+ 'anchor' : '<A NAME="\a"></A>\n',
+ 'blockVerbOpen' : '<PRE>' ,
+ 'blockVerbClose' : '</PRE>' ,
+ 'blockQuoteOpen' : '<BLOCKQUOTE>' ,
+ 'blockQuoteClose' : '</BLOCKQUOTE>' ,
+ 'fontMonoOpen' : '<CODE>' ,
+ 'fontMonoClose' : '</CODE>' ,
+ 'fontBoldOpen' : '<B>' ,
+ 'fontBoldClose' : '</B>' ,
+ 'fontItalicOpen' : '<I>' ,
+ 'fontItalicClose' : '</I>' ,
+ 'fontUnderlineOpen' : '<U>' ,
+ 'fontUnderlineClose' : '</U>' ,
+ 'fontStrikeOpen' : '<S>' ,
+ 'fontStrikeClose' : '</S>' ,
+ 'listOpen' : '<UL>' ,
+ 'listClose' : '</UL>' ,
+ 'listItemOpen' : '<LI>' ,
+ 'numlistOpen' : '<OL>' ,
+ 'numlistClose' : '</OL>' ,
+ 'numlistItemOpen' : '<LI>' ,
+ 'deflistOpen' : '<DL>' ,
+ 'deflistClose' : '</DL>' ,
+ 'deflistItem1Open' : '<DT>' ,
+ 'deflistItem1Close' : '</DT>' ,
+ 'deflistItem2Open' : '<DD>' ,
+ 'bar1' : '<HR NOSHADE SIZE=1>' ,
+ 'bar2' : '<HR NOSHADE SIZE=5>' ,
+ 'url' : '<A HREF="\a">\a</A>' ,
+ 'urlMark' : '<A HREF="\a">\a</A>' ,
+ 'email' : '<A HREF="mailto:\a">\a</A>' ,
+ 'emailMark' : '<A HREF="mailto:\a">\a</A>' ,
+ 'img' : '<IMG~A~ SRC="\a" BORDER="0" ALT="">',
+ '_imgAlignLeft' : ' ALIGN="left"' ,
+ '_imgAlignCenter' : ' ALIGN="middle"',
+ '_imgAlignRight' : ' ALIGN="right"' ,
+ 'tableOpen' : '<TABLE~A~~B~ CELLPADDING="4">',
+ 'tableClose' : '</TABLE>' ,
+ 'tableRowOpen' : '<TR>' ,
+ 'tableRowClose' : '</TR>' ,
+ 'tableCellOpen' : '<TD~A~~S~>' ,
+ 'tableCellClose' : '</TD>' ,
+ 'tableTitleCellOpen' : '<TH~S~>' ,
+ 'tableTitleCellClose' : '</TH>' ,
+ '_tableBorder' : ' BORDER="1"' ,
+ '_tableAlignCenter' : ' ALIGN="center"',
+ '_tableCellAlignRight' : ' ALIGN="right"' ,
+ '_tableCellAlignCenter': ' ALIGN="center"',
+ '_tableCellColSpan' : ' COLSPAN="\a"' ,
+ 'cssOpen' : '<STYLE TYPE="text/css">',
+ 'cssClose' : '</STYLE>' ,
+ 'comment' : '<!-- \a -->' ,
+ 'EOD' : '</BODY></HTML>'
+ },
+
+ #TIP xhtml inherits all HTML definitions (lowercased)
+ #TIP http://www.w3.org/TR/xhtml1/#guidelines
+ #TIP http://www.htmlref.com/samples/Chapt17/17_08.htm
+ 'xhtml': {
+ 'listItemClose' : '</li>' ,
+ 'numlistItemClose' : '</li>' ,
+ 'deflistItem2Close' : '</dd>' ,
+ 'bar1' : '<hr class="light" />',
+ 'bar2' : '<hr class="heavy" />',
+ 'anchor' : '<a id="\a" name="\a"></a>\n',
+ 'img' : '<img~A~ src="\a" border="0" alt=""/>',
+ },
+
+ 'sgml': {
+ 'paragraphOpen' : '<p>' ,
+ 'title1' : '<sect>\a~A~<p>' ,
+ 'title2' : '<sect1>\a~A~<p>' ,
+ 'title3' : '<sect2>\a~A~<p>' ,
+ 'title4' : '<sect3>\a~A~<p>' ,
+ 'title5' : '<sect4>\a~A~<p>' ,
+ 'anchor' : '<label id="\a">' ,
+ 'blockVerbOpen' : '<tscreen><verb>' ,
+ 'blockVerbClose' : '</verb></tscreen>' ,
+ 'blockQuoteOpen' : '<quote>' ,
+ 'blockQuoteClose' : '</quote>' ,
+ 'fontMonoOpen' : '<tt>' ,
+ 'fontMonoClose' : '</tt>' ,
+ 'fontBoldOpen' : '<bf>' ,
+ 'fontBoldClose' : '</bf>' ,
+ 'fontItalicOpen' : '<em>' ,
+ 'fontItalicClose' : '</em>' ,
+ 'fontUnderlineOpen' : '<bf><em>' ,
+ 'fontUnderlineClose' : '</em></bf>' ,
+ 'listOpen' : '<itemize>' ,
+ 'listClose' : '</itemize>' ,
+ 'listItemOpen' : '<item>' ,
+ 'numlistOpen' : '<enum>' ,
+ 'numlistClose' : '</enum>' ,
+ 'numlistItemOpen' : '<item>' ,
+ 'deflistOpen' : '<descrip>' ,
+ 'deflistClose' : '</descrip>' ,
+ 'deflistItem1Open' : '<tag>' ,
+ 'deflistItem1Close' : '</tag>' ,
+ 'bar1' : '<!-- \a -->' ,
+ 'url' : '<htmlurl url="\a" name="\a">' ,
+ 'urlMark' : '<htmlurl url="\a" name="\a">' ,
+ 'email' : '<htmlurl url="mailto:\a" name="\a">' ,
+ 'emailMark' : '<htmlurl url="mailto:\a" name="\a">' ,
+ 'img' : '<figure><ph vspace=""><img src="\a"></figure>',
+ 'tableOpen' : '<table><tabular ca="~C~">' ,
+ 'tableClose' : '</tabular></table>' ,
+ 'tableRowSep' : '<rowsep>' ,
+ 'tableCellSep' : '<colsep>' ,
+ '_tableColAlignLeft' : 'l' ,
+ '_tableColAlignRight' : 'r' ,
+ '_tableColAlignCenter' : 'c' ,
+ 'comment' : '<!-- \a -->' ,
+ 'TOC' : '<toc>' ,
+ 'EOD' : '</article>'
+ },
+
+ 'dbk': {
+ 'paragraphOpen' : '<para>' ,
+ 'paragraphClose' : '</para>' ,
+ 'title1Open' : '~A~<sect1><title>\a</title>' ,
+ 'title1Close' : '</sect1>' ,
+ 'title2Open' : '~A~ <sect2><title>\a</title>' ,
+ 'title2Close' : ' </sect2>' ,
+ 'title3Open' : '~A~ <sect3><title>\a</title>' ,
+ 'title3Close' : ' </sect3>' ,
+ 'title4Open' : '~A~ <sect4><title>\a</title>' ,
+ 'title4Close' : ' </sect4>' ,
+ 'title5Open' : '~A~ <sect5><title>\a</title>',
+ 'title5Close' : ' </sect5>' ,
+ 'anchor' : '<anchor id="\a"/>\n' ,
+ 'blockVerbOpen' : '<programlisting>' ,
+ 'blockVerbClose' : '</programlisting>' ,
+ 'blockQuoteOpen' : '<blockquote><para>' ,
+ 'blockQuoteClose' : '</para></blockquote>' ,
+ 'fontMonoOpen' : '<code>' ,
+ 'fontMonoClose' : '</code>' ,
+ 'fontBoldOpen' : '<emphasis role="bold">' ,
+ 'fontBoldClose' : '</emphasis>' ,
+ 'fontItalicOpen' : '<emphasis>' ,
+ 'fontItalicClose' : '</emphasis>' ,
+ 'fontUnderlineOpen' : '<emphasis role="underline">' ,
+ 'fontUnderlineClose' : '</emphasis>' ,
+ # 'fontStrikeOpen' : '<emphasis role="strikethrough">' , # Don't know
+ # 'fontStrikeClose' : '</emphasis>' ,
+ 'listOpen' : '<itemizedlist>' ,
+ 'listClose' : '</itemizedlist>' ,
+ 'listItemOpen' : '<listitem><para>' ,
+ 'listItemClose' : '</para></listitem>' ,
+ 'numlistOpen' : '<orderedlist numeration="arabic">' ,
+ 'numlistClose' : '</orderedlist>' ,
+ 'numlistItemOpen' : '<listitem><para>' ,
+ 'numlistItemClose' : '</para></listitem>' ,
+ 'deflistOpen' : '<variablelist>' ,
+ 'deflistClose' : '</variablelist>' ,
+ 'deflistItem1Open' : '<varlistentry><term>' ,
+ 'deflistItem1Close' : '</term>' ,
+ 'deflistItem2Open' : '<listitem><para>' ,
+ 'deflistItem2Close' : '</para></listitem></varlistentry>' ,
+ # 'bar1' : '<>' , # Don't know
+ # 'bar2' : '<>' , # Don't know
+ 'url' : '<ulink url="\a">\a</ulink>' ,
+ 'urlMark' : '<ulink url="\a">\a</ulink>' ,
+ 'email' : '<email>\a</email>' ,
+ 'emailMark' : '<email>\a</email>' ,
+ 'img' : '<mediaobject><imageobject><imagedata fileref="\a"/></imageobject></mediaobject>',
+ # '_imgAlignLeft' : '' , # Don't know
+ # '_imgAlignCenter' : '' , # Don't know
+ # '_imgAlignRight' : '' , # Don't know
+ 'tableOpen' : '<para>', # just to have something...
+ 'tableClose' : '</para>',
+ # 'tableOpen' : '<informaltable><tgroup cols=""><tbody>', # Don't work, need to know number of cols
+ # 'tableClose' : '</tbody></tgroup></informaltable>' ,
+ # 'tableRowOpen' : '<row>' ,
+ # 'tableRowClose' : '</row>' ,
+ # 'tableCellOpen' : '<entry>' ,
+ # 'tableCellClose' : '</entry>' ,
+ # 'tableTitleRowOpen' : '<thead>' ,
+ # 'tableTitleRowClose' : '</thead>' ,
+ # '_tableBorder' : ' frame="all"' ,
+ # '_tableAlignCenter' : ' align="center"' ,
+ # '_tableCellAlignRight' : ' align="right"' ,
+ # '_tableCellAlignCenter': ' align="center"' ,
+ # '_tableCellColSpan' : ' COLSPAN="\a"' ,
+ 'TOC' : '<index/>' ,
+ 'comment' : '<!-- \a -->' ,
+ 'EOD' : '</article>'
+ },
+
+ 'tex': {
+ 'title1' : '~A~\section*{\a}' ,
+ 'title2' : '~A~\\subsection*{\a}' ,
+ 'title3' : '~A~\\subsubsection*{\a}',
+ # title 4/5: DIRTY: para+BF+\\+\n
+ 'title4' : '~A~\\paragraph{}\\textbf{\a}\\\\\n',
+ 'title5' : '~A~\\paragraph{}\\textbf{\a}\\\\\n',
+ 'numtitle1' : '\n~A~\section{\a}' ,
+ 'numtitle2' : '~A~\\subsection{\a}' ,
+ 'numtitle3' : '~A~\\subsubsection{\a}' ,
+ 'anchor' : '\\hypertarget{\a}{}\n' ,
+ 'blockVerbOpen' : '\\begin{verbatim}' ,
+ 'blockVerbClose' : '\\end{verbatim}' ,
+ 'blockQuoteOpen' : '\\begin{quotation}' ,
+ 'blockQuoteClose' : '\\end{quotation}' ,
+ 'fontMonoOpen' : '\\texttt{' ,
+ 'fontMonoClose' : '}' ,
+ 'fontBoldOpen' : '\\textbf{' ,
+ 'fontBoldClose' : '}' ,
+ 'fontItalicOpen' : '\\textit{' ,
+ 'fontItalicClose' : '}' ,
+ 'fontUnderlineOpen' : '\\underline{' ,
+ 'fontUnderlineClose' : '}' ,
+ 'fontStrikeOpen' : '\\sout{' ,
+ 'fontStrikeClose' : '}' ,
+ 'listOpen' : '\\begin{itemize}' ,
+ 'listClose' : '\\end{itemize}' ,
+ 'listOpenCompact' : '\\begin{compactitem}',
+ 'listCloseCompact' : '\\end{compactitem}' ,
+ 'listItemOpen' : '\\item ' ,
+ 'numlistOpen' : '\\begin{enumerate}' ,
+ 'numlistClose' : '\\end{enumerate}' ,
+ 'numlistOpenCompact' : '\\begin{compactenum}',
+ 'numlistCloseCompact' : '\\end{compactenum}' ,
+ 'numlistItemOpen' : '\\item ' ,
+ 'deflistOpen' : '\\begin{description}',
+ 'deflistClose' : '\\end{description}' ,
+ 'deflistOpenCompact' : '\\begin{compactdesc}',
+ 'deflistCloseCompact' : '\\end{compactdesc}' ,
+ 'deflistItem1Open' : '\\item[' ,
+ 'deflistItem1Close' : ']' ,
+ 'bar1' : '\\hrulefill{}' ,
+ 'bar2' : '\\rule{\linewidth}{1mm}',
+ 'url' : '\\htmladdnormallink{\a}{\a}',
+ 'urlMark' : '\\htmladdnormallink{\a}{\a}',
+ 'email' : '\\htmladdnormallink{\a}{mailto:\a}',
+ 'emailMark' : '\\htmladdnormallink{\a}{mailto:\a}',
+ 'img' : '\\includegraphics{\a}',
+ 'tableOpen' : '\\begin{center}\\begin{tabular}{|~C~|}',
+ 'tableClose' : '\\end{tabular}\\end{center}',
+ 'tableRowOpen' : '\\hline ' ,
+ 'tableRowClose' : ' \\\\' ,
+ 'tableCellSep' : ' & ' ,
+ '_tableColAlignLeft' : 'l' ,
+ '_tableColAlignRight' : 'r' ,
+ '_tableColAlignCenter' : 'c' ,
+ '_tableCellAlignLeft' : 'l' ,
+ '_tableCellAlignRight' : 'r' ,
+ '_tableCellAlignCenter': 'c' ,
+ '_tableCellColSpan' : '\a' ,
+ '_tableCellMulticolOpen' : '\\multicolumn{\a}{|~C~|}{',
+ '_tableCellMulticolClose' : '}',
+ 'tableColAlignSep' : '|' ,
+ 'comment' : '% \a' ,
+ 'TOC' : '\\tableofcontents',
+ 'pageBreak' : '\\clearpage',
+ 'EOD' : '\\end{document}'
+ },
+
+ 'lout': {
+ 'paragraphOpen' : '@LP' ,
+ 'blockTitle1Open' : '@BeginSections' ,
+ 'blockTitle1Close' : '@EndSections' ,
+ 'blockTitle2Open' : ' @BeginSubSections' ,
+ 'blockTitle2Close' : ' @EndSubSections' ,
+ 'blockTitle3Open' : ' @BeginSubSubSections' ,
+ 'blockTitle3Close' : ' @EndSubSubSections' ,
+ 'title1Open' : '~A~@Section @Title { \a } @Begin',
+ 'title1Close' : '@End @Section' ,
+ 'title2Open' : '~A~ @SubSection @Title { \a } @Begin',
+ 'title2Close' : ' @End @SubSection' ,
+ 'title3Open' : '~A~ @SubSubSection @Title { \a } @Begin',
+ 'title3Close' : ' @End @SubSubSection' ,
+ 'title4Open' : '~A~@LP @LeftDisplay @B { \a }',
+ 'title5Open' : '~A~@LP @LeftDisplay @B { \a }',
+ 'anchor' : '@Tag { \a }\n' ,
+ 'blockVerbOpen' : '@LP @ID @F @RawVerbatim @Begin',
+ 'blockVerbClose' : '@End @RawVerbatim' ,
+ 'blockQuoteOpen' : '@QD {' ,
+ 'blockQuoteClose' : '}' ,
+ # enclosed inside {} to deal with joined**words**
+ 'fontMonoOpen' : '{@F {' ,
+ 'fontMonoClose' : '}}' ,
+ 'fontBoldOpen' : '{@B {' ,
+ 'fontBoldClose' : '}}' ,
+ 'fontItalicOpen' : '{@II {' ,
+ 'fontItalicClose' : '}}' ,
+ 'fontUnderlineOpen' : '{@Underline{' ,
+ 'fontUnderlineClose' : '}}' ,
+ # the full form is more readable, but could be BL EL LI NL TL DTI
+ 'listOpen' : '@BulletList' ,
+ 'listClose' : '@EndList' ,
+ 'listItemOpen' : '@ListItem{' ,
+ 'listItemClose' : '}' ,
+ 'numlistOpen' : '@NumberedList' ,
+ 'numlistClose' : '@EndList' ,
+ 'numlistItemOpen' : '@ListItem{' ,
+ 'numlistItemClose' : '}' ,
+ 'deflistOpen' : '@TaggedList' ,
+ 'deflistClose' : '@EndList' ,
+ 'deflistItem1Open' : '@DropTagItem {' ,
+ 'deflistItem1Close' : '}' ,
+ 'deflistItem2Open' : '{' ,
+ 'deflistItem2Close' : '}' ,
+ 'bar1' : '@DP @FullWidthRule' ,
+ 'url' : '{blue @Colour { \a }}' ,
+ 'urlMark' : '\a ({blue @Colour { \a }})' ,
+ 'email' : '{blue @Colour { \a }}' ,
+ 'emailMark' : '\a ({blue Colour{ \a }})' ,
+ 'img' : '~A~@IncludeGraphic { \a }' , # eps only!
+ '_imgAlignLeft' : '@LeftDisplay ' ,
+ '_imgAlignRight' : '@RightDisplay ' ,
+ '_imgAlignCenter' : '@CentredDisplay ' ,
+ # lout tables are *way* complicated, no support for now
+ #'tableOpen' : '~A~@Tbl~B~\naformat{ @Cell A | @Cell B } {',
+ #'tableClose' : '}' ,
+ #'tableRowOpen' : '@Rowa\n' ,
+ #'tableTitleRowOpen' : '@HeaderRowa' ,
+ #'tableCenterAlign' : '@CentredDisplay ' ,
+ #'tableCellOpen' : '\a {' , # A, B, ...
+ #'tableCellClose' : '}' ,
+ #'_tableBorder' : '\nrule {yes}' ,
+ 'comment' : '# \a' ,
+ # @MakeContents must be on the config file
+ 'TOC' : '@DP @ContentsGoesHere @DP',
+ 'pageBreak' : '@NP' ,
+ 'EOD' : '@End @Text'
+ },
+
+ # http://moinmo.in/SyntaxReference
+ 'moin': {
+ 'title1' : '= \a =' ,
+ 'title2' : '== \a ==' ,
+ 'title3' : '=== \a ===' ,
+ 'title4' : '==== \a ====' ,
+ 'title5' : '===== \a =====',
+ 'blockVerbOpen' : '{{{' ,
+ 'blockVerbClose' : '}}}' ,
+ 'blockQuoteLine' : ' ' ,
+ 'fontMonoOpen' : '{{{' ,
+ 'fontMonoClose' : '}}}' ,
+ 'fontBoldOpen' : "'''" ,
+ 'fontBoldClose' : "'''" ,
+ 'fontItalicOpen' : "''" ,
+ 'fontItalicClose' : "''" ,
+ 'fontUnderlineOpen' : '__' ,
+ 'fontUnderlineClose' : '__' ,
+ 'fontStrikeOpen' : '--(' ,
+ 'fontStrikeClose' : ')--' ,
+ 'listItemOpen' : ' * ' ,
+ 'numlistItemOpen' : ' \a. ' ,
+ 'deflistItem1Open' : ' ' ,
+ 'deflistItem1Close' : '::' ,
+ 'deflistItem2LinePrefix': ' :: ' ,
+ 'bar1' : '----' ,
+ 'bar2' : '--------' ,
+ 'url' : '[\a]' ,
+ 'urlMark' : '[\a \a]' ,
+ 'email' : '[\a]' ,
+ 'emailMark' : '[\a \a]' ,
+ 'img' : '[\a]' ,
+ 'tableRowOpen' : '||' ,
+ 'tableCellOpen' : '~A~' ,
+ 'tableCellClose' : '||' ,
+ 'tableTitleCellClose' : '||' ,
+ '_tableCellAlignRight' : '<)>' ,
+ '_tableCellAlignCenter' : '<:>' ,
+ 'comment' : '/* \a */' ,
+ 'TOC' : '[[TableOfContents]]'
+ },
+
+ # http://code.google.com/p/support/wiki/WikiSyntax
+ 'gwiki': {
+ 'title1' : '= \a =' ,
+ 'title2' : '== \a ==' ,
+ 'title3' : '=== \a ===' ,
+ 'title4' : '==== \a ====' ,
+ 'title5' : '===== \a =====',
+ 'blockVerbOpen' : '{{{' ,
+ 'blockVerbClose' : '}}}' ,
+ 'blockQuoteLine' : ' ' ,
+ 'fontMonoOpen' : '{{{' ,
+ 'fontMonoClose' : '}}}' ,
+ 'fontBoldOpen' : '*' ,
+ 'fontBoldClose' : '*' ,
+ 'fontItalicOpen' : '_' , # underline == italic
+ 'fontItalicClose' : '_' ,
+ 'fontStrikeOpen' : '~~' ,
+ 'fontStrikeClose' : '~~' ,
+ 'listItemOpen' : ' * ' ,
+ 'numlistItemOpen' : ' # ' ,
+ 'url' : '\a' ,
+ 'urlMark' : '[\a \a]' ,
+ 'email' : 'mailto:\a' ,
+ 'emailMark' : '[mailto:\a \a]',
+ 'img' : '[\a]' ,
+ 'tableRowOpen' : '|| ' ,
+ 'tableRowClose' : ' ||' ,
+ 'tableCellSep' : ' || ' ,
+ },
+
+ # http://powerman.name/doc/asciidoc
+ 'adoc': {
+ 'title1' : '== \a' ,
+ 'title2' : '=== \a' ,
+ 'title3' : '==== \a' ,
+ 'title4' : '===== \a' ,
+ 'title5' : '===== \a' ,
+ 'blockVerbOpen' : '----' ,
+ 'blockVerbClose' : '----' ,
+ 'fontMonoOpen' : '+' ,
+ 'fontMonoClose' : '+' ,
+ 'fontBoldOpen' : '*' ,
+ 'fontBoldClose' : '*' ,
+ 'fontItalicOpen' : '_' ,
+ 'fontItalicClose' : '_' ,
+ 'listItemOpen' : '- ' ,
+ 'listItemLine' : '\t' ,
+ 'numlistItemOpen' : '. ' ,
+ 'url' : '\a' ,
+ 'urlMark' : '\a[\a]' ,
+ 'email' : 'mailto:\a' ,
+ 'emailMark' : 'mailto:\a[\a]' ,
+ 'img' : 'image::\a[]' ,
+ },
+
+ # http://wiki.splitbrain.org/wiki:syntax
+ # Hint: <br> is \\ $
+ # Hint: You can add footnotes ((This is a footnote))
+ 'doku': {
+ 'title1' : '===== \a =====',
+ 'title2' : '==== \a ====' ,
+ 'title3' : '=== \a ===' ,
+ 'title4' : '== \a ==' ,
+ 'title5' : '= \a =' ,
+ # DokuWiki uses ' ' identation to mark verb blocks (see indentverbblock)
+ 'blockQuoteLine' : '>' ,
+ 'fontMonoOpen' : "''" ,
+ 'fontMonoClose' : "''" ,
+ 'fontBoldOpen' : "**" ,
+ 'fontBoldClose' : "**" ,
+ 'fontItalicOpen' : "//" ,
+ 'fontItalicClose' : "//" ,
+ 'fontUnderlineOpen' : "__" ,
+ 'fontUnderlineClose' : "__" ,
+ 'fontStrikeOpen' : '<del>' ,
+ 'fontStrikeClose' : '</del>' ,
+ 'listItemOpen' : ' * ' ,
+ 'numlistItemOpen' : ' - ' ,
+ 'bar1' : '----' ,
+ 'url' : '[[\a]]' ,
+ 'urlMark' : '[[\a|\a]]' ,
+ 'email' : '[[\a]]' ,
+ 'emailMark' : '[[\a|\a]]' ,
+ 'img' : '{{\a}}' ,
+ 'imgAlignLeft' : '{{\a }}' ,
+ 'imgAlignRight' : '{{ \a}}' ,
+ 'imgAlignCenter' : '{{ \a }}' ,
+ 'tableTitleRowOpen' : '^ ' ,
+ 'tableTitleRowClose' : ' ^' ,
+ 'tableTitleCellSep' : ' ^ ' ,
+ 'tableRowOpen' : '| ' ,
+ 'tableRowClose' : ' |' ,
+ 'tableCellSep' : ' | ' ,
+ # DokuWiki has no attributes. The content must be aligned!
+ # '_tableCellAlignRight' : '<)>' , # ??
+ # '_tableCellAlignCenter': '<:>' , # ??
+ # DokuWiki colspan is the same as txt2tags' with multiple |||
+ # 'comment' : '## \a' , # ??
+ # TOC is automatic
+ },
+
+ # http://www.pmwiki.org/wiki/PmWiki/TextFormattingRules
+ 'pmw': {
+ 'title1' : '~A~! \a ' ,
+ 'title2' : '~A~!! \a ' ,
+ 'title3' : '~A~!!! \a ' ,
+ 'title4' : '~A~!!!! \a ' ,
+ 'title5' : '~A~!!!!! \a ' ,
+ 'blockQuoteOpen' : '->' ,
+ 'blockQuoteClose' : '\n' ,
+ # In-text font
+ 'fontLargeOpen' : "[+" ,
+ 'fontLargeClose' : "+]" ,
+ 'fontLargerOpen' : "[++" ,
+ 'fontLargerClose' : "++]" ,
+ 'fontSmallOpen' : "[-" ,
+ 'fontSmallClose' : "-]" ,
+ 'fontLargerOpen' : "[--" ,
+ 'fontLargerClose' : "--]" ,
+ 'fontMonoOpen' : "@@" ,
+ 'fontMonoClose' : "@@" ,
+ 'fontBoldOpen' : "'''" ,
+ 'fontBoldClose' : "'''" ,
+ 'fontItalicOpen' : "''" ,
+ 'fontItalicClose' : "''" ,
+ 'fontUnderlineOpen' : "{+" ,
+ 'fontUnderlineClose' : "+}" ,
+ 'fontStrikeOpen' : '{-' ,
+ 'fontStrikeClose' : '-}' ,
+ # Lists
+ 'listItemLine' : '*' ,
+ 'numlistItemLine' : '#' ,
+ 'deflistItem1Open' : ': ' ,
+ 'deflistItem1Close' : ':' ,
+ 'deflistItem2LineOpen' : '::' ,
+ 'deflistItem2LineClose' : ':' ,
+ # Verbatim block
+ 'blockVerbOpen' : '[@' ,
+ 'blockVerbClose' : '@]' ,
+ 'bar1' : '----' ,
+ # URL, email and anchor
+ 'url' : '\a' ,
+ 'urlMark' : '[[\a -> \a]]' ,
+ 'email' : '\a' ,
+ 'emailMark' : '[[\a -> mailto:\a]]',
+ 'anchor' : '[[#\a]]\n' ,
+ # Image markup
+ 'img' : '\a' ,
+ #'imgAlignLeft' : '{{\a }}' ,
+ #'imgAlignRight' : '{{ \a}}' ,
+ #'imgAlignCenter' : '{{ \a }}' ,
+ # Table attributes
+ 'tableTitleRowOpen' : '||! ...
[truncated message content] |
|
From: Alastair I. <ala...@sj...> - 2011-03-06 16:06:08
|
Good work Nathaniel, I'm glad we've now got something that works to some extent. I've got a question about your variables. I expect that NVDA instantiates and instance of the plugin class when it is first loaded and this then remains throughout an NVDA session. Therefore wy not just make the variables members of an instance of the class, rather than being static variables? Then you could just refer to them as self.variablename. The latex_access variable should always be created in __init__ so your initialised variable would then be pointless. I also don't understand why currentLine needs to be a member of the class at all, why can't it just be a local variable in the event_caret function? Best wishes Alastair On 05/03/2011 09:12, nsc...@us... wrote: > Revision: 207 > http://latex-access.svn.sourceforge.net/latex-access/?rev=207&view=rev > Author: nschmidt19 > Date: 2011-03-05 09:12:28 +0000 (Sat, 05 Mar 2011) > > Log Message: > ----------- > Made several changes to nvda/latex_access.py, they are outlined below: > > * I should have noticed this, but GetLine () didn't return the current line, it only retrieved it. This has been fixed, and low and behold, speech translation now works! I haven't used BrailleLine() though for various reasons I have explained before. Speech is also very chatty, repeating things twice which will need to be fixed. > * global variables are now declared in the instance of the GlobalPlugin class, not at module level. I may go back to using global variables however because although it isn't normally the done thing, it's easier to write. > * "useful functions" are now methods. > * calling initialize() was wrong, so we are now using a constructor which initialises latex_access, and calls the super class method as well. > > Modified Paths: > -------------- > nvda/latex_access.py > > Modified: nvda/latex_access.py > =================================================================== > --- nvda/latex_access.py 2011-03-05 03:42:03 UTC (rev 206) > +++ nvda/latex_access.py 2011-03-05 09:12:28 UTC (rev 207) > @@ -22,7 +22,6 @@ > * The preprocessor (support for custom defined LaTeX commands): not completed.""" > > from comtypes.client import CreateObject > -from textInfos import offsets > > import api > import braille, speech# for brailling/speaking messages in NVDA > @@ -32,80 +31,76 @@ > ### Global variables: > ### I know this is probably not the best way to do this, but I wasn't sure exactly how to successfully do it another way and keep the values of the variables > ### the same throughout classes and other functions. > -initialised = False > -processMaths = False > -latex_access = None > -currentLine = None > -matrix = None > -row = None > -column = None > ### End of global variable declarations > > class GlobalPlugin (globalPluginHandler.GlobalPlugin): > """main class for the global plugin, in which all key bindings/scripts and NVDA events are handled.""" > + initialised = False > + processMaths = False > + latex_access = None > + currentLine = None > + matrix = None > + row = None > + column = None > > - def event_caret (self, obj, nextHandler): > - """This event is called when the system caret moves, and it is being overidden so that latex-access speech translation can be used if the user wishes.""" > + def __init__ (self): > + """Constructor. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later.""" > > - global currentLine, initialised, latex_access, processMaths > + super (GlobalPlugin, self).__init__ () > > - if not initialised: > - self.initialize () > + if not GlobalPlugin.initialised:# is the latex_access com object created yet? > + GlobalPlugin.latex_access = CreateObject ("latex_access") > + GlobalPlugin.initialised = True > > - if processMaths: > - currentLine = GetLine () > - if not currentLine:# Is it a blank line? > - currentLine = _("blank") > + def event_caret (self, obj, nextHandler): > + """This event is called when the system caret moves, and it is being overidden so that latex-access speech translation can be used if the user wishes.""" > + > + if GlobalPlugin.processMaths: > + GlobalPlugin.currentLine = self.GetLine () > + if not GlobalPlugin.currentLine:# Is it a blank line? > + GlobalPlugin.currentLine = _("blank") > else: > - currentLine = latex_access.speech (currentLine) > - speech.speakMessage (currentLine) > + GlobalPlugin.currentLine = GlobalPlugin.latex_access.speech (GlobalPlugin.currentLine) > + speech.speakMessage (GlobalPlugin.currentLine) > > else: > - SayLine () > + self.SayLine () > > nextHandler () > > - def initialize (self): > - """An overide of the initialize() function in globalPluginHandler.py. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later.""" > - global initialised, latex_access > - if not initialised:# is the latex_access com object created yet? > - latex_access = CreateObject ("latex_access") > - initialised = True > - > def script_toggleMaths (self, Gesture): > """A script to toggle the latex-access translation on or off. > @param gesture: the gesture to be past through to NVDA (in this case, a keypress). > @type gesture: keypress. > """ > > - global processMaths > - > - if processMaths:# is translation on? > - processMaths = False > + if GlobalPlugin.processMaths:# is translation on? > + GlobalPlugin.processMaths = False > speech.speakMessage (_("Maths to be read as plain latex")) > else: > - processMaths = True > + GlobalPlugin.processMaths = True > speech.speakMessage (_("Maths to be processed to a more verbal form")) > > script_toggleMaths.__doc__ = _("Toggles the speaking of mathematical expressions as either straight latex or a more verbal rendering.") > > - # For the key bindings: > - __gestures = { > - "kb:control+M": "toggleMaths", > - } > +# Useful methods: > > -# Useful functions: > + def GetLine (self): > + """Retrieves the line of text that the current navigator object is focussed on, then returns it.""" > + info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET) > + info.expand(textInfos.UNIT_LINE) > + currentLine = info.text > + return currentLine > > -def GetLine (): > - """Retrieves the line of text that the current navigator object is focussed on.""" > - info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET) > - info.expand(textInfos.UNIT_LINE) > - currentLine = info.text > + def SayLine (self): > + """This function says the current line without any translation. This is necessary so that we can return to NVDA's default behaviour when LaTeX translation is toggled off.""" > + speech.speakMessage (self.GetLine()) > > -def SayLine (): > - """This function says the current line without any translation. This is necessary so that we can return to NVDA's default behaviour when LaTeX translation is toggled off.""" > - speech.speakMessage (GetLine()) > + def BrailleLine (self): > + """Brailles the current line. This again is necessary so that we can return to NVDA's default behaviour.""" > + braille.handler.message (self.GetLine()) > > -def BrailleLine (): > - """Brailles the current line. This again is necessary so that we can return to NVDA's default behaviour.""" > - braille.handler.message (GetLine()) > \ No newline at end of file > + # For the key bindings: > + __gestures = { > + "kb:control+M": "toggleMaths", > + } > \ No newline at end of file > > > This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. > > ------------------------------------------------------------------------------ > What You Don't Know About Data Connectivity CAN Hurt You > This paper provides an overview of data connectivity, details > its effect on application quality, and explores various alternative > solutions. http://p.sf.net/sfu/progress-d2d > _______________________________________________ > Latex-access-devel mailing list > Lat...@li... > https://lists.sourceforge.net/lists/listinfo/latex-access-devel |
|
From: <nsc...@us...> - 2011-03-05 09:49:26
|
Revision: 208
http://latex-access.svn.sourceforge.net/latex-access/?rev=208&view=rev
Author: nschmidt19
Date: 2011-03-05 09:49:20 +0000 (Sat, 05 Mar 2011)
Log Message:
-----------
Updated bugs.txt. I will make a readme.t2t file next, since the plugin pretty much works now.
Modified Paths:
--------------
nvda/bugs.txt
Modified: nvda/bugs.txt
===================================================================
--- nvda/bugs.txt 2011-03-05 09:12:28 UTC (rev 207)
+++ nvda/bugs.txt 2011-03-05 09:49:20 UTC (rev 208)
@@ -2,28 +2,7 @@
for NVDA. Feel free to add more as they arise, and remove ones that are
fixed.
- * Event errors: This bug could be to do with the plugin
-(although I doubt it), textInfos or eventHandler.
-the log is pasted below:
-ERROR - eventHandler.executeEvent (13:14:18):
-error executing event: caret on <NVDAObjects.IAccessible.IAccessible object at 0x055A3590> with extra args of {}
-Traceback (most recent call last):
- File "C:\bzrInit\nvda\main\source\eventHandler.py", line 135, in executeEvent
- _EventExecuter(eventName,obj,kwargs)
- File "C:\bzrInit\nvda\main\source\eventHandler.py", line 84, in __init__
- self.next()
- File "C:\bzrInit\nvda\main\source\eventHandler.py", line 90, in next
- return func(*args, **self.kwargs)
- File ".\userConfig\globalPlugins\latex_access.py", line 65, in event_caret
- SayLine ()
- File ".\userConfig\globalPlugins\latex_access.py", line 108, in SayLine
- speech.speakMessage (GetLine())
- File ".\userConfig\globalPlugins\latex_access.py", line 102, in GetLine
- info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET)
- File "C:\bzrInit\nvda\main\source\NVDAObjects\__init__.py", line 852, in makeTextInfo
- return self.TextInfo(self,position)
- File "C:\bzrInit\nvda\main\source\textInfos\offsets.py", line 245, in __init__
- self._startOffset=self._endOffset=self._getCaretOffset()
- File "C:\bzrInit\nvda\main\source\textInfos\offsets.py", line 155, in _getCaretOffset
- raise NotImplementedError
-NotImplementedError
\ No newline at end of file
+ * Repetitive speech: Because NVDA's default
+behaviour is not being overidden, the current line is being spoken as
+normal, and then the plugin is causing that same line to be spoken again,
+whether translation is on or off. I need to find a way around this soon.
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Nathaniel S. <nat...@we...> - 2011-03-05 09:14:16
|
See below for the reply which relates to my recent changes in svn: -----Original Message----- From: nvd...@li... [mailto:nvd...@li...] On Behalf Of James Teh Sent: Saturday, 5 March 2011 6:02 PM To: NVDA screen reader development Subject: Re: [NVDA-dev] globalPlugin: problem with textInfos? On 5/03/2011 4:19 PM, Nathaniel Schmidt wrote: > I have been using event_caret () so that when ever the system caret > moves, the line I am focussed on at the time should get updated. So far > the translation hasn't worked, I believe due to an error I get which is > pasted below: > File ".\userConfig\globalPlugins\latex_access.py", line 102, in GetLine > info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET) > NotImplementedError Unfortunately, not every object that fires caret events actually has accessible editable text. This is weird, I know, but that's just life in Windows. :) You can either try to retrieve the line and catch the NotImplementedError exception if it fails or you can check whether something has editable text according to NVDA by using isinstance and checking for NVDAObjects.behaviors.EditableText. A couple of other problems in your module that I noticed immediately: * It's probably better to store state variables and implement functions on the GlobalPlugin instance, rather than at module level. * You're implementing an initialize() method on your GlobalPlugin class. This is incorrect; it will never get called. You need to override the constructor, __init__. You should also call super so that the superclass method gets called. Something like this: def __init__(self): super(GlobalPlugin, self).__init__() ... * Your getLine() function doesn't actually return the current line; it just retrieves it. Jamie -- James Teh Vice President, Developer NV Access Inc, ABN 61773362390 Email: ja...@nv... Web site: http://www.nvaccess.org/ _______________________________________________ NVDA-dev mailing list NVD...@li... http://lists.nvaccess.org/listinfo/nvda-dev |
|
From: <nsc...@us...> - 2011-03-05 09:12:35
|
Revision: 207
http://latex-access.svn.sourceforge.net/latex-access/?rev=207&view=rev
Author: nschmidt19
Date: 2011-03-05 09:12:28 +0000 (Sat, 05 Mar 2011)
Log Message:
-----------
Made several changes to nvda/latex_access.py, they are outlined below:
* I should have noticed this, but GetLine () didn't return the current line, it only retrieved it. This has been fixed, and low and behold, speech translation now works! I haven't used BrailleLine() though for various reasons I have explained before. Speech is also very chatty, repeating things twice which will need to be fixed.
* global variables are now declared in the instance of the GlobalPlugin class, not at module level. I may go back to using global variables however because although it isn't normally the done thing, it's easier to write.
* "useful functions" are now methods.
* calling initialize() was wrong, so we are now using a constructor which initialises latex_access, and calls the super class method as well.
Modified Paths:
--------------
nvda/latex_access.py
Modified: nvda/latex_access.py
===================================================================
--- nvda/latex_access.py 2011-03-05 03:42:03 UTC (rev 206)
+++ nvda/latex_access.py 2011-03-05 09:12:28 UTC (rev 207)
@@ -22,7 +22,6 @@
* The preprocessor (support for custom defined LaTeX commands): not completed."""
from comtypes.client import CreateObject
-from textInfos import offsets
import api
import braille, speech# for brailling/speaking messages in NVDA
@@ -32,80 +31,76 @@
### Global variables:
### I know this is probably not the best way to do this, but I wasn't sure exactly how to successfully do it another way and keep the values of the variables
### the same throughout classes and other functions.
-initialised = False
-processMaths = False
-latex_access = None
-currentLine = None
-matrix = None
-row = None
-column = None
### End of global variable declarations
class GlobalPlugin (globalPluginHandler.GlobalPlugin):
"""main class for the global plugin, in which all key bindings/scripts and NVDA events are handled."""
+ initialised = False
+ processMaths = False
+ latex_access = None
+ currentLine = None
+ matrix = None
+ row = None
+ column = None
- def event_caret (self, obj, nextHandler):
- """This event is called when the system caret moves, and it is being overidden so that latex-access speech translation can be used if the user wishes."""
+ def __init__ (self):
+ """Constructor. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later."""
- global currentLine, initialised, latex_access, processMaths
+ super (GlobalPlugin, self).__init__ ()
- if not initialised:
- self.initialize ()
+ if not GlobalPlugin.initialised:# is the latex_access com object created yet?
+ GlobalPlugin.latex_access = CreateObject ("latex_access")
+ GlobalPlugin.initialised = True
- if processMaths:
- currentLine = GetLine ()
- if not currentLine:# Is it a blank line?
- currentLine = _("blank")
+ def event_caret (self, obj, nextHandler):
+ """This event is called when the system caret moves, and it is being overidden so that latex-access speech translation can be used if the user wishes."""
+
+ if GlobalPlugin.processMaths:
+ GlobalPlugin.currentLine = self.GetLine ()
+ if not GlobalPlugin.currentLine:# Is it a blank line?
+ GlobalPlugin.currentLine = _("blank")
else:
- currentLine = latex_access.speech (currentLine)
- speech.speakMessage (currentLine)
+ GlobalPlugin.currentLine = GlobalPlugin.latex_access.speech (GlobalPlugin.currentLine)
+ speech.speakMessage (GlobalPlugin.currentLine)
else:
- SayLine ()
+ self.SayLine ()
nextHandler ()
- def initialize (self):
- """An overide of the initialize() function in globalPluginHandler.py. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later."""
- global initialised, latex_access
- if not initialised:# is the latex_access com object created yet?
- latex_access = CreateObject ("latex_access")
- initialised = True
-
def script_toggleMaths (self, Gesture):
"""A script to toggle the latex-access translation on or off.
@param gesture: the gesture to be past through to NVDA (in this case, a keypress).
@type gesture: keypress.
"""
- global processMaths
-
- if processMaths:# is translation on?
- processMaths = False
+ if GlobalPlugin.processMaths:# is translation on?
+ GlobalPlugin.processMaths = False
speech.speakMessage (_("Maths to be read as plain latex"))
else:
- processMaths = True
+ GlobalPlugin.processMaths = True
speech.speakMessage (_("Maths to be processed to a more verbal form"))
script_toggleMaths.__doc__ = _("Toggles the speaking of mathematical expressions as either straight latex or a more verbal rendering.")
- # For the key bindings:
- __gestures = {
- "kb:control+M": "toggleMaths",
- }
+# Useful methods:
-# Useful functions:
+ def GetLine (self):
+ """Retrieves the line of text that the current navigator object is focussed on, then returns it."""
+ info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET)
+ info.expand(textInfos.UNIT_LINE)
+ currentLine = info.text
+ return currentLine
-def GetLine ():
- """Retrieves the line of text that the current navigator object is focussed on."""
- info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET)
- info.expand(textInfos.UNIT_LINE)
- currentLine = info.text
+ def SayLine (self):
+ """This function says the current line without any translation. This is necessary so that we can return to NVDA's default behaviour when LaTeX translation is toggled off."""
+ speech.speakMessage (self.GetLine())
-def SayLine ():
- """This function says the current line without any translation. This is necessary so that we can return to NVDA's default behaviour when LaTeX translation is toggled off."""
- speech.speakMessage (GetLine())
+ def BrailleLine (self):
+ """Brailles the current line. This again is necessary so that we can return to NVDA's default behaviour."""
+ braille.handler.message (self.GetLine())
-def BrailleLine ():
- """Brailles the current line. This again is necessary so that we can return to NVDA's default behaviour."""
- braille.handler.message (GetLine())
\ No newline at end of file
+ # For the key bindings:
+ __gestures = {
+ "kb:control+M": "toggleMaths",
+ }
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nsc...@us...> - 2011-03-05 03:42:10
|
Revision: 206
http://latex-access.svn.sourceforge.net/latex-access/?rev=206&view=rev
Author: nschmidt19
Date: 2011-03-05 03:42:03 +0000 (Sat, 05 Mar 2011)
Log Message:
-----------
Removed lines of code in nvda/latex_access.py relating to OffsetsTextInfo, because they were not solving the error found in bugs.txt which I also updated. Fixed a minor typo in latex_access_com.py.
Modified Paths:
--------------
latex_access_com.py
nvda/bugs.txt
nvda/latex_access.py
Modified: latex_access_com.py
===================================================================
--- latex_access_com.py 2011-03-04 15:13:03 UTC (rev 205)
+++ latex_access_com.py 2011-03-05 03:42:03 UTC (rev 206)
@@ -32,7 +32,7 @@
return self.nemeth_translator.remove_dollars
def toggle_dollars_speech(self):
- '''Toggles whether dollars are spken
+ '''Toggles whether dollars are spoken
Returns a boolian of whether dollars are being removed.'''
self.speech_translator.remove_dollars=not self.speech_translator.remove_dollars
Modified: nvda/bugs.txt
===================================================================
--- nvda/bugs.txt 2011-03-04 15:13:03 UTC (rev 205)
+++ nvda/bugs.txt 2011-03-05 03:42:03 UTC (rev 206)
@@ -2,3 +2,28 @@
for NVDA. Feel free to add more as they arise, and remove ones that are
fixed.
+ * Event errors: This bug could be to do with the plugin
+(although I doubt it), textInfos or eventHandler.
+the log is pasted below:
+ERROR - eventHandler.executeEvent (13:14:18):
+error executing event: caret on <NVDAObjects.IAccessible.IAccessible object at 0x055A3590> with extra args of {}
+Traceback (most recent call last):
+ File "C:\bzrInit\nvda\main\source\eventHandler.py", line 135, in executeEvent
+ _EventExecuter(eventName,obj,kwargs)
+ File "C:\bzrInit\nvda\main\source\eventHandler.py", line 84, in __init__
+ self.next()
+ File "C:\bzrInit\nvda\main\source\eventHandler.py", line 90, in next
+ return func(*args, **self.kwargs)
+ File ".\userConfig\globalPlugins\latex_access.py", line 65, in event_caret
+ SayLine ()
+ File ".\userConfig\globalPlugins\latex_access.py", line 108, in SayLine
+ speech.speakMessage (GetLine())
+ File ".\userConfig\globalPlugins\latex_access.py", line 102, in GetLine
+ info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET)
+ File "C:\bzrInit\nvda\main\source\NVDAObjects\__init__.py", line 852, in makeTextInfo
+ return self.TextInfo(self,position)
+ File "C:\bzrInit\nvda\main\source\textInfos\offsets.py", line 245, in __init__
+ self._startOffset=self._endOffset=self._getCaretOffset()
+ File "C:\bzrInit\nvda\main\source\textInfos\offsets.py", line 155, in _getCaretOffset
+ raise NotImplementedError
+NotImplementedError
\ No newline at end of file
Modified: nvda/latex_access.py
===================================================================
--- nvda/latex_access.py 2011-03-04 15:13:03 UTC (rev 205)
+++ nvda/latex_access.py 2011-03-05 03:42:03 UTC (rev 206)
@@ -22,6 +22,7 @@
* The preprocessor (support for custom defined LaTeX commands): not completed."""
from comtypes.client import CreateObject
+from textInfos import offsets
import api
import braille, speech# for brailling/speaking messages in NVDA
@@ -43,7 +44,7 @@
class GlobalPlugin (globalPluginHandler.GlobalPlugin):
"""main class for the global plugin, in which all key bindings/scripts and NVDA events are handled."""
- def event_caret (self, obj, kwargs):
+ def event_caret (self, obj, nextHandler):
"""This event is called when the system caret moves, and it is being overidden so that latex-access speech translation can be used if the user wishes."""
global currentLine, initialised, latex_access, processMaths
@@ -57,11 +58,13 @@
currentLine = _("blank")
else:
currentLine = latex_access.speech (currentLine)
- speech.speakMessage (currentLine)
+ speech.speakMessage (currentLine)
else:
SayLine ()
+ nextHandler ()
+
def initialize (self):
"""An overide of the initialize() function in globalPluginHandler.py. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later."""
global initialised, latex_access
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ala...@us...> - 2011-03-04 15:13:09
|
Revision: 205
http://latex-access.svn.sourceforge.net/latex-access/?rev=205&view=rev
Author: alastair-irving
Date: 2011-03-04 15:13:03 +0000 (Fri, 04 Mar 2011)
Log Message:
-----------
Made the Com object run in its own process, so that we can import it into NVDA.
Modified Paths:
--------------
latex_access_com.py
Modified: latex_access_com.py
===================================================================
--- latex_access_com.py 2011-03-01 22:31:37 UTC (rev 204)
+++ latex_access_com.py 2011-03-04 15:13:03 UTC (rev 205)
@@ -58,4 +58,5 @@
if __name__=='__main__':
import pythoncom,win32com.server.register
latex_access_com._reg_clsid_=pythoncom.CreateGuid()
+ latex_access_com._reg_clsctx_=pythoncom.CLSCTX_LOCAL_SERVER
win32com.server.register.UseCommandLine(latex_access_com)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Alastair I. <ala...@sj...> - 2011-03-04 14:59:03
|
see below message from the NVDA-dev list. I'll try and modify the Com
object so it runs in its own process.
-------- Original Message --------
Subject: Re: [NVDA-dev] Problem communicating with Com Object written
with pywin32
Date: Thu, 3 Mar 2011 21:14:59 +0000
From: James Teh <ja...@nv...>
Reply-To: NVDA screen reader development <nvd...@li...>
To: NVDA screen reader development <nvd...@li...>
On 4/03/2011 3:45 AM, Alastair Irving wrote:
> Unfortunately when I try and connect to my object I get an error, wich I
> will copy below. If I launch a stand-alone python shell on my machine
> then I can connect to the object with the above code with no problems.
> My object is written in Python using the pywin32 module and I am running
> it from source.
> >>> o=CreateObject("pointless_object")
> pythoncom error: PythonCOM Server - The 'win32com.server.policy' module
> could not be loaded.
> ImportError: No module named win32com.server.policy
> pythoncom error: CPyFactory::CreateInstance failed to create instance.
> (80004005)
Wow. This is fascinatingly nasty.
The problem is that you've created an in-proc COM server in Python,
which means it gets loaded into the client process. Unfortunately, NVDA
is also written in Python. What's happening is that your COM server
wants to use Python as well, but since the Python interpreter is already
running in NVDA's process, it just uses that interpreter. Unfortunately,
NVDA's isolated environment of Python doesn't contain the
win32com.server package (nor should it), so when your COM server tries
to import it, it fails.
The key issue here is that if there's an interpreter already loaded in
the process, it seems to be used. It is possible to have multiple Python
interpreters in the same process, but this can be tricky and obviously
pythoncom isn't doing this. (Even if it did, there are issues with doing
this; e.g. you can't load multiple instances of the same C extension
module, though I'm not sure about multiple versions of the same C
extension module.) In any case, I don't know of a solution to this that
you can implement yourself.
Btw, the reason this works when you run a command line interpreter is
that this interpreter has access to all of the required modules, so
there's no problem.
One possible solution is for you to make this an exe/out-proc COM
server. This way, your COM server will get loaded in its own process,
which means it will be isolated from NVDA and will therefore use its own
Python interpreter. i can't remember how to do this with pythoncom, but
it's definitely possible.
Jamie
--
James Teh
Vice President, Developer
NV Access Inc, ABN 61773362390
Email: ja...@nv...
Web site: http://www.nvaccess.org/
_______________________________________________
NVDA-dev mailing list
NVD...@li...
http://lists.nvaccess.org/listinfo/nvda-dev
|
|
From: <ala...@us...> - 2011-03-01 22:31:43
|
Revision: 204
http://latex-access.svn.sourceforge.net/latex-access/?rev=204&view=rev
Author: alastair-irving
Date: 2011-03-01 22:31:37 +0000 (Tue, 01 Mar 2011)
Log Message:
-----------
Fixed the com object so that the clsid is actually generated properly rather than using the static one that was there. I thought it was already doing this but there was a missing _. Can't believe this bug has gone unnoticed for nearly 5 years.
Modified Paths:
--------------
latex_access_com.py
Modified: latex_access_com.py
===================================================================
--- latex_access_com.py 2011-02-24 16:24:59 UTC (rev 203)
+++ latex_access_com.py 2011-03-01 22:31:37 UTC (rev 204)
@@ -12,7 +12,6 @@
self.speech_translator=speech.speech()
self.preprocessor=preprocessor.preprocessor()
self.newcommands=preprocessor.newcommands(self.preprocessor)
- _reg_clsid_ = "{436BC4EC-405C-49ED-A0E7-84945B0BAC03}"
_reg_progid_ = "latex_access"
_public_methods_ =["nemeth","speech","preprocessor_add","preprocessor_from_string","preprocessor_write","preprocessor_read","toggle_dollars_nemeth","toggle_dollars_speech"]
def nemeth(self, input):
@@ -58,5 +57,5 @@
#Register the object
if __name__=='__main__':
import pythoncom,win32com.server.register
- latex_access_com._reg_clsid=pythoncom.CreateGuid()
+ latex_access_com._reg_clsid_=pythoncom.CreateGuid()
win32com.server.register.UseCommandLine(latex_access_com)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Alastair I. <ala...@sj...> - 2011-02-28 13:01:02
|
Hi All, (particularly Nathaniel)
I've just been trying, without success, to get the NVDA support to work.
It would appear that there are two, probably unrelated, problems.
1. If I run NVDA 2011-RC1, which I have installed on my system, then I
get the error I told Nathaniel about some time ago, namely:
PythonCOM Server - The 'win32com.server.policy' module could not be loaded.
ImportError: No module named win32com.server.policy
Note that I can reproduce this simply by loading a Python console inside
NVDA and doing
from comtypes.client import CreateObject
CreateObject("latex_access")
2. I've now set up NVDA to run from source. Then, doing the same in the
python console gives me the error that Nathaniel told me about:
ERROR: server.policy could not create an instance.
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\win32com\server\policy.py", line
136, in CreateInstance
return retObj._CreateInstance_(clsid, reqIID)
File "C:\Python27\lib\site-packages\win32com\server\policy.py", line
194, in _CreateInstance_
myob = call_func(classSpec)
File "C:\Python27\lib\site-packages\win32com\server\policy.py", line
727, in call_func
return resolve_func(spec)(*args)
File "C:\latex-access\latex_access_com.py", line 12, in __init__
self.speech_translator=speech.speech()
AttributeError: 'module' object has no attribute 'speech'
I have discovered that in case 1 if I try and create a
latex_access_matrix object instead I get the same error, but in case 2
I can successfully create a matrix. I wonder if the problem in case 1
is with NVDA, namely that when it is compiled to a binary some modules
are not included. case 2 is slightly strange because I can run the code
from a normal python console without error, so it is something in NVDA
causing it. I wonder if somehow we're getting a collision between the
latex-access speech module and the NVDA speech module. If I have time
later I might try and rename speech to something else and see what happens.
Nathaniel, how do these errors correspond to your current experience of
the pluggin? Are you running from source or an installed binary? Have
you ever actually had it working?
best wishes
Alastair
|
|
From: <ala...@us...> - 2011-02-24 16:25:05
|
Revision: 203
http://latex-access.svn.sourceforge.net/latex-access/?rev=203&view=rev
Author: alastair-irving
Date: 2011-02-24 16:24:59 +0000 (Thu, 24 Feb 2011)
Log Message:
-----------
Unfortunately Jose's work on the jaws scripts wasn't based on the latest revision, hopefully I've now merged everything back in.
Modified Paths:
--------------
jaws/latex.jsb
jaws/latex.jsm
jaws/latex.jss
jaws/latex.smf
Modified: jaws/latex.jsb
===================================================================
(Binary files differ)
Modified: jaws/latex.jsm
===================================================================
--- jaws/latex.jsm 2011-02-22 19:15:26 UTC (rev 202)
+++ jaws/latex.jsm 2011-02-24 16:24:59 UTC (rev 203)
@@ -27,13 +27,13 @@
messages
@msgProcessingOn_S
-Processing of LaTeX is now on.
+Processing on
@@
@msgProcessingOn_L
Maths to be processed to a more verbal form
@@
@msgProcessingOff_S
-Processing of LaTeX is now off.
+Processing off
@@
@msgProcessingOff_L
maths to be read as plain latex
Modified: jaws/latex.jss
===================================================================
--- jaws/latex.jss 2011-02-22 19:15:26 UTC (rev 202)
+++ jaws/latex.jss 2011-02-24 16:24:59 UTC (rev 203)
@@ -50,6 +50,8 @@
let input = StringReplaceSubstrings (input, "</sub>", smmGetEndMarkupForAttributes (attrib_subscript|attrib_text))
let input = StringReplaceSubstrings (input, "<bold>", smmGetStartMarkupForAttributes (attrib_bold|attrib_text))
let input = StringReplaceSubstrings (input, "</bold>", smmGetEndMarkupForAttributes (attrib_bold|attrib_text))
+let input=StringReplaceSubstrings (input, "<mathcal>", smmGetStartMarkupForAttributes (attrib_italic|attrib_text))
+let input=StringReplaceSubstrings (input, "</mathcal>", smmGetEndMarkupForAttributes (attrib_italic|attrib_text))
endif
Say (input, ot_selected_item, true)
else
@@ -76,9 +78,9 @@
EndScript
Script ToggleDollarsNemeth ()
-var bool result
+var int result
let result=latex_access.toggle_dollars_nemeth()
-if result then
+if result==-1 then
; JT: Message to be placed in the JSM file for better manageability. - Done.
SayMessage (ot_status, msgNemethDollarsOff_L, msgNemethDollarsOff_S)
else
@@ -90,10 +92,10 @@
Script ToggleDollarsSpeech ()
-var bool result
+var int result
let result=latex_access.toggle_dollars_speech()
; JT: Two more messages that must be placed in the latex.jsm file.
-if result then
+if result==-1 then
SayMessage (ot_status, msgSpeechDollarsOff_L, msgSpeechDollarsOff_S)
else
SayMessage (ot_status, msgSpeechDollarsOn_L, msgSpeechDollarsOn_S)
Modified: jaws/latex.smf
===================================================================
--- jaws/latex.smf 2011-02-22 19:15:26 UTC (rev 202)
+++ jaws/latex.smf 2011-02-24 16:24:59 UTC (rev 203)
@@ -1,10 +1,10 @@
[Attribute Behavior Table]
default=0|MessageVoice|||
-00000011=3|||BoldVoice|
3=3|||BoldVoice|
1025=3|||SuperscriptVoice|
2049=3|||SubscriptVoice|
4097=3|||SubscriptVoice|
+5=3|||ItalicVoice|
[Indentation Behavior Table]
default=1|MessageVoice|||
[HTML Attribute Behavior Table]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ala...@us...> - 2011-02-22 19:15:33
|
Revision: 202
http://latex-access.svn.sourceforge.net/latex-access/?rev=202&view=rev
Author: alastair-irving
Date: 2011-02-22 19:15:26 +0000 (Tue, 22 Feb 2011)
Log Message:
-----------
Added Jose Tamayo's changes to the JFW scripts to make them more standards compliant.
Modified Paths:
--------------
jaws/latex.jkm
jaws/latex.jsb
jaws/latex.jsd
jaws/latex.jss
jaws/latex.smf
Added Paths:
-----------
jaws/latex.jsm
Modified: jaws/latex.jkm
===================================================================
--- jaws/latex.jkm 2011-02-11 09:47:12 UTC (rev 201)
+++ jaws/latex.jkm 2011-02-22 19:15:26 UTC (rev 202)
@@ -29,3 +29,4 @@
Control+Shift+A=preprocessorAdd
Control+Shift+W=PreprocessorWrite
Control+Shift+H=PreprocessorFromString
+JAWSKey+L=HotKeyHelp
Modified: jaws/latex.jsb
===================================================================
(Binary files differ)
Modified: jaws/latex.jsd
===================================================================
--- jaws/latex.jsd 2011-02-11 09:47:12 UTC (rev 201)
+++ jaws/latex.jsd 2011-02-22 19:15:26 UTC (rev 202)
@@ -18,6 +18,8 @@
:script InputMatrix
:Synopsis Highlight a matrix and then run this script to have it created as an object.
+:script HotKeyHelp
+
:script MatrixRight
:Synopsis Moves the matrix cursor to the right and speaks the new cell.
Added: jaws/latex.jsm
===================================================================
--- jaws/latex.jsm (rev 0)
+++ jaws/latex.jsm 2011-02-22 19:15:26 UTC (rev 202)
@@ -0,0 +1,113 @@
+; Created by Jose Tamayo on 2/25/2010
+; this will allow for latex-access to load the messages and vars correctly.
+
+
+const
+o_latexAccess = "latex_access",
+o_latex_access_matrix = "latex_access_matrix",
+; input variable literals
+sScrollDownSymbols = "scroll down symbol",
+sPadBy = " by ",
+sPadMatrix = " matrix ",
+sEndRow = "end row",
+sStartRow = "start row",
+sEndColumn = "end column",
+sStartColumn = "start column",
+sInvalidRow = "Invalid Row",
+sInvalidColumn = "invalid column",
+sCommandToReDefine = "Enter the command you wish to re-define.",
+sEnterCommandArguments = "Enter the number of arguments of the command.",
+sEnterCustomCommandDef = "Enter the definition of the custom command, that is, the standard LaTeX to which it is equivalent.",
+sEnterFileToSaveTo = "enter full filename to save to",
+sFileExistError = "The file you specified already exists. Do you wish to replace it?",
+sFileExistTitle = "File Exists",
+sFileNoExist = "File does not exist",
+;keystrokes
+ks1 = "control+shift+d" ;open default file
+
+messages
+@msgProcessingOn_S
+Processing of LaTeX is now on.
+@@
+@msgProcessingOn_L
+Maths to be processed to a more verbal form
+@@
+@msgProcessingOff_S
+Processing of LaTeX is now off.
+@@
+@msgProcessingOff_L
+maths to be read as plain latex
+@@
+@msgNemethDollarsOff_S
+Nemeth Dollars off
+@@
+@msgNemethDollarsOff_L
+Dollars will now be ignored in nemeth
+@@
+@msgNemethDollarsOn_S
+Nemeth Dollars on
+@@
+@msgNemethDollarsOn_L
+Dollars will now be shown in nemeth
+@@
+
+@msgSpeechDollarsOff_S
+Speech Dollars off
+@@
+@msgSpeechDollarsOff_L
+Dollars will now be ignored in speech
+@@
+@msgSpeechDollarsOn_S
+Speech Dollars on
+@@
+@msgSpeechDollarsOn_L
+Dollars will now be shown in Speech
+@@
+
+
+; JT HERE
+; Hot key help for latex-access
+@msgHotKeyHelp
+Welcome to the LaTeX Access Tools for JAWS.
+
+NOTE: There is currently no means of independently toggling of speech and braille.
+
+Press %KeyFor(ToggleMaths ) to toggle processing of LaTeX on and off
+Press %KeyFor(ToggleDollarsNemeth ) To toggle Nemeth dollars on or off
+Press %KeyFor(ToggleDollarsSpeech ) To toggle Speech dollars on or off
+Press %KeyFor(InputMatrix ) to create a custom matrix entry (see preprocessor section)
+
+the Preprocessor
+LaTeX enables you to define custom commands. The scripts can handle
+this but they must be told what the custom commands are. This is done
+by means of the preprocessor.
+
+Press %KeyFor(preprocessorAdd ) to add a preprocessor command
+
+In the first textbox, enter the custom command, in the next enter the number of arguments, 0 if there
+are none, and in the 3rd box enter the translation of the custom
+command. The translation is the standard LaTeX equivalent of the
+command, using #n to denote places where the nth argument should be
+interpolated into the translation. The 3 textboxes correspond to the
+3 arguments to the \newcommand command used to define the custom
+command.
+
+Preprocessor commands are lost when JAWS is restarted. You may load multiple preprocessor files.
+Press %KeyFor(PreprocessorWrite ) to save the custom preprocessor commands to a file.
+Press %KeyFor(PreprocessorRead ) to retreive custom preprocessor commands previously saved
+
+The Matrix Processor
+To load a matrix into the processor, highlight its contents, (not
+including any \begin and \end commands), and press %KeyFor(InputMatrix ) . For
+example you might highlight the following:
+
+CTRL+SHIFT+j, K, L, or I act as arrows that navigate the matrix
+CTRL+SHIFT with a number reads that row
+cTRL+ALT with anumber reads that column.
+
+Press %KeyFor(HotKeyHelp ) to redisplay this message
+
+Press ESC to close this message
+@@
+
+EndMessages
Modified: jaws/latex.jss
===================================================================
--- jaws/latex.jss 2011-02-11 09:47:12 UTC (rev 201)
+++ jaws/latex.jss 2011-02-22 19:15:26 UTC (rev 202)
@@ -1,6 +1,23 @@
+; latex-access scripts by Alastair Irving ( ala...@ho...)
+;
+; Documentation by: Jose Tamayo( jt...@ho...)
+;
+; history of changes
+;
+; Needs:
+; 1. JSM file for messages
+; 2. proper variable naming
+; 3. intro for functions.
+; 4. Hungarian notation
+; 5. Move all literals and messages to the latex.jsm file.
+
include "hjconst.jsh"
+; to be uncommented later
+ include "latex.jsm"
+
+; JT: what is the purpose of initialised variable?
globals int initialised,
int ProcessMaths,
object latex_access,
@@ -11,17 +28,20 @@
Void Function AutoStartEvent ()
if !initialised then
-let latex_access=CreateObject ("latex_access")
+
+; JT: consider creating a constant for the latex_access object and then reference the constant instead. - done 2/25/2010
+let latex_access=CreateObject (o_latexAccess)
let initialised=true
endif
EndFunction
Void Function SayLine ()
if ProcessMaths then
+; JT: what is the variable input for?
var string input
let input = GetLine ()
-if stringisblank(input) then
+if StringIsBlank(input) then
let input = "blank"
else
let input = latex_access.speech(input)
@@ -30,8 +50,6 @@
let input = StringReplaceSubstrings (input, "</sub>", smmGetEndMarkupForAttributes (attrib_subscript|attrib_text))
let input = StringReplaceSubstrings (input, "<bold>", smmGetStartMarkupForAttributes (attrib_bold|attrib_text))
let input = StringReplaceSubstrings (input, "</bold>", smmGetEndMarkupForAttributes (attrib_bold|attrib_text))
-let input=StringReplaceSubstrings (input, "<mathcal>", smmGetStartMarkupForAttributes (attrib_italic|attrib_text))
-let input=StringReplaceSubstrings (input, "</mathcal>", smmGetEndMarkupForAttributes (attrib_italic|attrib_text))
endif
Say (input, ot_selected_item, true)
else
@@ -46,34 +64,39 @@
Script ToggleMaths ()
if ProcessMaths then
let ProcessMaths = false
-SayMessage (ot_status, "maths to be read as plain latex", "Processing off")
+; JT : the following text content must be placed in a JSM file for consistency. - Done.
+SayMessage (ot_status, msgProcessingOff_L, msgProcessingOff_S)
else
let ProcessMaths = true
-SayMessage(OT_STATUS,"Maths to be processed to a more verbal form","Processing on")
+; JT: The string literal must also be placed in the latex.jsm file for better manageability.
+SayMessage(OT_STATUS,msgProcessingOn_L,msgProcessingOn_S)
endif
EndScript
Script ToggleDollarsNemeth ()
-var int result
+var bool result
let result=latex_access.toggle_dollars_nemeth()
-if result==-1 then
-SayMessage (ot_status, "Dollars will now be ignored in nemeth", "nemeth dollars off")
+if result then
+; JT: Message to be placed in the JSM file for better manageability. - Done.
+SayMessage (ot_status, msgNemethDollarsOff_L, msgNemethDollarsOff_S)
else
-SayMessage (ot_status, "Dollars will now be shown in nemeth", "nemeth dollars on")
+; JT : This is another message that must be placed in the latex.jsm file - Done.
+SayMessage (ot_status, msgNemethDollarsOn_L, msgNemethDollarsOn_S)
endif
EndScript
Script ToggleDollarsSpeech ()
-var int result
+var bool result
let result=latex_access.toggle_dollars_speech()
-if result==-1 then
-SayMessage (ot_status, "Dollars will now be ignored in speech", "speech dollars off")
+; JT: Two more messages that must be placed in the latex.jsm file.
+if result then
+SayMessage (ot_status, msgSpeechDollarsOff_L, msgSpeechDollarsOff_S)
else
-SayMessage (ot_status, "Dollars will now be shown in speech", "speech dollars on")
+SayMessage (ot_status, msgSpeechDollarsOn_L, msgSpeechDollarsOn_S)
endif
EndScript
@@ -85,7 +108,7 @@
if ProcessMaths then
var string input
let input = GetLine()
-let input = StringReplaceSubstrings (input, "scroll down symbol", "")
+let input = StringReplaceSubstrings (input, sScrollDownSymbols , "")
let input=StringTrimTrailingBlanks (input)
let input = latex_access.nemeth(input)
; now sort out bad dots 456
@@ -100,26 +123,42 @@
Script InputMatrix ()
-let matrix=CreateObject ("latex_access_matrix")
+; JT: Place the object in a constant so that it can be more manageable
+let matrix=CreateObject (o_latex_access_matrix)
let row=1
let column=1
matrix.tex_init(GetSelectedText ())
+; JT: Replace the msg var with a message variable in the latex.jsm file
var string msg
let msg ="Initialised "
let msg=msg+inttostring(matrix.rows)
-let msg=msg+" by "
+; JT: another literal that must be replaced. - Done February 21, 2011
+let msg=msg+sPadBy
let msg=msg+inttostring(matrix.columns)
-let msg=msg +" matrix"
-saystring(msg)
+; JT: another literal to be placed in latex.jsm - Done February 21, 2011
+let msg=msg +sPadMatrix
+SayString(msg)
EndScript
+Script HotKeyHelp ()
+; check the virtual buffer and close it if active.
+If UserBufferIsActive () Then
+ UserBufferDeactivate ()
+EndIf
+; Display the help text when the user presses JAWSKey+L
+SayFormattedMessage(OT_USER_BUFFER, msgHotKeyHelp)
+
+EndScript
+
+
Script MatrixRight ()
if column < matrix.columns then
let column = column+1
saystring(matrix.get_cell(row,column))
else
-saystring("end row")
+; JT: another literal to be placed in the latex.jsm file. - Done February 21, 2011
+saystring(sEndRow)
endif
EndScript
@@ -129,7 +168,8 @@
let column = column - 1
saystring(matrix.get_cell(row,column))
else
-saystring("start row")
+; JT: Another literal to be placed in latex.jsm
+saystring(sStartRow)
endif
EndScript
@@ -139,7 +179,8 @@
let row = row+1
saystring(matrix.get_cell(row,column))
else
-saystring("end column")
+; JT: another literal to add to latex.jsm
+saystring(sEndColumn)
endif
EndScript
@@ -149,25 +190,28 @@
let row = row - 1
saystring(matrix.get_cell(row,column))
else
-saystring("start columnd")
+; JT: another latex.jsm literal to be added. - done February 21, 2011
+SayString(sStartColumn)
endif
EndScript
-
+; JT: This variable named i must be changed
Script SayRow (int i)
if i>0 && i <= matrix.rows then
saystring(matrix.get_row(i," "))
else
-saystring("Invalid row")
+; another literal to be moved to latex.jsm - done February 21, 2011
+saystring(sInvalidRow)
endif
EndScript
-
+; JT: Find out what i is for and replace if needed.
Script SayColumn (int i)
if i>0 && i <=matrix.columns then
saystring(matrix.get_col(i," "))
else
-saystring("Invalid column")
+; JT: literal that must be moved to the latex.jsm file
+saystring(sInvalidColumn)
endif
EndScript
@@ -175,9 +219,10 @@
Script preprocessorAdd ()
var string input, int args, string strargs, string translation
-if InputBox ("Enter the command you wish to re-define.", "Initial LaTeX", input) then
-if InputBox ("Enter the number of arguments of the command.", "Number of arguments", strargs) then
-if InputBox ("Enter the definition of the custom command, that is, the standard LaTeX to which it is equivalent.", "Translation", translation) then
+; JT: Move this literal to the latex.jsm file.
+if InputBox (sCommandToRedefine, "Initial LaTeX", input) then
+if InputBox (sEnterCommandArguments, "Number of arguments", strargs) then
+if InputBox (sEnterCustomCommandDef, "Translation", translation) then
let args=StringToInt (strargs)
latex_access.preprocessor_add(input,args,translation)
endif
@@ -196,10 +241,12 @@
Script PreprocessorWrite ()
var string filename
-if InputBox ("enter full filename to save to", "Filename", filename) then
+; JT: another prompt to be moved to latex.jsm - done February 21, 2011
+if InputBox (sEnterFileToSaveTo , "Filename", filename) then
if FileExists (filename) then
var int result
-let result=ExMessageBox ("The file you specified already exists. Do you wish to replace it?", "File Exists", MB_YESNO)
+; JT: literal string to be moved to latex.jsm - done February 21, 2011
+let result=ExMessageBox (sFileExistError , sFileExistTitle , MB_YESNO)
if result==IDNO then
return
endif
@@ -211,11 +258,13 @@
Script PreprocessorRead ()
var string filename
+; JT: another literal to move to the latex.jsm file.
if InputBox ("enter full filename to read from ", "Filename", filename) then
if FileExists (filename) then
latex_access.preprocessor_read(filename)
else
-MessageBox ("File does not exist")
+; JT: move this literal to the latex.jsm file too.
+MessageBox (sFileNoExist )
endif
endif
EndScript
Modified: jaws/latex.smf
===================================================================
--- jaws/latex.smf 2011-02-11 09:47:12 UTC (rev 201)
+++ jaws/latex.smf 2011-02-22 19:15:26 UTC (rev 202)
@@ -1,10 +1,10 @@
[Attribute Behavior Table]
default=0|MessageVoice|||
+00000011=3|||BoldVoice|
3=3|||BoldVoice|
1025=3|||SuperscriptVoice|
2049=3|||SubscriptVoice|
4097=3|||SubscriptVoice|
-5=3|||ItalicVoice|
[Indentation Behavior Table]
default=1|MessageVoice|||
[HTML Attribute Behavior Table]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Daniel D. <dan...@gm...> - 2011-02-11 10:06:39
|
I've committed some stuff over the last few days which finally has
allowed me to implement my idea under emacs. Please do test by running
m-x latex-access-table-location from anywhere within a table below the
top row (because the top row is used for the headings).
Not much has changed since my last proposal to the list which is
good. The only thing is that I suggested a static list of headers, and
these would need to be updated when the headings were changed. This is
no longer the case, and the user doesn't need to worry about this at
all!
The way it works:
* From anywhere within a table call the function.
1. Emacs collects all the table information between the point (cursor)
and the end of the \begin line.
2. This data is passed through to the python functions.
3. The table is split into headings in list form and a string containing
just the current row.
4. The heading associated with the cell is spoken.
* The user hears the heading they are working under, and may resume
working (cursor is left at the point where it was when the
table-location function was called).
* So just type m-x latex-access-table-location and everything should
work as described!
If people like this it might be worth implementing into Jaws/nvda.
It's not hard all you need to do is get text between the end of the
\begin{tabular} line and the cursor, and pass it to the right
functions. See the table.py file for instructions... Oh and don't forget
to save/restore state of cursor.
TODO:
+ We could speak cell coordinates if desired...?
+ Speak first cell of row, sometimes this is important.
+ Find a regexp to find the \begin{tabular} line of table as so many
variations exist (supertabular, tabularx etc.) Can anyone assist here?
+ Somehow determine we are not in table and tell the user this, maybe if
search fails. Even if it does succeed doesn't mean we are in a
table. Eg. we might be below the \end{tabular} line.
+ Anything else you can think of that might be useful!
Anyway I hope people find this useful, I know it'll make physics classes
a lot less stressful now:)
Dan
|
|
From: <dda...@us...> - 2011-02-11 09:47:18
|
Revision: 201
http://latex-access.svn.sourceforge.net/latex-access/?rev=201&view=rev
Author: ddalton10
Date: 2011-02-11 09:47:12 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
* m-x latex-access-table-location now reports column heading in emacs!!!
* Determine whether our row is out side the table eg.
Name & Last name\\
John & Smith & 35 (m-x latex-access-table-location reports outside
table.)
This will help you stay within table boundaries.
* If you run the function from a valid column eg placing your cursor on
the S of Smith, emacspeak will say "Focus is in column Last name.
* We need a regexp to find the \begin{tabular} line, because there are
so many variations -- tabularx, tabular supertabular etc. This would
cause a problem if the user uses another environment inside table such
as itemize, because we just search for "\begin".
* We can't detect if outside table so keep this in mind (will probably
just say first col name in that case or execute except IndexError
exception.
Enjoy
Modified Paths:
--------------
emacs/emacs-latex-access.el
table.py
Modified: emacs/emacs-latex-access.el
===================================================================
--- emacs/emacs-latex-access.el 2011-02-11 08:30:57 UTC (rev 200)
+++ emacs/emacs-latex-access.el 2011-02-11 09:47:12 UTC (rev 201)
@@ -302,10 +302,12 @@
(defun latex-access-table-location ()
"Provide information of current location in table."
(interactive)
- (let ((end (point)) (beg (search-backward "\\begin{tabular")))
- (let ((table (buffer-substring-no-properties beg end)))
- (latex_access_emacsWhereAmI (latex_access_emacsGetTableCurrentRow
- table)
- (latex_access_emacsBuildHeaderString (latex_access_emacsGetTableTopRow table))))))
+ (save-excursion
+ (let ((end (point)) (beg (progn (search-backward "\\begin")
+ (move-end-of-line nil) (point))))
+ (let ((table (buffer-substring-no-properties beg end)))
+ (dtk-speak (latex_access_emacsWhereAmI
+ (latex_access_emacsGetTableCurrentRow table)
+ (latex_access_emacsBuildHeaderString (latex_access_emacsGetTableTopRow table))))))))
;;; emacs-latex-access.el ends here
Modified: table.py
===================================================================
--- table.py 2011-02-11 08:30:57 UTC (rev 200)
+++ table.py 2011-02-11 09:47:12 UTC (rev 201)
@@ -73,7 +73,13 @@
row should be a string object containing the current row, and headers
should be a list of the table headings (as returned by BuildHeaderString..."""
- return "Focus is in column "+headers[row.count("&")] # Count how many columns across we are and return corresponding heading. (by counting col separater &)
+ try:
+ out="focus is in column "+headers[row.count("&")] # Count how many
+# columns across we are and return corresponding heading. (by counting
+# col separater &)
+ except IndexError:
+ out="outside table"
+ return out
def GetTableTopRow (table):
"""Return the first row of a table.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dda...@us...> - 2011-02-11 08:31:03
|
Revision: 200
http://latex-access.svn.sourceforge.net/latex-access/?rev=200&view=rev
Author: ddalton10
Date: 2011-02-11 08:30:57 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
Well, I'm an idiot here is the fix -- forgot to include a call to the
function inside the table module with my return statement. So I was
constantly returning and returning each time I called the functions
latex_access_emacs.GetTable* ...:)
Also simplified so we can use t.function instead of table.function in
the emacs python module.
Modified Paths:
--------------
latex_access_emacs.py
Modified: latex_access_emacs.py
===================================================================
--- latex_access_emacs.py 2011-02-11 08:20:43 UTC (rev 199)
+++ latex_access_emacs.py 2011-02-11 08:30:57 UTC (rev 200)
@@ -20,6 +20,7 @@
s=speech.speech()
p=preprocessor.preprocessor()
nc=preprocessor.newcommands(p)
+t=table
if __name__ == "__main__":
print "This is just a module."
@@ -80,7 +81,7 @@
Consult the documentation in table.py."""
- return table.BuildHeaderString (text)
+ return t.BuildHeaderString (text)
def WhereAmI (row, headers):
"""Access to the WhereAmI function in table.py.
@@ -88,7 +89,7 @@
This exports the WhereAmI function to emacs -- consult documentation
in table.py for more details."""
- return table.WhereAmI (row, headers)
+ return t.WhereAmI (row, headers)
def GetTableTopRow (latextable):
"""Make the GetTopRow function available to emacs for table
@@ -96,7 +97,7 @@
Consult the documentation in table.py for details."""
- return GetTableTopRow (latextable)
+ return t.GetTableTopRow (latextable)
def GetTableCurrentRow (latextable):
"""Get the current row of a table.
@@ -104,4 +105,4 @@
Export this function to emacs so to allow for latex table
accessibility."""
- return GetTableCurrentRow (latextable)
+ return t.GetTableCurrentRow (latextable)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dda...@us...> - 2011-02-11 08:20:49
|
Revision: 199
http://latex-access.svn.sourceforge.net/latex-access/?rev=199&view=rev
Author: ddalton10
Date: 2011-02-11 08:20:43 +0000 (Fri, 11 Feb 2011)
Log Message:
-----------
Describe (document) the table.py functions so that other developers may
implement for other screenreaders.
Update doc strings (improving accuracy mainly)
Add some general comments
Export the functions to emacs python module. Note there still is a
serious issue here which needs to be resolved regarding the GetTable*
functions.
Add emacs front-end to all of this -- don't use until the problem above
has been fixed unless you like lots of python errors flooding your
status line:)
Modified Paths:
--------------
emacs/emacs-latex-access.el
latex_access_emacs.py
table.py
Modified: emacs/emacs-latex-access.el
===================================================================
--- emacs/emacs-latex-access.el 2011-02-10 08:35:52 UTC (rev 198)
+++ emacs/emacs-latex-access.el 2011-02-11 08:20:43 UTC (rev 199)
@@ -299,4 +299,13 @@
(latex-access-speech-on)
(latex-access-braille-on))))
+(defun latex-access-table-location ()
+ "Provide information of current location in table."
+ (interactive)
+ (let ((end (point)) (beg (search-backward "\\begin{tabular")))
+ (let ((table (buffer-substring-no-properties beg end)))
+ (latex_access_emacsWhereAmI (latex_access_emacsGetTableCurrentRow
+ table)
+ (latex_access_emacsBuildHeaderString (latex_access_emacsGetTableTopRow table))))))
+
;;; emacs-latex-access.el ends here
Modified: latex_access_emacs.py
===================================================================
--- latex_access_emacs.py 2011-02-10 08:35:52 UTC (rev 198)
+++ latex_access_emacs.py 2011-02-11 08:20:43 UTC (rev 199)
@@ -10,15 +10,21 @@
"""Silly hack to access translate functions as pymacs was difficult to
interact with classes."""
+import sys
import speech
import nemeth
import preprocessor
+import table
n=nemeth.nemeth()
s=speech.speech()
p=preprocessor.preprocessor()
nc=preprocessor.newcommands(p)
+if __name__ == "__main__":
+ print "This is just a module."
+ exit (-1)
+
def transbrl (arg):
"""Translate latex code into Nemeth Braile.
@@ -67,3 +73,35 @@
def preprocessor_read(filename):
p.read(filename)
+# Export the table.* functions to emacs.
+def BuildHeaderString (text):
+ """Enable access to the BuildHeaderString function for table
+ manipulation.
+
+ Consult the documentation in table.py."""
+
+ return table.BuildHeaderString (text)
+
+def WhereAmI (row, headers):
+ """Access to the WhereAmI function in table.py.
+
+ This exports the WhereAmI function to emacs -- consult documentation
+ in table.py for more details."""
+
+ return table.WhereAmI (row, headers)
+
+def GetTableTopRow (latextable):
+ """Make the GetTopRow function available to emacs for table
+ manipulation.
+
+ Consult the documentation in table.py for details."""
+
+ return GetTableTopRow (latextable)
+
+def GetTableCurrentRow (latextable):
+ """Get the current row of a table.
+
+ Export this function to emacs so to allow for latex table
+ accessibility."""
+
+ return GetTableCurrentRow (latextable)
Modified: table.py
===================================================================
--- table.py 2011-02-10 08:35:52 UTC (rev 198)
+++ table.py 2011-02-11 08:20:43 UTC (rev 199)
@@ -12,6 +12,36 @@
#
# You should have received a copy of the GNU General Public License along with this program; if not, visit <http://www.gnu.org/licenses>
+# How it works -- brief overview to help developers implement for other
+# screenreaders/editors etc.
+# The WhereAmI function is ultimately the one that should be called to
+# do all the work, at the end of the day it returns the nicely formatted
+# string ready to be passed to the speech synthesiser.
+# Inorder to do this, you must supply WhereAmI with a few arguments:
+# WhereAmI(GetTableCurrentRow(table), BuildHeaderString(GetTableTopRow (table)))
+# Is the basic form to call this -- table is just the text of the table
+# you are working with.
+# The boundaries of table should be from the first character of the
+# first cell in table, that is the top row, left hand cell, first char
+# is the point at which the table should begin, and the end of the input
+# passed to this module should be where point resides (hopefully in the
+# table somewhere.
+# Marking from the end of the \begin{tabular} line should be ok as
+# well.
+#
+# It may be wise to do some validation checks before passing table to
+# this module i.e. check cursor is actually inside table, otherwise, I
+# predict (without testing), you'll get out of list index errors thrown
+# from python, or it'll just say your in the last column... Which is not
+# what we want!
+# Enjoy.
+
+"""Latex-access table accessibility.
+
+This module provides a range of functions to grab particular information
+from a LaTeX tabular environment, providing useful information to the
+document author when working with tables."""
+
if __name__ == "__main__":
print "This can only be used as a module, and does nothing when called interactively."
exit (-1)
@@ -21,32 +51,36 @@
These headings will be spoken when queried.
Provide the first row of a table which should represent the column
- headings. This should be of type list or tupple."""
+ headings. This should be of type string(str)."""
- tableheadings = [] # clear last output
+ tableheadings = [] # define an empty list
text = text.replace("\hline", "") # remove any hline, though there
# should only be one at most.
text = text.replace("\n", "") # So we don't miss last col
- text = text.replace("\\\\", "") # put in a new line char at end of
-# row
+ text = text.replace("\\\\", "")
text = text+"&" # Don't miss the last column
while text.find("&") != -1: # column LaTeX separater
tableheadings.append(text[:text.find("&")]) # next remove last col
text = text[text.find("&")+1:] # remove last col and separator
- return tableheadings # return tupple of column headings.
+ return tableheadings # return list of column headings.
+
def WhereAmI (row, headers):
"""Provides information of current location in table.
Currently speak the name of column. In future should speak cell
- coordinates and any other useful info (Perhaps first cell in row)"""
- return "Focus is in column "+headers[row.count("&")]
+ coordinates and any other useful info (Perhaps first cell in row).
+ row should be a string object containing the current row, and headers
+ should be a list of the table headings (as returned by BuildHeaderString..."""
+ return "Focus is in column "+headers[row.count("&")] # Count how many columns across we are and return corresponding heading. (by counting col separater &)
+
def GetTableTopRow (table):
"""Return the first row of a table.
This is useful for separating the row headings from the rest of the
- stuff in the table."""
+ stuff in the table. table should just be an object type str holding
+ the contents of the LaTeX table up until cursor or (point)."""
return table[:table.find("\\\\")]
@@ -54,7 +88,9 @@
"""Return the currently focused row in table.
Find the last \\ char from end of input. Everything between end [-1],
- and the last \\ char is considered the current row."""
+ and the last \\ char is considered the current row. table should be of
+ type str and is the contents of the LaTeX table up until the cursor or
+ (point)."""
return table[table.rfind("\\\\")+1:].replace("\n", "").replace("\\hline",
"")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nsc...@us...> - 2011-02-10 08:35:58
|
Revision: 198
http://latex-access.svn.sourceforge.net/latex-access/?rev=198&view=rev
Author: nschmidt19
Date: 2011-02-10 08:35:52 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
Modified Paths:
--------------
nvda/bugs.txt
Modified: nvda/bugs.txt
===================================================================
--- nvda/bugs.txt 2011-02-10 08:34:46 UTC (rev 197)
+++ nvda/bugs.txt 2011-02-10 08:35:52 UTC (rev 198)
@@ -2,14 +2,3 @@
for NVDA. Feel free to add more as they arise, and remove ones that are
fixed.
- * TypeErrors: NVDA doesn't like the overide of the caret event.
-I am not sure how to fix this yet. The log is pasted below:
-ERROR - eventHandler.executeEvent (17:41:30):
-error executing event: caret on <NVDAObjects.Dynamic_IAccessibleRichEdit50WindowNVDAObject object at 0x072BAEF0> with extra args of {}
-Traceback (most recent call last):
-File "C:\bzrInit\nvda\main\source\eventHandler.py", line 135, in executeEvent
-_EventExecuter(eventName,obj,kwargs)
-File "C:\bzrInit\nvda\main\source\eventHandler.py", line 84, in __init__
-self.next()
-File "C:\bzrInit\nvda\main\source\eventHandler.py", line 90, in next
-return func(*args, **self.kwargs) TypeError: event_caret() takes exactly 1 argument (3 given)
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <nsc...@us...> - 2011-02-10 08:34:52
|
Revision: 197
http://latex-access.svn.sourceforge.net/latex-access/?rev=197&view=rev
Author: nschmidt19
Date: 2011-02-10 08:34:46 +0000 (Thu, 10 Feb 2011)
Log Message:
-----------
Added an extra argument "kwargs" which stops all the type errors occurring. However, even though Translation seems to be able to be toggled on and off, the current line still won't be translated into it's more verbal rendering. I still am at a loss as to what to do about fixing this.
Modified Paths:
--------------
nvda/latex_access.py
Modified: nvda/latex_access.py
===================================================================
--- nvda/latex_access.py 2011-02-09 08:35:41 UTC (rev 196)
+++ nvda/latex_access.py 2011-02-10 08:34:46 UTC (rev 197)
@@ -3,7 +3,9 @@
# Author: Nathaniel Schmidt <nat...@we...>
# Copyright (C) 2011 Nathaniel Schmidt/latex-access Contributors
#
-# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
+# This program is free software; you can redistribute it
+# and/or modify it under the terms of the GNU General Public License as published
+# by the Free Software Foundation;
# either version 2 of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -41,40 +43,40 @@
class GlobalPlugin (globalPluginHandler.GlobalPlugin):
"""main class for the global plugin, in which all key bindings/scripts and NVDA events are handled."""
- def initialize (self):
- """An overide of the initialize() function in globalPluginHandler.py. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later."""
- global initialised, latex_access
- if not initialised:# is the latex_access com object created yet?
- latex_access = CreateObject ("latex_access")
- initialised = True
+ def event_caret (self, obj, kwargs):
+ """This event is called when the system caret moves, and it is being overidden so that latex-access speech translation can be used if the user wishes."""
- def event_caret (self):
- """This event is called when the system caret moves, and it is being overidden so that latex-access translation can be used if the user wishes."""
+ global currentLine, initialised, latex_access, processMaths
- global initialised, currentLine, latex_access
-
if not initialised:
self.initialize ()
if processMaths:
currentLine = GetLine ()
if not currentLine:# Is it a blank line?
- currentLine = "blank"
+ currentLine = _("blank")
else:
- currentLine = latex_access.speech (input)
- speech.speakMessage (currentLine)
- braille.handler.message (currentLine)
+ currentLine = latex_access.speech (currentLine)
+ speech.speakMessage (currentLine)
else:
SayLine ()
- BrailleLine ()
+ def initialize (self):
+ """An overide of the initialize() function in globalPluginHandler.py. Here we initialise what we need: we use the initialised global variable, and we create the latex_access com object. We interface with the matrix later."""
+ global initialised, latex_access
+ if not initialised:# is the latex_access com object created yet?
+ latex_access = CreateObject ("latex_access")
+ initialised = True
+
def script_toggleMaths (self, Gesture):
"""A script to toggle the latex-access translation on or off.
@param gesture: the gesture to be past through to NVDA (in this case, a keypress).
@type gesture: keypress.
"""
+ global processMaths
+
if processMaths:# is translation on?
processMaths = False
speech.speakMessage (_("Maths to be read as plain latex"))
@@ -92,7 +94,7 @@
# Useful functions:
def GetLine ():
- """Retrieves the current line that the current navigator object is focussed on."""
+ """Retrieves the line of text that the current navigator object is focussed on."""
info = api.getFocusObject().makeTextInfo(textInfos.POSITION_CARET)
info.expand(textInfos.UNIT_LINE)
currentLine = info.text
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dda...@us...> - 2011-02-09 08:35:48
|
Revision: 196
http://latex-access.svn.sourceforge.net/latex-access/?rev=196&view=rev
Author: ddalton10
Date: 2011-02-09 08:35:41 +0000 (Wed, 09 Feb 2011)
Log Message:
-----------
Well, I couldn't wait to the weekend to do this. First implementation of
my table access idea (see the mailing list for details).
I've implemented the following:
* A function to get the first row from the table (this will be used as
the headings)
* a function to convert this first row into list where each item is the
name of each column. The & signs are stripped.
* A function to get the current row.
* A function that determines location by counting the & signs in current
row then checking against the header information and returning the index
which matches the number of & signs in the row. This corresponds to the
name of the currently focused column.
* The currently focused column is determined from the last & sign to end
of input. Hence, driver specific code (emacs, jaws etc.), should pass
text from beginning of table to cursor.
* Now all that must be done is interfacing this with Jaws/emacs/nvda.
* Other functionality is planned (I won't ramble here though)
* The problem where our header information won't be current (see mailing
list), is no longer the case. When the functionality is invoked it
should go through the following steps:
1. strip out first row
2. strip out current row.
3. compile header info.
4. Count & signs and return matching entry.
Sorry for the longest commit message in history.:) And yes, Schmidty
licence info in table.py is basically copied from your nvda branch.
Added Paths:
-----------
table.py
Added: table.py
===================================================================
--- table.py (rev 0)
+++ table.py 2011-02-09 08:35:41 UTC (rev 196)
@@ -0,0 +1,60 @@
+# table.py
+# A part of the latex-access project at http://latex-access.sourceforge.net/
+# Author: Daniel Dalton <dan...@gm...>
+# Copyright (C) 2011 Daniel Dalton/latex-access Contributors
+#
+# This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation;
+# either version 2 of the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along with this program; if not, visit <http://www.gnu.org/licenses>
+
+if __name__ == "__main__":
+ print "This can only be used as a module, and does nothing when called interactively."
+ exit (-1)
+
+def BuildHeaderString (text):
+ """Create a tupple of headings.
+
+ These headings will be spoken when queried.
+ Provide the first row of a table which should represent the column
+ headings. This should be of type list or tupple."""
+
+ tableheadings = [] # clear last output
+ text = text.replace("\hline", "") # remove any hline, though there
+ # should only be one at most.
+ text = text.replace("\n", "") # So we don't miss last col
+ text = text.replace("\\\\", "") # put in a new line char at end of
+# row
+ text = text+"&" # Don't miss the last column
+ while text.find("&") != -1: # column LaTeX separater
+ tableheadings.append(text[:text.find("&")]) # next remove last col
+ text = text[text.find("&")+1:] # remove last col and separator
+ return tableheadings # return tupple of column headings.
+
+def WhereAmI (row, headers):
+ """Provides information of current location in table.
+
+ Currently speak the name of column. In future should speak cell
+ coordinates and any other useful info (Perhaps first cell in row)"""
+ return "Focus is in column "+headers[row.count("&")]
+
+def GetTableTopRow (table):
+ """Return the first row of a table.
+
+ This is useful for separating the row headings from the rest of the
+ stuff in the table."""
+
+ return table[:table.find("\\\\")]
+
+def GetTableCurrentRow (table):
+ """Return the currently focused row in table.
+
+ Find the last \\ char from end of input. Everything between end [-1],
+ and the last \\ char is considered the current row."""
+
+ return table[table.rfind("\\\\")+1:].replace("\n", "").replace("\\hline",
+ "")
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Daniel D. <dan...@gm...> - 2011-02-08 11:59:55
|
Yes, I'll try and get something up and running, and see how it is perceived. Something like this may be useful under Jaws as well, not sure, but my jaws scripting knowledge isn't great. I could probably do most things, but I've got no idea how I'd search for the \\... Anyway, I'll throw something together for emacs first. On Tue, Feb 08, 2011 at 11:51:39AM +0000, Alastair Irving wrote: > Yes, that makes sense. Are you happy to implement both the Python and > the emacs interface? > > Alastair > > On 08/02/2011 11:42, Daniel Dalton wrote: > > On Tue, Feb 08, 2011 at 11:33:53AM +0000, Alastair Irving wrote: > >> This seems like a good idea. How do you intend to determine which > >> column we're in? If each row of the table is on a separate line then > >> you just count the number of& signs before the cursor. However its > >> possible that the current row of the table is split over multiple lines, > >> in which case you need to keep going back until you either find a \\ or > >> the start of the table environment. > > > > Well if we find the start of the table environment then something has > > gone wrong, because their is no row above our current row, and hence, no > > heading for the current cell. > > > > The idea is to > > 1. Use the emacs/jaws/nvda scripting languages to find the last \\ > > before the cursor. Having done this, text between cursor and the found > > \\ should be selected and passed to the WhereAmI function in the python > > table module. > > 2. Next all we need to do is count the& signs in the passed text. > > > > Dan > > > > ------------------------------------------------------------------------------ > > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > > Pinpoint memory and threading errors before they happen. > > Find and fix more than 250 security defects in the development cycle. > > Locate bottlenecks in serial and parallel code that limit performance. > > http://p.sf.net/sfu/intel-dev2devfeb > > _______________________________________________ > > Latex-access-devel mailing list > > Lat...@li... > > https://lists.sourceforge.net/lists/listinfo/latex-access-devel > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Latex-access-devel mailing list > Lat...@li... > https://lists.sourceforge.net/lists/listinfo/latex-access-devel |
|
From: Williams, R. <rm...@ex...> - 2011-02-08 11:54:08
|
Hi, I don't quite know how \multicolumn is used, to be honest. I think it can be used to pad out a table, as it were, and also to contain table data. See the attached file for an example. There is an argument as to the number of columns it should produce, which could be used. However, this is probably a separate issue to the handling of tables in general. --- Robin Williams Mathematics PhD Student - University of Exeter Harrison building - room 319 W: http://emps.exeter.ac.uk/staff/rmw205 E: rm...@ex... M: 07525 809495 -----Original Message----- From: Daniel Dalton [mailto:dan...@gm...] Sent: 08 February 2011 11:04 To: Williams, Robin Cc: latex-access-devel Subject: Re: [Latex-access-devel] A weekend project -- is it out of the scope of this project? On Tue, Feb 08, 2011 at 10:25:01AM +0000, Williams, Robin wrote: > One of the problems I have when reading tables is when the \multicolumn command is used, it would be good if we could handle this. Do you just mean it is annoying, and you'd prefer "\multicolumn not be spoken/brailled? > >From your description, the only problem I could forsee is if the actual column headings, or number of columns, were changed after the table had been passed to the reading function. Yes correct, so for now the user will need to pass the header information to the function manually unfortunately. (On emacs select a region and call the function, on windows, select the text and call the function with key press). This should only really need to be done once per table, a little annoying I know, but not quite sure how to implement anything better without executing hundreds of lines of code...:) Dan |
|
From: Alastair I. <ala...@sj...> - 2011-02-08 11:51:51
|
Yes, that makes sense. Are you happy to implement both the Python and the emacs interface? Alastair On 08/02/2011 11:42, Daniel Dalton wrote: > On Tue, Feb 08, 2011 at 11:33:53AM +0000, Alastair Irving wrote: >> This seems like a good idea. How do you intend to determine which >> column we're in? If each row of the table is on a separate line then >> you just count the number of& signs before the cursor. However its >> possible that the current row of the table is split over multiple lines, >> in which case you need to keep going back until you either find a \\ or >> the start of the table environment. > > Well if we find the start of the table environment then something has > gone wrong, because their is no row above our current row, and hence, no > heading for the current cell. > > The idea is to > 1. Use the emacs/jaws/nvda scripting languages to find the last \\ > before the cursor. Having done this, text between cursor and the found > \\ should be selected and passed to the WhereAmI function in the python > table module. > 2. Next all we need to do is count the& signs in the passed text. > > Dan > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > Latex-access-devel mailing list > Lat...@li... > https://lists.sourceforge.net/lists/listinfo/latex-access-devel |