Exemple #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))
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))
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))
Exemple #4
0
def buildtablesforaetes(aetes, style='py-appscript'):
	"""
		aetes : list of AEDesc
		style : str
	"""
	receiver = TerminologyTableReceiver(style)
	parse(aetes, receiver)
	return receiver.result()
		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()

Exemple #6
0
def parsestring(aetes, path='', style='appscript'): # TO DO: rename parsedata
	p = _parsers[style](path)
	aeteparser.parse(aetes, p)
	return p.result()
Exemple #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()
		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()

Exemple #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()
Exemple #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()

Exemple #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()
        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()
Exemple #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()