コード例 #1
0
ファイル: system.py プロジェクト: vishvega/Evergreen
    def connect(**kwargs):
        """
        Connects to the OpenSRF network, parses the IDL, and loads the CSEditor.
        """

        osrf.system.System.connect(**kwargs)
        IDLParser.parse()
        oilsLoadCSEditor()
コード例 #2
0
ファイル: system.py プロジェクト: CloCkWeRX/Evergreen
    def connect(**kwargs):
        """
        Connects to the OpenSRF network, parses the IDL, and loads the CSEditor.
        """

        osrf.system.System.connect(**kwargs)
        IDLParser.parse()
        oilsLoadCSEditor()
コード例 #3
0
ファイル: system.py プロジェクト: atz/OpenILS-Evergreen
    def remote_connect(**kwargs):
	    """
            Connects to the opensrf network,  parses the IDL file, and loads the CSEditor.
            This version of connect does not talk to opensrf.settings, which means it 
            also does not connect to the opensrf cache.
        """
	    osrf.system.System.net_connect(**kwargs)
	    IDLParser.parse()
	    oilsLoadCSEditor()
コード例 #4
0
ファイル: system.py プロジェクト: vishvega/Evergreen
    def remote_connect(**kwargs):
        """
        Connects to the OpenSRF network, parses the IDL, and loads the CSEditor.

        This version of connect does not talk to opensrf.settings, which means
        it also does not connect to the OpenSRF cache.
        """

        osrf.system.System.net_connect(**kwargs)
        IDLParser.parse()
        oilsLoadCSEditor()
コード例 #5
0
ファイル: csedit.py プロジェクト: CloCkWeRX/Evergreen
def oilsLoadCSEditor():
    """
    Creates a class method for each action on each type of fieldmapper object
    """

    global __editor_loaded
    if __editor_loaded:
        return
    __editor_loaded = True

    obj = IDLParser.get_parser().idl_object

    for fmap in obj.itervalues():
        for action in ACTIONS:

            fmname = fmap.fieldmapper.replace('::', '_')
            obj_type = fmap.fieldmapper.replace('::', '.')
            name = "%s_%s" % (action, fmname)

            method = 'def %s(self, arg, **options):\n' % name
            method += '\treturn self.runMethod("%s", "%s"' % (action, obj_type)
            method += ', arg, dict(options))\n'
            method += 'setattr(CSEditor, "%s", %s)' % (name, name)

            exec(method)
コード例 #6
0
ファイル: csedit.py プロジェクト: vishvega/Evergreen
def oilsLoadCSEditor():
    """
    Creates a class method for each action on each type of fieldmapper object
    """

    global __editor_loaded
    if __editor_loaded:
        return
    __editor_loaded = True

    obj = IDLParser.get_parser().idl_object

    for fmap in obj.itervalues():
        for action in ACTIONS:

            fmname = fmap.fieldmapper.replace('::', '_')
            obj_type = fmap.fieldmapper.replace('::', '.')
            name = "%s_%s" % (action, fmname)

            method = 'def %s(self, arg, **options):\n' % name
            method += '\treturn self.runMethod("%s", "%s"' % (action, obj_type)
            method += ', arg, dict(options))\n'
            method += 'setattr(CSEditor, "%s", %s)' % (name, name)

            exec(method)
コード例 #7
0
ファイル: csedit.py プロジェクト: atz/OpenILS-Evergreen
def oilsLoadCSEditor():
    global __editor_loaded
    if __editor_loaded:
        return
    __editor_loaded = True

    obj = IDLParser.get_parser().IDLObject

    for k, fm in obj.iteritems():
        for action in ACTIONS:

            fmname = fm.fieldmapper.replace('::', '_')
            type = fm.fieldmapper.replace('::', '.')
            name = "%s_%s" % (action, fmname)

            s = 'def %s(self, arg, **options):\n' % name
            s += '\treturn self.runMethod("%s", "%s", arg, dict(options))\n' % (action, type)
            s += 'setattr(CSEditor, "%s", %s)' % (name, name)

            exec(s)
コード例 #8
0
ファイル: system.py プロジェクト: atz/OpenILS-Evergreen
    def connect(**kwargs):
	    """Connects to the opensrf network,  parses the IDL file, and loads the CSEditor"""
	    osrf.system.System.connect(**kwargs)
	    IDLParser.parse()
	    oilsLoadCSEditor()