예제 #1
0
def renderaetes(aetes, out=sys.stdout, converter=None):
	"""Render raw terminology for application.
		aetes : list of AEDesc -- the aete(s) to parse
		out : file -- open file object to write to (default: stdout)
		converter : function -- function to convert AppleScript-style keywords (default: None)
	"""
	parse(aetes, QuickDoc(out, converter))
예제 #2
0
def component(code="ascr", out=sys.stdout, converter=None):
    """Render raw terminology for scripting component.
		code : str -- four-letter code indication component's subtype (default: AppleScript)
		out : file -- open file object to write to (default: stdout)
		converter : function -- function to convert AppleScript-style keywords (default: None)
	"""
    data = getsysterminology(code)
    parse(data, QuickDoc(out, converter))
예제 #3
0
def app(path, out=sys.stdout, converter=None):
    """Render raw terminology for application.
		path : str -- full path to application
		out : file -- open file object to write to (default: stdout)
		converter : function -- function to convert AppleScript-style keywords (default: None)
	"""
    data = getappterminology(path)
    parse(data, QuickDoc(out, converter))
예제 #4
0
def buildtablesforaetes(aetes, style='py-appscript'):
	"""
		aetes : list of AEDesc
		style : str
	"""
	receiver = TerminologyTableReceiver(style)
	parse(aetes, receiver)
	return receiver.result()
예제 #5
0
		self._isplural  = True
	
	def end_class(self):
		if not self._isplural:
			self._typesbycode[self._code] = self._name
			self._typesbyname[self._name] = self._code
	
	def start_enumeration(self, code):
		self._enumerationsbycode[code] = self._enumeration = []
	
	def add_enumerator(self, code, name, description):
		self._enumeration.append((name, code))
	
	def result(self):
		# add some definitions not in AS dictionary
		self._typesbycode['furl'] = 'file'
		self._typesbyname['file'] = 'furl'
		return self._typesbycode, self._enumerationsbycode, self._typesbyname

##

p = AeutTypesParser()
aeteparser.parse(getsysterminology('ascr'), p)

######################################################################
# PUBLIC
######################################################################

typebycode, enumerationbycode, typebyname = p.result()

예제 #6
0
def parsestring(aetes, path='', style='appscript'): # TO DO: rename parsedata
	p = _parsers[style](path)
	aeteparser.parse(aetes, p)
	return p.result()
예제 #7
0
def parsedata(aetes, path='', style='appscript'):
    # aetes : list of string -- aete data as a list of zero or more byte strings
    p = _parsers[style](path)
    aeteparser.parse(aetes, p)
    return p.result()
예제 #8
0
		self._isplural  = True
	
	def end_class(self):
		if not self._isplural:
			self._typesbycode[self._code] = self._name
			self._typesbyname[self._name] = self._code
	
	def start_enumeration(self, code):
		self._enumerationsbycode[code] = self._enumeration = []
	
	def add_enumerator(self, code, name, description):
		self._enumeration.append((name, code))
	
	def result(self):
		# add some definitions not in AS dictionary
		self._typesbycode['furl'] = 'file'
		self._typesbyname['file'] = 'furl'
		return self._typesbycode, self._enumerationsbycode, self._typesbyname

##

p = AeutTypesParser()
aeteparser.parse(getterminology.getaeut(), p)

######################################################################
# PUBLIC
######################################################################

typebycode, enumerationbycode, typebyname = p.result()

예제 #9
0
def parsedata(aetes, path='', style='appscript'):
	# aetes : list of string -- aete data as a list of zero or more byte strings
	p = _parsers[style](path)
	aeteparser.parse(aetes, p)
	return p.result()
예제 #10
0
		self._isplural  = True
	
	def end_class(self):
		if not self._isplural:
			self._typesbycode[self._code] = self._name
			self._typesbyname[self._name] = self._code
	
	def start_enumeration(self, code):
		self._enumerationsbycode[code] = self._enumeration = []
	
	def add_enumerator(self, code, name, description):
		self._enumeration.append((name, code))
	
	def result(self):
		# add some definitions not in AS dictionary
		self._typesbycode['furl'] = 'file'
		self._typesbyname['file'] = 'furl'
		return self._typesbycode, self._enumerationsbycode, self._typesbyname

##

p = AeutTypesParser()
aeteparser.parse(getaeut('ascr'), p)

######################################################################
# PUBLIC
######################################################################

typebycode, enumerationbycode, typebyname = p.result()

예제 #11
0
def parseaetes(aetes, path='', style='appscript'):
	# aetes : list of AEDesc -- a list of zero or more AEDescs of typeAETE/typeAEUT
	p = _parsers[style](path)
	aeteparser.parse(aetes, p)
	return p.result()
예제 #12
0
        self._isplural = True

    def end_class(self):
        if not self._isplural:
            self._typesbycode[self._code] = self._name
            self._typesbyname[self._name] = self._code

    def start_enumeration(self, code):
        self._enumerationsbycode[code] = self._enumeration = []

    def add_enumerator(self, code, name, description):
        self._enumeration.append((name, code))

    def result(self):
        # add some definitions not in AS dictionary
        self._typesbycode['furl'] = 'file'
        self._typesbyname['file'] = 'furl'
        return self._typesbycode, self._enumerationsbycode, self._typesbyname


##

p = AeutTypesParser()
aeteparser.parse(getsysterminology('ascr'), p)

######################################################################
# PUBLIC
######################################################################

typebycode, enumerationbycode, typebyname = p.result()
예제 #13
0
def parseaetes(aetes, path='', style='appscript'):
    # aetes : list of AEDesc -- a list of zero or more AEDescs of typeAETE/typeAEUT
    p = _parsers[style](path)
    aeteparser.parse(aetes, p)
    return p.result()