brain_curses.py 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181
  1. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
  2. # For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
  3. from astroid.brain.helpers import register_module_extender
  4. from astroid.builder import parse
  5. from astroid.manager import AstroidManager
  6. def _curses_transform():
  7. return parse(
  8. """
  9. A_ALTCHARSET = 1
  10. A_BLINK = 1
  11. A_BOLD = 1
  12. A_DIM = 1
  13. A_INVIS = 1
  14. A_ITALIC = 1
  15. A_NORMAL = 1
  16. A_PROTECT = 1
  17. A_REVERSE = 1
  18. A_STANDOUT = 1
  19. A_UNDERLINE = 1
  20. A_HORIZONTAL = 1
  21. A_LEFT = 1
  22. A_LOW = 1
  23. A_RIGHT = 1
  24. A_TOP = 1
  25. A_VERTICAL = 1
  26. A_CHARTEXT = 1
  27. A_ATTRIBUTES = 1
  28. A_CHARTEXT = 1
  29. A_COLOR = 1
  30. KEY_MIN = 1
  31. KEY_BREAK = 1
  32. KEY_DOWN = 1
  33. KEY_UP = 1
  34. KEY_LEFT = 1
  35. KEY_RIGHT = 1
  36. KEY_HOME = 1
  37. KEY_BACKSPACE = 1
  38. KEY_F0 = 1
  39. KEY_Fn = 1
  40. KEY_DL = 1
  41. KEY_IL = 1
  42. KEY_DC = 1
  43. KEY_IC = 1
  44. KEY_EIC = 1
  45. KEY_CLEAR = 1
  46. KEY_EOS = 1
  47. KEY_EOL = 1
  48. KEY_SF = 1
  49. KEY_SR = 1
  50. KEY_NPAGE = 1
  51. KEY_PPAGE = 1
  52. KEY_STAB = 1
  53. KEY_CTAB = 1
  54. KEY_CATAB = 1
  55. KEY_ENTER = 1
  56. KEY_SRESET = 1
  57. KEY_RESET = 1
  58. KEY_PRINT = 1
  59. KEY_LL = 1
  60. KEY_A1 = 1
  61. KEY_A3 = 1
  62. KEY_B2 = 1
  63. KEY_C1 = 1
  64. KEY_C3 = 1
  65. KEY_BTAB = 1
  66. KEY_BEG = 1
  67. KEY_CANCEL = 1
  68. KEY_CLOSE = 1
  69. KEY_COMMAND = 1
  70. KEY_COPY = 1
  71. KEY_CREATE = 1
  72. KEY_END = 1
  73. KEY_EXIT = 1
  74. KEY_FIND = 1
  75. KEY_HELP = 1
  76. KEY_MARK = 1
  77. KEY_MESSAGE = 1
  78. KEY_MOVE = 1
  79. KEY_NEXT = 1
  80. KEY_OPEN = 1
  81. KEY_OPTIONS = 1
  82. KEY_PREVIOUS = 1
  83. KEY_REDO = 1
  84. KEY_REFERENCE = 1
  85. KEY_REFRESH = 1
  86. KEY_REPLACE = 1
  87. KEY_RESTART = 1
  88. KEY_RESUME = 1
  89. KEY_SAVE = 1
  90. KEY_SBEG = 1
  91. KEY_SCANCEL = 1
  92. KEY_SCOMMAND = 1
  93. KEY_SCOPY = 1
  94. KEY_SCREATE = 1
  95. KEY_SDC = 1
  96. KEY_SDL = 1
  97. KEY_SELECT = 1
  98. KEY_SEND = 1
  99. KEY_SEOL = 1
  100. KEY_SEXIT = 1
  101. KEY_SFIND = 1
  102. KEY_SHELP = 1
  103. KEY_SHOME = 1
  104. KEY_SIC = 1
  105. KEY_SLEFT = 1
  106. KEY_SMESSAGE = 1
  107. KEY_SMOVE = 1
  108. KEY_SNEXT = 1
  109. KEY_SOPTIONS = 1
  110. KEY_SPREVIOUS = 1
  111. KEY_SPRINT = 1
  112. KEY_SREDO = 1
  113. KEY_SREPLACE = 1
  114. KEY_SRIGHT = 1
  115. KEY_SRSUME = 1
  116. KEY_SSAVE = 1
  117. KEY_SSUSPEND = 1
  118. KEY_SUNDO = 1
  119. KEY_SUSPEND = 1
  120. KEY_UNDO = 1
  121. KEY_MOUSE = 1
  122. KEY_RESIZE = 1
  123. KEY_MAX = 1
  124. ACS_BBSS = 1
  125. ACS_BLOCK = 1
  126. ACS_BOARD = 1
  127. ACS_BSBS = 1
  128. ACS_BSSB = 1
  129. ACS_BSSS = 1
  130. ACS_BTEE = 1
  131. ACS_BULLET = 1
  132. ACS_CKBOARD = 1
  133. ACS_DARROW = 1
  134. ACS_DEGREE = 1
  135. ACS_DIAMOND = 1
  136. ACS_GEQUAL = 1
  137. ACS_HLINE = 1
  138. ACS_LANTERN = 1
  139. ACS_LARROW = 1
  140. ACS_LEQUAL = 1
  141. ACS_LLCORNER = 1
  142. ACS_LRCORNER = 1
  143. ACS_LTEE = 1
  144. ACS_NEQUAL = 1
  145. ACS_PI = 1
  146. ACS_PLMINUS = 1
  147. ACS_PLUS = 1
  148. ACS_RARROW = 1
  149. ACS_RTEE = 1
  150. ACS_S1 = 1
  151. ACS_S3 = 1
  152. ACS_S7 = 1
  153. ACS_S9 = 1
  154. ACS_SBBS = 1
  155. ACS_SBSB = 1
  156. ACS_SBSS = 1
  157. ACS_SSBB = 1
  158. ACS_SSBS = 1
  159. ACS_SSSB = 1
  160. ACS_SSSS = 1
  161. ACS_STERLING = 1
  162. ACS_TTEE = 1
  163. ACS_UARROW = 1
  164. ACS_ULCORNER = 1
  165. ACS_URCORNER = 1
  166. ACS_VLINE = 1
  167. COLOR_BLACK = 1
  168. COLOR_BLUE = 1
  169. COLOR_CYAN = 1
  170. COLOR_GREEN = 1
  171. COLOR_MAGENTA = 1
  172. COLOR_RED = 1
  173. COLOR_WHITE = 1
  174. COLOR_YELLOW = 1
  175. """
  176. )
  177. register_module_extender(AstroidManager(), "curses", _curses_transform)