Exemple #1
0
    import pkg_resources
    pkg_resources.require("dragonfly >= 0.6.5beta1.dev-r81")
except ImportError:
    pass

import os, os.path
from dragonfly import (Grammar, CompoundRule, DictList, DictListRef,
                       MappingRule, Mimic, Key, FocusWindow,
                       Window, Config, Section, Item)


#---------------------------------------------------------------------------
# Set up this module's configuration.

config                   = Config("config manager")
config.lang              = Section("Language section")
config.lang.list_configs = Item("list configs",
                                doc="Command to ...")
config.lang.edit_config  = Item("edit <config> (config | configuration)",
                                doc="Command to ...")
config.lang.show_dragonfly_version = Item("show dragonfly version",
                                doc="Command to ...")
config.lang.update_dragonfly = Item("update dragonfly version",
                                doc="Command to ...")
config.lang.reload_natlink   = Item("reload natlink",
                                doc="Command to ...")
config.load()


#---------------------------------------------------------------------------
Exemple #2
0
try:
    import pkg_resources
    pkg_resources.require("dragonfly >= 0.6.5beta1.dev-r81")
except ImportError:
    pass

import os, os.path
from dragonfly import (Grammar, CompoundRule, DictList, DictListRef,
                       MappingRule, Mimic, Key, FocusWindow, Window, Config,
                       Section, Item)

#---------------------------------------------------------------------------
# Set up this module's configuration.

config = Config("config manager")
config.lang = Section("Language section")
config.lang.list_configs = Item("list configs", doc="Command to ...")
config.lang.edit_config = Item("edit <config> (config | configuration)",
                               doc="Command to ...")
config.lang.show_dragonfly_version = Item("show dragonfly version",
                                          doc="Command to ...")
config.lang.update_dragonfly = Item("update dragonfly version",
                                    doc="Command to ...")
config.lang.reload_natlink = Item("reload natlink", doc="Command to ...")
config.load()

#---------------------------------------------------------------------------

config_map = DictList("config_map")

#---------------------------------------------------------------------------
Exemple #3
0
# With help from:
#  * http://msdn.microsoft.com/en-us/library/ff184607.aspx
#  * http://dragonfly-modules.googlecode.com/svn-history/r50/trunk/command-modules/documentation/mod-_outlook.html
#

from dragonfly import(Config, Section, Item,
                      Grammar, ConnectionGrammar, AppContext,
                      MappingRule, CompoundRule,
                      Key, Integer, IntegerRef,
                      DictList, DictListRef)
import tempfile
import os
import os.path

config = Config('Microsoft Outlook control')
config.lang = Section('Language section')
config.lang.go_to_folder = Item('folder <folder>')
config.lang.move_to_folder = Item('move to <folder>')
config.lang.sync_folders = Item('refresh folders')
config.load()

def collection_iter(collection):
    for index in xrange(1, collection.Count + 1):
        yield collection.Item(index)

class OutlookControlGrammar(ConnectionGrammar):
    def __init__(self):
        self.folders = DictList("folders")
        super(OutlookControlGrammar,self).__init__(
            name="Microsoft Outlook control",
            context=AppContext(executable="outlook"),