home *** CD-ROM | disk | FTP | other *** search
/ MacHack 2000 / MacHack 2000.toast / pc / The Hacks / MacHacksBug / Python 1.5.2c1 / Mac / Lib / lib-scripting / Text_Suite.py < prev    next >
Encoding:
Python Source  |  2000-06-23  |  3.7 KB  |  187 lines

  1. """Suite Text Suite: A set of basic classes for text processing
  2. Level 1, version 1
  3.  
  4. Generated from flap:System Folder:Extensions:Scripting Additions:Dialects:English Dialect
  5. AETE/AEUT resource version 1/0, language 0, script 0
  6. """
  7.  
  8. import aetools
  9. import MacOS
  10.  
  11. _code = 'TEXT'
  12.  
  13. class Text_Suite:
  14.  
  15.     pass
  16.  
  17.  
  18. class character(aetools.ComponentItem):
  19.     """character - A character"""
  20.     want = 'cha '
  21. class best_type(aetools.NProperty):
  22.     """best type - the best descriptor type"""
  23.     which = 'pbst'
  24.     want = 'type'
  25. class _class(aetools.NProperty):
  26.     """class - the class"""
  27.     which = 'pcls'
  28.     want = 'type'
  29. class color(aetools.NProperty):
  30.     """color - the color"""
  31.     which = 'colr'
  32.     want = 'cRGB'
  33. class default_type(aetools.NProperty):
  34.     """default type - the default descriptor type"""
  35.     which = 'deft'
  36.     want = 'type'
  37. class font(aetools.NProperty):
  38.     """font - the name of the font"""
  39.     which = 'font'
  40.     want = 'ctxt'
  41. class size(aetools.NProperty):
  42.     """size - the size in points"""
  43.     which = 'ptsz'
  44.     want = 'fixd'
  45. class writing_code(aetools.NProperty):
  46.     """writing code - the script system and language"""
  47.     which = 'psct'
  48.     want = 'intl'
  49. class style(aetools.NProperty):
  50.     """style - the text style"""
  51.     which = 'txst'
  52.     want = 'tsty'
  53. class uniform_styles(aetools.NProperty):
  54.     """uniform styles - the text style"""
  55.     which = 'ustl'
  56.     want = 'tsty'
  57.  
  58. class line(aetools.ComponentItem):
  59.     """line - A line of text"""
  60.     want = 'clin'
  61. class justification(aetools.NProperty):
  62.     """justification - Justification of the text"""
  63.     which = 'pjst'
  64.     want = 'just'
  65.  
  66. lines = line
  67.  
  68. class paragraph(aetools.ComponentItem):
  69.     """paragraph - A paragraph"""
  70.     want = 'cpar'
  71.  
  72. paragraphs = paragraph
  73.  
  74. class text(aetools.ComponentItem):
  75.     """text - Text"""
  76.     want = 'ctxt'
  77.  
  78. class text_flow(aetools.ComponentItem):
  79.     """text flow - A contiguous block of text"""
  80.     want = 'cflo'
  81. class name(aetools.NProperty):
  82.     """name - the name"""
  83.     which = 'pnam'
  84.     want = 'itxt'
  85.  
  86. text_flows = text_flow
  87.  
  88. class word(aetools.ComponentItem):
  89.     """word - A word"""
  90.     want = 'cwor'
  91.  
  92. words = word
  93. character._propdict = {
  94.     'best_type' : best_type,
  95.     '_class' : _class,
  96.     'color' : color,
  97.     'default_type' : default_type,
  98.     'font' : font,
  99.     'size' : size,
  100.     'writing_code' : writing_code,
  101.     'style' : style,
  102.     'uniform_styles' : uniform_styles,
  103. }
  104. character._elemdict = {
  105. }
  106. line._propdict = {
  107.     'justification' : justification,
  108. }
  109. line._elemdict = {
  110. }
  111. paragraph._propdict = {
  112. }
  113. paragraph._elemdict = {
  114. }
  115. text._propdict = {
  116. }
  117. text._elemdict = {
  118. }
  119. text_flow._propdict = {
  120.     'name' : name,
  121. }
  122. text_flow._elemdict = {
  123. }
  124. word._propdict = {
  125. }
  126. word._elemdict = {
  127. }
  128. _Enum_just = {
  129.     'left' : 'left',    # Align with left margin
  130.     'right' : 'rght',    # Align with right margin
  131.     'center' : 'cent',    # Align with center
  132.     'full' : 'full',    # Align with both left and right margins
  133. }
  134.  
  135. _Enum_styl = {
  136.     'plain' : 'plan',    # Plain
  137.     'bold' : 'bold',    # Bold
  138.     'italic' : 'ital',    # Italic
  139.     'outline' : 'outl',    # Outline
  140.     'shadow' : 'shad',    # Shadow
  141.     'underline' : 'undl',    # Underline
  142.     'superscript' : 'spsc',    # Superscript
  143.     'subscript' : 'sbsc',    # Subscript
  144.     'strikethrough' : 'strk',    # Strikethrough
  145.     'small_caps' : 'smcp',    # Small caps
  146.     'all_caps' : 'alcp',    # All capital letters
  147.     'all_lowercase' : 'lowc',    # Lowercase
  148.     'condensed' : 'cond',    # Condensed
  149.     'expanded' : 'pexp',    # Expanded
  150.     'hidden' : 'hidn',    # Hidden
  151. }
  152.  
  153.  
  154. #
  155. # Indices of types declared in this module
  156. #
  157. _classdeclarations = {
  158.     'cflo' : text_flow,
  159.     'clin' : line,
  160.     'ctxt' : text,
  161.     'cha ' : character,
  162.     'cwor' : word,
  163.     'cpar' : paragraph,
  164. }
  165.  
  166. _propdeclarations = {
  167.     'pbst' : best_type,
  168.     'psct' : writing_code,
  169.     'txst' : style,
  170.     'colr' : color,
  171.     'font' : font,
  172.     'pnam' : name,
  173.     'pcls' : _class,
  174.     'deft' : default_type,
  175.     'pjst' : justification,
  176.     'ptsz' : size,
  177.     'ustl' : uniform_styles,
  178. }
  179.  
  180. _compdeclarations = {
  181. }
  182.  
  183. _enumdeclarations = {
  184.     'styl' : _Enum_styl,
  185.     'just' : _Enum_just,
  186. }
  187.