PageRenderTime 1590ms CodeModel.GetById 19ms RepoModel.GetById 1ms app.codeStats 0ms

/stubs/__pyjamas__.py

http://pyjamas.googlecode.com/
Python | 70 lines | 26 code | 10 blank | 34 comment | 3 complexity | 118f0f585f393b44d41a56047dee7b32 MD5 | raw file
Possible License(s): LGPL-2.1, Apache-2.0
  1. def decodeURI(s):
  2. """
  3. Built-in javascript function to decode a URI
  4. """
  5. def decodeURIComponent(s):
  6. """
  7. Built-in javascript function to decode a URI component
  8. """
  9. def encodeURI(s):
  10. """
  11. Built-in javascript function to encode a URI
  12. >> encodeURI(",/?:@&=+$# ")
  13. ",/?:@&=+$#%20"
  14. """
  15. def encodeURIComponent(s):
  16. """
  17. Built-in javascript function to encode a URI component
  18. >>> encodeURIComponent(",/?:@&=+$# ")
  19. "%2C%2F%3F%3A%40%26%3D%2B%24%23%20"
  20. """
  21. def escape(s):
  22. """
  23. Built-in javascript function to HTML escape a string.
  24. The escape() function encodes special characters, with the exception of:
  25. * @ - _ + . /
  26. Use the unescape() function to decode strings encoded with escape().
  27. For example:
  28. >>> escape("?!=()#%&")
  29. %3F%21%3D%28%29%23%25%26
  30. """
  31. def unescape(s):
  32. """
  33. Use the unescape() function to decode strings encoded with escape().
  34. """
  35. def JS(code):
  36. """
  37. Outputs the given javascript code as-is into the generated
  38. javascript code.
  39. """
  40. class console:
  41. """
  42. Firebug console object stub.
  43. """
  44. @staticmethod
  45. def log(x, *args):
  46. """Print to the console"""
  47. @staticmethod
  48. def error(x, *args):
  49. """Print to the console"""