This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# non_braces | |
[non_braces.greek] | |
# does not require curly braces in latex | |
alpha = "alpha" | |
beater = "beta" | |
gamma = "gamma" | |
delta = "delta" | |
epsilon = "epsilon" | |
zita = "zeta" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Here's a new command for writing numerical fractions more naturally. Not the most elegant but gets the job done. | |
"<number> <denominator>": R(Text("\\frac %(number)d") + Key("down") | |
+ Text("%(denominator)s") + Key("right")), | |
"[one] <denominator_single>": R(Text("\\frac 1") + Key("down") | |
+ Text("%(denominator_single)s") + Key("right")), | |
IntegerRefST("number", 2, 100), | |
Choice("denominator", { | |
"halves": "2", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dragonfly import (Grammar, AppContext, Dictation, Key, Text, Repeat, Choice, Function, ActionBase, ActionError) | |
class MultiAppContext(AppContext): | |
# ---------------------------------------------------------------------- | |
# Initialization methods. | |
def __init__(self, relevant_apps=None, title=None, exclude=False): | |
AppContext.__init__(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import toml | |
import io | |
from dragonfly import (Grammar, Context, AppContext, Dictation, Key, Text, Repeat, | |
Function, Choice, Mouse) | |
from castervoice.lib import context, navigation, alphanumeric, textformat, text_utils | |
from castervoice.lib import control | |
from castervoice.lib.dfplus.additions import IntegerRefST | |
from castervoice.lib.dfplus.merge.ccrmerger import CCRMerger | |
from castervoice.lib.dfplus.merge.mergerule import MergeRule | |
from castervoice.lib.dfplus.state.short import R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Unimacro grammar to Dictate latex markup, as defined in an inifile | |
""" | |
__version__ = "$Rev: 398 $ on $Date: 2011-03-07 14:50:15 +0100 (ma, 07 mrt 2011) $ by $Author: quintijn $" | |
# This file is part of a SourceForge project called "unimacro" see | |
# http://unimacro.SourceForge.net and http://qh.antenna.nl/unimacro | |
# (c) copyright 2003 see http://qh.antenna.nl/unimacro/aboutunimacro.html | |
# or the file COPYRIGHT.txt in the natlink\natlink directory | |
# | |
# _latex.py: Dictate latex markup |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Function only works with keyword arguments. Something like arkalii's solution is a good way of dealing with the issue. You could also use a decorator on the add function to map argument names. This would keep the mappings clean: | |
arg_map = { | |
"num1": "x", | |
"n": "x", | |
"num2": "y", | |
"m": "y", | |
} | |
def replace_args(func): | |
def new_func(*_, **kwargs): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# This file is part of Dragonfly. | |
# (c) Copyright 2007, 2008 by Christo Butcher | |
# Licensed under the LGPL. | |
# | |
# Dragonfly is free software: you can redistribute it and/or modify it | |
# under the terms of the GNU Lesser General Public License as published | |
# by the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from dragonfly import ActionBase | |
from dragonfly import Context | |
from dragonfly import Text | |
class PositionalTexter(object): | |
def __init__(self, func, extra=()): | |
self.func = func |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# thanks to Casper and Caster for contributing commands to this. | |
from dragonfly import (Grammar, Context, AppContext, Dictation, Repeat, Function, Choice, Mouse, Pause) | |
from castervoice.lib import control | |
from castervoice.lib import settings | |
from castervoice.lib.actions import Key, Text | |
from castervoice.lib.context import AppContext | |
from castervoice.lib.dfplus.additions import IntegerRefS# thanks to Casper for contributing commands to this. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from inspect import getargspec | |
from .action_base import ActionBase, ActionError | |
class OtherFunction(ActionBase): | |
def __init__(self, function, defaults=None, remap_data=None): | |
ActionBase.__init__(self) | |
self._function = function |
OlderNewer