PageRenderTime 45ms CodeModel.GetById 18ms RepoModel.GetById 0ms app.codeStats 0ms

/desktop/core/ext-py/pyexcelerator/hrc/py-2.4-hrc.py

https://github.com/jcrobak/hue
Python | 312 lines | 306 code | 6 blank | 0 comment | 3 complexity | d80721ebd1f1a7199395989c8045f07e MD5 | raw file
  1. specials = [
  2. "Ellipsis",
  3. "False",
  4. "None",
  5. "NotImplemented",
  6. "True",
  7. "__abs__",
  8. "__add__",
  9. "__and__",
  10. "__base__",
  11. "__bases__",
  12. "__basicsize__",
  13. "__builtins__",
  14. "__call__",
  15. "__class__",
  16. "__cmp__",
  17. "__coerce__",
  18. "__contains__",
  19. "__debug__",
  20. "__del__",
  21. "__delattr__",
  22. "__delete__",
  23. "__delitem__",
  24. "__delslice__",
  25. "__dict__",
  26. "__dictoffset__",
  27. "__div__",
  28. "__divmod__",
  29. "__doc__",
  30. "__eq__",
  31. "__flags__",
  32. "__float__",
  33. "__floordiv__",
  34. "__ge__",
  35. "__get__",
  36. "__getattr__",
  37. "__getattribute__",
  38. "__getitem__",
  39. "__getnewargs__",
  40. "__getslice__",
  41. "__gt__",
  42. "__hash__",
  43. "__hex__",
  44. "__iadd__",
  45. "__iand__",
  46. "__idiv__",
  47. "__ifloordiv__",
  48. "__ilshift__",
  49. "__imod__",
  50. "__import__",
  51. "__imul__",
  52. "__init__",
  53. "__int__",
  54. "__invert__",
  55. "__ior__",
  56. "__ipow__",
  57. "__irshift__",
  58. "__isub__",
  59. "__itemsize__",
  60. "__iter__",
  61. "__itruediv__",
  62. "__ixor__",
  63. "__le__",
  64. "__len__",
  65. "__long__",
  66. "__lshift__",
  67. "__lt__",
  68. "__main__",
  69. "__mod__",
  70. "__module__",
  71. "__mro__",
  72. "__mul__",
  73. "__name__",
  74. "__ne__",
  75. "__neg__",
  76. "__new__",
  77. "__nonzero__",
  78. "__oct__",
  79. "__or__",
  80. "__pos__",
  81. "__pow__",
  82. "__radd__",
  83. "__rand__",
  84. "__rdiv__",
  85. "__rdivmod__",
  86. "__reduce__",
  87. "__reduce_ex__",
  88. "__repr__",
  89. "__rfloordiv__",
  90. "__rlshift__",
  91. "__rmod__",
  92. "__rmul__",
  93. "__ror__",
  94. "__rpow__",
  95. "__rrshift__",
  96. "__rshift__",
  97. "__rsub__",
  98. "__rtruediv__",
  99. "__rxor__",
  100. "__set__",
  101. "__setattr__",
  102. "__setitem__",
  103. "__setslice__",
  104. "__str__",
  105. "__sub__",
  106. "__truediv__",
  107. "__weakrefoffset__",
  108. "__xor__",
  109. "abs",
  110. "apply",
  111. "basestring",
  112. "bool",
  113. "buffer",
  114. "callable",
  115. "capitalize",
  116. "center",
  117. "chr",
  118. "classmethod",
  119. "cmp",
  120. "coerce",
  121. "compile",
  122. "complex",
  123. "count",
  124. "decode",
  125. "delattr",
  126. "dict",
  127. "dir",
  128. "divmod",
  129. "encode",
  130. "endswith",
  131. "enumerate",
  132. "eval",
  133. "execfile",
  134. "exit",
  135. "expandtabs",
  136. "file",
  137. "filter",
  138. "find",
  139. "float",
  140. "frozenset",
  141. "getattr",
  142. "globals",
  143. "hasattr",
  144. "hash",
  145. "hex",
  146. "id",
  147. "index",
  148. "input",
  149. "int",
  150. "intern",
  151. "isalnum",
  152. "isalpha",
  153. "isdigit",
  154. "isinstance",
  155. "islower",
  156. "isspace",
  157. "issubclass",
  158. "istitle",
  159. "isupper",
  160. "iter",
  161. "join",
  162. "len",
  163. "list",
  164. "ljust",
  165. "locals",
  166. "long",
  167. "lower",
  168. "lstrip",
  169. "map",
  170. "max",
  171. "min",
  172. "next",
  173. "object",
  174. "oct",
  175. "open",
  176. "ord",
  177. "pow",
  178. "property",
  179. "quit",
  180. "range",
  181. "raw_input",
  182. "reduce",
  183. "reload",
  184. "replace",
  185. "repr",
  186. "reversed",
  187. "rfind",
  188. "rindex",
  189. "rjust",
  190. "round",
  191. "rsplit",
  192. "rstrip",
  193. "set",
  194. "setattr",
  195. "slice",
  196. "sorted",
  197. "split",
  198. "splitlines",
  199. "startswith",
  200. "staticmethod",
  201. "str",
  202. "strip",
  203. "sum",
  204. "super",
  205. "swapcase",
  206. "title",
  207. "translate",
  208. "tuple",
  209. "type",
  210. "unichr",
  211. "unicode",
  212. "upper",
  213. "vars",
  214. "xrange",
  215. "zfill",
  216. "zip"
  217. ]
  218. exceptions = [
  219. "Exception",
  220. "SystemExit",
  221. "StopIteration",
  222. "StandardError",
  223. "KeyboardInterrupt",
  224. "ImportError",
  225. "EnvironmentError",
  226. "IOError",
  227. "OSError",
  228. "WindowsError",
  229. "EOFError",
  230. "RuntimeError",
  231. "NotImplementedError",
  232. "NameError",
  233. "UnboundLocalError",
  234. "AttributeError",
  235. "SyntaxError",
  236. "IndentationError",
  237. "TabError",
  238. "TypeError",
  239. "AssertionError",
  240. "LookupError",
  241. "IndexError",
  242. "KeyError",
  243. "ArithmeticError",
  244. "OverflowError",
  245. "ZeroDivisionError",
  246. "FloatingPointError",
  247. "ValueError",
  248. "UnicodeError",
  249. "UnicodeEncodeError",
  250. "UnicodeDecodeError",
  251. "UnicodeTranslateError",
  252. "ReferenceError",
  253. "SystemError",
  254. "MemoryError",
  255. "Warning",
  256. "UserWarning",
  257. "DeprecationWarning",
  258. "PendingDeprecationWarning",
  259. "SyntaxWarning",
  260. "OverflowWarning", # not generated in 2.4; won't exist in 2.5
  261. "RuntimeWarning",
  262. "FutureWarning"
  263. ]
  264. reserved_words = [
  265. "and",
  266. "del",
  267. "for",
  268. "is",
  269. "raise",
  270. "assert",
  271. "elif",
  272. "from" ,
  273. "lambda",
  274. "return",
  275. "break",
  276. "else",
  277. "global",
  278. "not",
  279. "try",
  280. "class",
  281. "except",
  282. "if",
  283. "or",
  284. "while",
  285. "continue",
  286. "exec",
  287. "import",
  288. "pass" ,
  289. "yield" ,
  290. "def",
  291. "finally",
  292. "in",
  293. "print"
  294. ]
  295. print '<keywords region="pyWord">'
  296. for word in sorted(reserved_words):
  297. print ' <word name="%s"/>' % word
  298. print '</keywords>'
  299. print '<keywords region="pyException">'
  300. for exc in sorted(exceptions):
  301. print ' <word name="%s"/>' % exc
  302. print '</keywords>'
  303. print '<keywords region="pyBuiltins">'
  304. for special in sorted(specials):
  305. print ' <word name="%s"/>' % special
  306. print '</keywords>'