brain_mechanize.py 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. # Copyright (c) 2012-2013 LOGILAB S.A. (Paris, FRANCE) <contact@logilab.fr>
  2. # Copyright (c) 2014 Google, Inc.
  3. # Copyright (c) 2015-2016, 2018, 2020 Claudiu Popa <pcmanticore@gmail.com>
  4. # Copyright (c) 2016 Ceridwen <ceridwenv@gmail.com>
  5. # Copyright (c) 2020-2021 hippo91 <guillaume.peillex@gmail.com>
  6. # Copyright (c) 2020 Peter Kolbus <peter.kolbus@gmail.com>
  7. # Copyright (c) 2021 Pierre Sassoulas <pierre.sassoulas@gmail.com>
  8. # Copyright (c) 2021 Marc Mueller <30130371+cdce8p@users.noreply.github.com>
  9. # Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
  10. # For details: https://github.com/PyCQA/astroid/blob/main/LICENSE
  11. from astroid.brain.helpers import register_module_extender
  12. from astroid.builder import AstroidBuilder
  13. from astroid.manager import AstroidManager
  14. def mechanize_transform():
  15. return AstroidBuilder(AstroidManager()).string_build(
  16. """
  17. class Browser(object):
  18. def __getattr__(self, name):
  19. return None
  20. def __getitem__(self, name):
  21. return None
  22. def __setitem__(self, name, val):
  23. return None
  24. def back(self, n=1):
  25. return None
  26. def clear_history(self):
  27. return None
  28. def click(self, *args, **kwds):
  29. return None
  30. def click_link(self, link=None, **kwds):
  31. return None
  32. def close(self):
  33. return None
  34. def encoding(self):
  35. return None
  36. def find_link(self, text=None, text_regex=None, name=None, name_regex=None, url=None, url_regex=None, tag=None, predicate=None, nr=0):
  37. return None
  38. def follow_link(self, link=None, **kwds):
  39. return None
  40. def forms(self):
  41. return None
  42. def geturl(self):
  43. return None
  44. def global_form(self):
  45. return None
  46. def links(self, **kwds):
  47. return None
  48. def open_local_file(self, filename):
  49. return None
  50. def open(self, url, data=None, timeout=None):
  51. return None
  52. def open_novisit(self, url, data=None, timeout=None):
  53. return None
  54. def open_local_file(self, filename):
  55. return None
  56. def reload(self):
  57. return None
  58. def response(self):
  59. return None
  60. def select_form(self, name=None, predicate=None, nr=None, **attrs):
  61. return None
  62. def set_cookie(self, cookie_string):
  63. return None
  64. def set_handle_referer(self, handle):
  65. return None
  66. def set_header(self, header, value=None):
  67. return None
  68. def set_html(self, html, url="http://example.com/"):
  69. return None
  70. def set_response(self, response):
  71. return None
  72. def set_simple_cookie(self, name, value, domain, path='/'):
  73. return None
  74. def submit(self, *args, **kwds):
  75. return None
  76. def title(self):
  77. return None
  78. def viewing_html(self):
  79. return None
  80. def visit_response(self, response, request=None):
  81. return None
  82. """
  83. )
  84. register_module_extender(AstroidManager(), "mechanize", mechanize_transform)