Coder Social home page Coder Social logo

pyjs's Introduction

Build Status

Pyjs

Pyjs is a port of Google Web Toolkit to Python, and thus enables the development of Rich Media AJAX applications in Python, with no need for special browser plugins. Pyjs contains a stand-alone python-to-javascript compiler, and also a Widget Set API that looks very similar to Desktop Widget Set APIs (such as PyQT4 or PyGTK2).

Pyjs also contains a Desktop Widget Set version, running as pure python, with three useable Desktop ports available. With web-engine technology at it's core, HTML, CSS, plugins and other related features work out-of-the-box.

Pyjs-Compiler

Pyjs-Compiler is a collection of tools that are related to
  • compiling python code to javascript
  • linking compiled javascript modules into complete applications
  • converting java to python, etc.

Pyjs-Compiler runs your python application in a Web Browser (as javascript).

Pyjs-Widgets

Pyjs-Widgets is a collection of GUI widget libraries that can be run natively as part of Pyjs-Native or can be compiled by Pyjs-Compiler to run in a browser.

Pyjs-Desktop

While Pyjs runs your python application in a Web Browser (as javascript), Pyjs-Desktop runs exactly the same python application on the Desktop (as pure python). There are currently three engine choices, with alternatives in development.

All ports of Pyjs-Desktop require a JSON library; simplejson is recommended if the version of python is 2.5 or older. Python 2.6 and above come with a json library installed by default.

  1. XULRunner

    Install hulahop and python-xpcom. Hulahop, from OLPC SugarLabs, is distributed with both Debian and Ubuntu; python-xpcom is part of XULRunner and is also distributed with both Debian and Ubuntu. Other users should investigate the installation instructions for python-xpcom and hulahop for the operating system of their choice on the appropriate web sites.

    Older versions of XULRunner must be used: versions 1.9.0 or 1.9.1 are known to be suitable, as is version 9.0. Versions 10 and above are known to segfault.

  2. GIWebKit (GObject Introspection)

    A 95% functional binding enabled via the dynamic GObject/Python bindings produced by https://wiki.gnome.org/GObjectIntrospection after scanning the annotated WebKit sources. This backend is missing a critical piece, window.addEventListener, from https://bugs.webkit.org/show_bug.cgi?id=77835 but development is in progress to implement the missing binding via ctypes instead, due to a lack of interest by WebKit.

    This is intended to supercede XULRunner as the default on Linux once ready.

    GIWebKit must be explicitly enabled. Create a $HOME/.pyjd/pyjdrc file containing the following two lines:

    [gui] engine=giwebkit

  3. MSHTML

    For Windows users - all that's required, other than installing python and Internet Explorer, is one further tiny package: Win32 "comtypes".

    Win32 "comtypes" can be downloaded here: * http://sourceforge.net/projects/comtypes/

    Unlike the other ports, which can comprise a whopping great bundle of anything up to 30mb in size, the MSHTML port literally requires nothing more than comtypes, thanks to the far-sighted design of the MSHTML Trident Engine and its extensive COM interface.

Installation

Access our "Getting Started" wiki (https://github.com/pyjs/pyjs/wiki/GettingStarted) for get information about installation, examples, troubleshooting, etc.

For more information and documentation, see:

For issue tracking:

To join the mailing list:

IRC:

Server:irc.freenode.net
Channel:#pyjs

pyjs's People

Contributors

anthonyrisinger avatar audreyfeldroy avatar bearney74 avatar bgeron avatar bittner avatar charleslaw avatar danielkluev avatar dpopowich avatar duly avatar eukreign avatar gdw2 avatar gpitel avatar happyalu avatar jameskhedley avatar janjaapbos avatar jggatc avatar joaoventura avatar keesbos avatar laserpanda avatar maho avatar marekw2143 avatar pakal avatar pjbraby avatar rkirov avatar sarvi avatar thoka avatar tobi-weber avatar uravanbob avatar vsevolod-fedorov avatar yangofzeal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyjs's Issues

InlineHTML.py and InlineLabel.py have erroneous calls to Factory.registerClass

In InlineHTML.py and InlineLabel.py call Factory.registerClass in the last line. In the current version, commit 1b45447, the calls contain only two arguments, the file path and the object. There is a missing second argument which is the name of the object.

Hence, in InlineHTML.py,
Factory.registerClass('pyjamas.ui.InlineHTML', InlineHTML)
needs to become
Factory.registerClass('pyjamas.ui.InlineHTML', 'InlineHTML', InlineHTML)

and similarly for InlineLabel.

Diff file attached.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=685 (February 15, 2012 20:59:28)

Gradients aren't implemented for IE6 in GWTCanvas

Before reporting a problem, please UPDATE TO LATEST SVN.
As this is a community-driven project, the developers only
have time available to fix problems reported in the LATEST
code. You are welcome to report problems in any other
version, but until you have upgraded to latest svn and provided
a test report against that, you will be reliant on people
OTHER than the core developers for bug-fixes. which could
happen, so feel free to ignore the above should you so choose.

What steps will reproduce the problem?

  1. run examples/gwtcanvas/GWTCanvasDemo.py
    2.
    3.

What is the expected output? What do you see instead?

Demo text indicates known problem.

What version of Pyjamas are you using? which svn revision number?
On what operating system?
0.8 checked out from git 120309 - winXP

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?

If using PyJD, have you attached a python stack trace?

If using PyJS, what compiler options did you use?

Please provide any additional information below.
patch file attached - added additional coverage to examples/gwtcanvas/SuiteDemo.py - python newbie - so potential for improvement in python.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=699 (March 09, 2012 17:32:40)

ValueError Invalid file for CanvasProcessing example

What steps will reproduce the problem?

  1. build and install pyjs
  2. cd examples
  3. python canvasprocessing

What is the expected output? What do you see instead?
expected: successful compilation. Instead we get:

Building : CanvasProcessing
PYJSPATH : [
/mnt/run_default/newhome/ubuntu/tmp/pyjamas/examples/canvasprocessing
/mnt/run_default/newhome/ubuntu/tmp/pyjamas/library
/mnt/run_default/newhome/ubuntu/tmp/pyjamas/addons
]
Traceback (most recent call last):
File "../../bin/pyjsbuild", line 21, in <module>
pyjs.browser.build_script()
File "/mnt/run_default/newhome/ubuntu/tmp/pyjamas/pyjs/src/pyjs/browser.py", line 539, in build_script
runtime_options, args)
File "/mnt/run_default/newhome/ubuntu/tmp/pyjamas/pyjs/src/pyjs/browser.py", line 392, in build
l()
File "/mnt/run_default/newhome/ubuntu/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 275, in call
self.visit_modules(self.modules, platform)
File "/mnt/run_default/newhome/ubuntu/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 329, in visit_modules
self.visit_module(p, override_paths, platform, module_name=mn)
File "/mnt/run_default/newhome/ubuntu/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 382, in visit_module
self.keep_lib_files)
File "/mnt/run_default/newhome/ubuntu/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 158, in out_translate
deps, js_libs = parse_outfile(out_file)
File "/mnt/run_default/newhome/ubuntu/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 93, in parse_outfile
raise ValueError("Invalid file: %s" % out_file)
ValueError: Invalid file: /mnt/run_default/newhome/ubuntu/tmp/pyjamas/examples/canvasprocessing/CanvasProcessing.js

Please use labels and text to provide additional information.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=694 (February 25, 2012 16:21:13)

Logging Error in KitchenSink Example built with pyjs

What steps will reproduce the problem?

  1. Build the KitchenSink example with pyjsbuild with -d option
  2. Run it and click on one of the links in the left sidebar

What is the expected output?
The page should change to the one selected and a logging message 'onHistoryChanged:nameofnewpage' should appear at the bottom.

What do you see instead?
This traceback:
JavaScript Error: Uncaught UndefinedValueError: obj at line number 1791. Please inform webmaster.
pyjslib.py, line 118
pyjamas.History.py, line 90:

pyjamas.History.py, line 98:

KitchenSink.py, line 31:
log.writebr("onHistoryChanged: %s" % token)
pyjamas.log.py, line 16:
write(text + "\n")
pyjamas.log.py, line 12:
__logger.debug(text)
logging.py, line 858:
self._log(DEBUG, msg, _args, *_kwargs)
logging.py, line 986:
record = self.makeRecord(self.name, level, fn, lno, msg, args, exc_info, func, extra)
logging.py, line 966:
rv = LogRecord(name, level, fn, lno, msg, args, exc_info, func)
logging.py, line 190:
if args and (len(args) == 1) and args[0] and isinstance(args[0], dict):
pyjamas.Window.py, line 84:

sys.py, line 121:
stackstrings = trackstacklist(stack, limit=limit)
sys.py, line 102:
stack = _exception_from_trackstack(stack)

What version of Pyjamas are you using? which svn revision number?
Latest git eaf90a2... Merge branch 'master' of pyjs.org:pyjamas

On what operating system?
Windows 7

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?
Yes see above.

If using PyJD, have you attached a python stack trace?
It works OK under pyjd.

If using PyJS, what compiler options did you use?
-d --no-compile-inplace --no-keep-lib-files

Identical results on Firefox 11.0 and Chrome 17.0

The logging in KitchenSink worked OK in commit 8b766e5... 'allow panels floating'
The next two commits da3ef90... and a6a407f... produced a different error.
The next one 3e2c082...'corrections.to JS logging' produced the error reported above

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=706 (March 28, 2012 17:18:11)

TabBar history broken with Google Chrome (pyjs.org)

What steps will reproduce the problem?

  1. Go to http://pyjs.org
  2. Click on more than two different tabs (e.g. 2nd, 4th, 5th tab)
  3. Use Chrome's back button to go back more than two tabs/pages

What is the expected output? What do you see instead?

  • The browser should go back to the last, one-before-last, two-before-last, etc. tab
  • Instead, in Chrome, it jumps between the current and the last tab. (You can only reach a tab beyond the last one by pressing and holding the back button: That shows, recording the history seems to work.)

Please provide any additional information below.

  • This is the current behaviour of the pyjs website
  • OS: Linux (Ubuntu 11.10 oneiric)
  • Browser: Google Chrome 9.0.576.0 dev

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=689 (February 21, 2012 10:49:08)

pyjamas sites fail with addEventListener error in IE 9

I'm a pyjamas noob so apologies in advance if I'm posting in the wrong place. Using Internet Explorer 9 (9.0.8.112.16421) on Windows 7, I get an error when navigating to the pyjamas sites referenced at pyjs.org:

index TypeError: Object doesn't support property of method 'addEventListener'

I'm reporting here because

  • sites that fail: http://tickery.net/
    everything under http://pyjs.org/examples/
  • these are other people's sites, not my code
  • the sites display properly using firefox and chrome
  • the sites are completely blank on IE 9
  • tried on 2 different windoze machines with same result
  • deleting browser history doesn't help
  • http://pyjs.org itself displays properly

The generated source I see for http://pyjs.org/examples/asteroids/output/Space.html:

<html>
<!-- auto-generated html - you should consider editing and
adapting this to suit your requirements
-->
<head>
<meta name="pygwt:module" content="Space">

<title>PyJamas Space Game</title>
</head>
<body bgcolor="white">
<script language="javascript" src="bootstrap.js"></script>
<iframe id='__pygwt_historyFrame' style='width:0;height:0;border:0'></iframe>

<!-- Start of StatCounter Code -->
<script type="text/javascript" language="javascript">
var sc_project=2659074;
var sc_invisible=1;
var sc_partition=26;
var sc_security="53230453";
</script>

<script type="text/javascript" language="javascript" src="http://www.statcounter.com/counter/counter.js&quot;&gt;&lt;/script&gt;&lt;noscript&gt;&lt;a href="http://www.statcounter.com/" target="_blank"><img src="http://c27.statcounter.com/counter.php?sc_project=2659074&amp;java=0&amp;security=53230453&amp;invisible=0" alt="free hit counter" border="0"></a> </noscript>
<!-- End of StatCounter Code -->

</body>
</html>

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=707 (April 01, 2012 21:46:26)

#591 - still problem with (in _callfunc)

I'm not sure if I'm able to reopen #591 - seems I'm not.

However, I got the same (similar) error today, with most recent pyjamas sources.

Code is:

v+

_dto = (self.date_to.getDate()+timedelta(days=32)).replace(day=1)

v-

And got such traceback:

v+

maho@dlaptop:~/[...]py$ bash build.sh

  • '[' -n '' ']'
  • '[' 0 = 1 ']'
  • /home/maho/pyjamas/bin/pyjsbuild --no-compile-inplace -o ../../pyjs all
    Building : all
    PYJSPATH : [
    /home/maho/[...]py
    /home/maho/pyjamas/library
    /home/maho/pyjamas/addons
    ]
    Translating : [...]lib/py/all.py
    Traceback (most recent call last):
    File "/home/maho/pyjamas/bin/pyjsbuild", line 21, in <module>
    pyjs.browser.build_script()
    File "/home/maho/pyjamas/pyjs/src/pyjs/browser.py", line 555, in build_script
    runtime_options, args)
    File "/home/maho/pyjamas/pyjs/src/pyjs/browser.py", line 408, in build
    l()
    File "/home/maho/pyjamas/pyjs/src/pyjs/linker.py", line 254, in call
    self.visit_modules(self.modules, platform)
    File "/home/maho/pyjamas/pyjs/src/pyjs/linker.py", line 306, in visit_modules
    self.visit_module(p, override_paths, platform, module_name=mn)
    File "/home/maho/pyjamas/pyjs/src/pyjs/linker.py", line 359, in visit_module
    self.keep_lib_files)
    File "/home/maho/pyjamas/pyjs/src/pyjs/linker.py", line 145, in out_translate
    raise translator.TranslationError(stderr_value, None)
    pyjs.translator_proto.TranslationError: line Unknown:
    Traceback (most recent call last):
    File "translator.py", line 73, in <module>
    main()
    File "translator.py", line 60, in main
    *_get_compile_options(options))
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 4349, in translate
    module_name, sources[0], src, tree, output, *_kw)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 859, in init
    self._class(child)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 2779, in _class
    self._stmt(child, current_klass)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 3053, in _stmt
    self._function(node, current_klass)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 2124, in _function
    return self._method(node, current_klass)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 2939, in _method
    self._stmt(child, current_klass)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 3035, in _stmt
    self._assign(node, current_klass)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 3290, in _assign
    rhs = self.expr(node.expr, current_klass)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 4207, in expr
    return self._callfunc(node, current_klass, optlocal_var=True)
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 2454, in _callfunc
    optlocal_var=optlocal_var,
    File "/home/maho/pyjamas/pyjs/src/pyjs/translator_proto.py", line 2388, in _callfunc_code
    "unsupported type (in _callfunc)", v.node.expr, self.module_name)
    translator_proto.TranslationError: all line 85:
    unsupported type (in _callfunc)
    Add((CallFunc(Getattr(Getattr(Name('self'), 'date_to'), 'getDate'), [], None, None), CallFunc(Name('timedelta'), [Keyword('days', Const(32))], None, None)))

None

v-

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=679 (January 28, 2012 18:33:27)

Extra white space on top of page caused by invisible iframes

Pyjamas applications have a blank (em-sized) line on top of the displayed page, which is not fixed by setting border/margin/padding of body and html to zero.

The extra white space is caused by iframes that are added to the HTML document, e.g. the history iframe or the <top_module>.nocache.html iframe.

What steps will reproduce the problem?

  1. Go to http://pyjs.org -> notice the blank line (whitespace) above the violet header
  2. Analyse the HTML/CSS -> notice that border/margin/padding of elements such as html, body, etc. are all set to 0 (zero)
  3. Use Firebug (or equivalent) to set the following style on all iframes present on the page: "display: none;" -> notice that the unwanted blank line disappears

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=691 (February 23, 2012 16:32:34)

Regular expression module re: findall method fails new libtests

I have some code which makes use of the re module. I recently introduced a modification which uses re.findall() and found that the current implementation of findall() does not produce the same output as the python version of the re module.

I have created new libtests which test this behaviour.

The first test uses an example from the Python 2.7.2 Library Reference paragraph 2.7.2.6.
The regex is r'\w+ly' and the test string is
'He was carefully disguised but captured quickly by police.'
findall should return the list: ['carefully', 'quickly']

The second test is based on the code used for the implementation of the template string class, string.Template.
The regex is
r'$(?:($)|([_a-z][a-z0-9])|{([_a-z][a-z0-9])}|())'
The test string is
'Here is $$some $text which contains ${some} $2 placeholders'
and findall should return the list
[('$', '', '', ''), ('', 'text', '', ''), ('', '', 'some', ''), ('', '', '', '')]

Both these tests currently fail but would be passed after minor changes to the implementation of re.findall.

I attach two diff files:
ReModuleTest.diff adds the new libtests for findall
re.diff modifies the findall code so that the new tests are passed.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=703 (March 16, 2012 19:11:34)

TextBox placeholder does not work - patch

> What steps will reproduce the problem?
email = TextBox(Placeholder='email')

> What is the expected output? What do you see instead?
placeholder attribute is expected, but got error instead.

> What version of Pyjamas are you using? which svn revision number?
latest pyjamas from Sun Jan 22 07:32:42, 6ad92a8

> On what operating system?
Patch proposed is checked on pyjd/hulahop, firefox 8.0 and chrome 13.

Works with attached patch, please add it to pyjamas.
Under pyjd/pylahop it won't display placeholder, but at least won't fail.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=678 (January 22, 2012 08:57:09)

Release 0.8.1 Test: Debian, Wine (!), IE8

libtest: partially ok.

ClassTest Test failed (testDynamicLoading/30) : 'This is an example' != 'This is an en_US example'
ClassTest Test failed (testDynamicLoading/32) : 'This is a domain example' != 'This is a domain en_US example'
ClassTest Test failed (testDynamicLoading/34) : 'This is a subdomain example' != 'This is a subdomain en_US example'
ClassTest Test failed (testDynamicLoading/36) : 'This is another example' != 'This is en_US another example'
ClassTest Test failed (testDynamicLoading/38) : 'This is another example' != 'This is en_US another example'
StringTest Test failed (testToString/126) : 'instance of StringTest.ClassWithOwnToString' != 'ClassWithOwnToString as a String'
StringTest: Passed 128 / 129 tests (1 failed)
TemplateStringTest Test failed (test__invalid1/3) : uncaught exception: ''
TemplateStringTest Test failed (test_safe_substitute/6) : 'This is a test of the $ method of the $ class' != 'This is a test of the safe_substitute method of the ${second} class'
TimeModuleTest Test failed (testStrptime/20) : (0, 1, 1, 0, 0, 0, 5, 1, -1) != (2000, 1, 1, 12, 34, 0, 5, 1, -1)
TimeModuleTest Test failed (testStrptime/22) : (0, 1, 1, 0, 0, 0, 5, 1, -1) != (2000, 7, 1, 12, 34, 0, 5, 183, -1)
TimeModuleTest Test failed (testStrptime/24) : (0, 1, 1, 0, 0, 0, 5, 1, -1) != (2000, 1, 1, 12, 34, 0, 5, 1, -1)
TimeModuleTest: Passed 39 / 44 tests (5 failed)
DatetimeModuleTest Test failed (testStrptime/8) : '0000-01-01 00:00:00' != '2000-01-01 12:34:00'

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=720 (April 14, 2012 12:40:08)

codecs.py b"" destroys ability to use python2.5

def getstate(self):
    &quot;&quot;&quot;
    Return the current state of the decoder.

    This must be a (buffered_input, additional_state_info) tuple.
    buffered_input must be a bytes object containing bytes that
    were passed to decode() that have not yet been converted.
    additional_state_info must be a non-negative integer
    representing the state of the decoder WITHOUT yet having
    processed the contents of buffered_input.  In the initial state
    and after reset(), getstate() must return (b&quot;&quot;, 0).
    &quot;&quot;&quot;
    return (b&quot;&quot;, 0)

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=702 (March 15, 2012 12:44:51)

pygwt.getModuleBaseURL() always returns file:// on Windows

Before reporting a problem, please UPDATE TO LATEST SVN.
Done that!

What steps will reproduce the problem?

  1. Create any simple pyjd application which imports pygwt and includes the line
    print pygwt.getModuleBaseURL()
    for instance in the OnModuleLoad method
  2. Run the program on Windows direct from the file system, not using a local server.

What is the expected output? What do you see instead?
Expect to see
file://path_to_html_file
Instead, always get
file://

The problem is obvious from the code of pygwt

def getModuleBaseURL():

# get original app base
s = get_main_frame().getUri()
# at this point s will be something like
# &quot;file://C:\\path\\to\\my\\htmlfile.html&quot;
... some code omitted ...    

# Rip off everything after the last slash.
i = s.rfind('/')
if i != -1:
    s = s[:i]
# whoops, everything except file:// has gone!
if len(s) &gt; 0:
    return s + &quot;/&quot;
return &quot;&quot;

Since Windows is happy with '/' as a path separator I suggest fixing the problem by calling
s = s.replace('','/') after the call to get_main_frame().getUri()

I have attached a diff for this change.

This problem is part of the reason why images go missing in some widgets such as Tree and DisclosurePanel in pyjd. I will post another bug report about that.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=714 (April 09, 2012 17:24:26)

Escaping % sign (e.g. %20) breaks links with white space

On http://pyjs.org all links that lead to the "Getting Help" tab/page either produce a "#Getting%25%20Help" anchor (note the %25) or simply don't work (in pyjd). Affected browsers: FF/Linux+Win7, Safari/iPad; (Chrome 16, Opera 11, IE 9 work fine)

What steps will reproduce the problem?

  1. Go to http://pyjs.org
  2. Scroll down, click on "mailing list" (a link)

What is the expected output? What do you see instead?

Please use labels and text to provide additional information.
Affected browsers: Firefox, Safari
Partially affected browsers: Firefox (v10/Ubuntu, v6/Win7) with odd behavior: address is wrong but tab switch works
Works with: IE 9 (Win7), Opera 11 (Ubuntu)

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=695 (February 28, 2012 12:57:12)

strptime doesn't parse date with miliseconds

  • What steps will reproduce the problem?
  • _placed = datetime.strptime(_placed,"%Y-%m-%d %H:%M:%S.%f"), where _placed is '2012-01-31 13:33:43.874141'

in pyjs compiled code with --debug, in Firefox 9.0.1

  • What is the expected output?

I would expect _placed to be datetime(2012,1,31,13,33,43) object

  • What do you see instead?

In firebug console, under debug info

ValueError: Invalid or unsupported values for strptime: '2012-01-31 13:33:43.874141', '%Y-%m-%d %H:%M:%S.%f' Traceback: pyjslib.py, line 22 gwt.HTTPRequest.py, line 50: raise RuntimeError("Invalid call to asyncPut: handler is not a valid request handler") gwt.JSONService.py, line 224: self.request.handler.onRemoteResponse(response["result"], orders.py, line 49: _placed = datetime.strptime(_placed,"%Y-%m-%d %H:%M:%S.%f") datetime.py, line 223: return self.fromtimestamp(_strptime(datestring, format)) time.py, line 335: raise ValueError("Invalid or unsupported values for strptime: '%s', '%s'" % (datestring, format))

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=680 (January 31, 2012 22:05:43)

Images used by Tree.py and DisclosurePanel.py are not found by pyjd.

Before reporting a problem, please UPDATE TO LATEST SVN.
Done that, but this is an old problem

What steps will reproduce the problem?

  1. Run a program such as the KitchenSink example, which uses widgets like Tree and DisclosurePanel, under pyjd

What is the expected output? What do you see instead?
The page using the Tree widget should show nice little square images
with crosses in them for opening the the tree branches. Similarly, the DisclosurePanel (in Layout on KitchenSink) should have a triangular open or close button.
Under pyjd you just see something indicating that the images couldn't be located.

On what operating system?
I'm using Windows but I think this applies to any pyjd implementation

The required images are located in library/pyjamas/public. Apparently, pyjsbuild magically copies them to the output directory, so they are found without problems by the resultant javascript.

Under pyjd however, there is no mechanism for copying them to the public directory and nothing to tell you that you need to do that manually, or even where to find them.

Maybe, in the example programs, they should be bundled in with the public directory.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=715 (April 09, 2012 17:50:33)

chrome vs fox: onMouseEnter/Leave

What steps will reproduce the problem?

say i have a panel A with a second smaller panel B inside.
Both have mousehandlers.

Say my mouse pointer is already inside A, but not B and then I move
the pointer into B and then back out.

In firefox:
*when i move cursor into B: B triggers onMouseEnter twice.
*when i move cursor off B: B triggers onMouseLeave once, A triggers
onMouseEnter twice

chrome:
*when i move cursor into B: B triggers onMouseEnter once.
*when i move cursor off B: B triggers onMouseLeave once.

What is the expected output? What do you see instead?

What version of Pyjamas are you using? which svn revision number?
On what operating system?

Latest pyjs/firefox/chrome as of mid feb 2012. Windows 7 starter.

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?

If using PyJD, have you attached a python stack trace?

Not used PYJD

If using PyJS, what compiler options did you use?

-d

Please provide any additional information below.

Luke suggested I would check if the problem exists in GWT, so i posted on their newgroup:

http://groups.google.com/group/google-web-toolkit/browse_thread/thread/303e6d9fac03f07f#

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=682 (February 14, 2012 16:57:50)

pyjamas.ui.HTML does not display utf-8 characters as it should

What steps will reproduce the problem?

  1. Use the kitchensink example
  2. Edit the file Info.py
  3. Add encoding line at the top of the file

    -- coding:utf-8 --

  4. Add öäüéàè to the HTML Element
  5. ./build.sh
  6. Open output/KitchenSink.html in a browser
    e.g. firefox output/KitchenSink.html

What is the expected output?
In the info tab we should see öäüéàè

What do you see instead?
Instead of öäüéàè we see some crud.

What version of Pyjamas are you using?
commit 84cd6e5

On what operating system?
Archlinux

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=683 (February 15, 2012 14:37:25)

pyjs math.py hypot is missing

What version of Pyjamas are you using? which svn revision number?
On what operating system?

git HEAD, Debian Squeeze

I missed the function hypot in pyjs (it's working with pyjd of course), so here is the diff:

index e074799..72cf9b4 100644
--- "a/C:\DOKUME1\user\LOKALE1\Temp\mat69.tmp\math-HEAD-left.py"
+++ "b/E:\Projects\pyjamas\pyjs\src\pyjs\lib\math.py"
@@ -52,3 +52,7 @@ def degrees(x):

def radians(x):
return x * pi / 180
+
+def hypot(x,y):

  • return sqrt(x_x + y_y)
  • \ No newline at end of file

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=705 (March 23, 2012 11:39:21)

AttributeError: 'module' object has no attribute 'path' when compiling pyjamas-0.8a1 examples

What steps will reproduce the problem?

  1. Installed pyjamas-0.7 to ~/tmp/pyjamas-0.7/ from pypi tgz package. Built the 'examples' directory without issues and browsed example gallery using localhost. So far so good.
  2. Installed pyjamas-0.8a1
  3. tried to build the 'examples' directory by doing cd examples &amp;&amp; python .

What is the expected output? What do you see instead?

Expected: pyjamas-0.7 like example output with a short compilation OK message. Instead I get an AttributeError from translating sys.py (see attached)

Environment:

Mac OS X Snow Leopard 10.6.8 Intel/i386 running python-2.7.2 from macports. Problem also happens in python-2.6.7 from macports package.

Additional info:

I'm a newbie to pyjamas but have expert knowledge of python and other stuff. I was expecting my first git clone to work out of the box instead of having to fall back to 0.7. Maybe someone could point this out in the tutorial (if the problem's not my system).

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=677 (January 11, 2012 18:44:50)

GWTCanvas doesnt work in PYJD on Windows + FIX

Before reporting a problem, please UPDATE TO LATEST SVN.
As this is a community-driven project, the developers only
have time available to fix problems reported in the LATEST
code. You are welcome to report problems in any other
version, but until you have upgraded to latest svn and provided
a test report against that, you will be reliant on people
OTHER than the core developers for bug-fixes. which could
happen, so feel free to ignore the above should you so choose.

What steps will reproduce the problem?

from pyjamas.Canvas.GWTCanvas import GWTCanvas
self.canvas = GWTCanvas(300, 150)

What is the expected output? What do you see instead?

Expect to see a canvas, get this:

Traceback (most recent call last):
File "LW003.py", line 252, in <module>
x = LW()
File "LW003.py", line 238, in init
self.game = Game(self)
File "LW003.py", line 71, in init
self.canvas = GWTCanvas(300, 150)
File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\Canvas\GWTCanvas.py", line 78, in init
self.setPixelWidth(pixelX)
File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\Canvas\GWTCanvas.py", line 610, in setPixelWidth
FocusWidget.setWidth(self, width)
File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\ui\UIObject.py", line 222, in setWidth
DOM.setStyleAttribute(self.element, "width", str(width))
File "C:\Users\Gustaf\tools\pyjamas\library\pyjamas\DOM.py", line 897, in setStyleAttribute
element.style.setProperty(mash_name_for_glib(name), value, "")
File "C:\Python26\lib\site-packages\comtypes\client\lazybind.py", line 163, in caller
return self._comobj._invoke(descr.memid, descr.invkind, 0, *args)
File "C:\Python26\lib\site-packages\comtypes\automation.py", line 664, in _invoke
dp, var, None, argerr)
_ctypes.COMError: (-2147024809, 'The parameter is incorrect.', (None, None, None, 0, None))

What version of Pyjamas are you using? which svn revision number?
On what operating system?

93700ab (?)

Windows 7 starter (32bit)

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?

If using PyJD, have you attached a python stack trace?

see above

If using PyJS, what compiler options did you use?

Please provide any additional information below.

Found the problem to be that FocusWidget was called with an int value when it expected a css string. Fixed it and patch is attached.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=696 (February 28, 2012 13:21:38)

Pyjamas book example code does not run as is.

Before reporting a problem, please UPDATE TO LATEST SVN.
As this is a community-driven project, the developers only
have time available to fix problems reported in the LATEST
code. You are welcome to report problems in any other
version, but until you have upgraded to latest svn and provided
a test report against that, you will be reliant on people
OTHER than the core developers for bug-fixes. which could
happen, so feel free to ignore the above should you so choose.

What steps will reproduce the problem?
1.Copy the code for class AbsolutePanelDemo from the book into a file and create an AbsolutePanelDemo.
2.
3.

What is the expected output? What do you see instead?
Expected output: normally running application with an AbsolutePanelDemo in the application window.
You will get an error about this line:DOM.setIntAttribute(wrapper.getTable(), "cellPadding", 10): set_main_frame <pyjd.pywebkitgtknew.Browser instance at 0x9445a6c>
Traceback (most recent call last):
File "/home/xxx/workspace/Hello/Hello.py", line 51, in <module>
ap = AbsolutePanelDemo()
File "/home/xxx/workspace/Hello/AbsolutePanelDemo.py", line 15, in init
panel.add(self.makeBox("Child 1"), 20, 10)
File "/home/xxx/workspace/Hello/AbsolutePanelDemo.py", line 27, in makeBox
DOM.setIntAttribute(wrapper.getTable(), "cellPadding", 5)
File "/home/xxx/pyjamas/library/pyjamas/DOM.py", line 879, in setIntAttribute
setattr(elem, attr, int(value))
TypeError: _wrap_corehtmltableelement__set_cellPadding() argument must be string, not int .

What version of Pyjamas are you using? which svn revision number?
On what operating system?
OS: Ubuntu, 11.10
Pyjamas: 0.8alpha1

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?
I got the error from Pyjamas-Desktop

If using PyJD, have you attached a python stack trace?
See above.

If using PyJS, what compiler options did you use?

Please provide any additional information below.
Additional errors on the example code for http://pyjs.org/book/output/Bookreader.html#UI%20Module (UI Module): all eventhandlers such as onClose(self) lack 1 parameter. If you try to run this code, it gives an error that some function needs 2 parameters. The solution is to modify the code to onClose(self, sender). Same for hideRows and showRows a bit down on the same page - in FlexTableDemo.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=710 (April 08, 2012 18:49:50)

Patch adding demo non-flash upload widget with progress

Hi

In my never ending quest to rid the world of dodgy plug-ins like Flash, I have constructed for you a demonstration of an uploader which does everything SWFUpload does, but with Flash! So far it has been tested on FF >=4 and Chromium 6, makes no sense on pyjd. No idea about IE, sorry. Also included a little demo wsgi script, which is probably very bad.

Patch attached, could this go in before the next release please?

Cheers

James

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=716 (April 11, 2012 00:14:35)

Showcase strange behavior

Using the latest git of pyjs.

On chrome 17.0.963.46, the showcase example has an issue with clicking on the tree items. Sometimes they work sometimes I get:

JavaScript Error: Uncaught TypeError: unsupported operand type(s) for +: 'slice( gwt-TreeItem gwt-TreeItem-selected, 0, 13)', 'slice( gwt-TreeItem gwt-TreeItem-selected, 35, None)' at line number 20351. Please inform webmaster.
pyjslib.py, line 39
pyjamas.DOM.py, line 561:
"""
pyjamas.DOM.py, line 585:
try:
pyjamas.Window.py, line 84:

sys.py, line 121:
stackstrings = trackstacklist(stack, limit=limit)
sys.py, line 102:
stack = _exception_from_trackstack(stack)

This appears to be relatively random. That is just clicking 2-3 times seems to get through. Sometimes the first click works sometimes it takes 3 trys.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=686 (February 15, 2012 23:14:51)

PYJD and PYJS handle non-ascii characters differently in text widgets

What steps will reproduce the problem?

  1. Create a TextBox or TextArea widget
  2. call widget.setText(somestring) where somestring contains a non-ascii character such as the UK pound character
  3. Alternatively, type a string with a non-ascii character into the widget and then call widget.getText()

If you are running PYJS, it will work correctly. If you are running PYJD and exception will be thrown in both cases, giving the error message (for a UK pound character):

UnicodeEncodeError: 'ascii' codec can't encode character u'\xa3' in position 0: ordinal not in range(128)

The reasons are obvious:

The TextBoxBase implementation of setText(text) is
DOM.setAttribute(self.getElement(), "value", str(text))

for getText() it has:
return DOM.getAttribute(self.getElement(), "value")
but DOM.getAttribute(elem, attr) is:
attr = getattr(elem, attr)
if attr is None:
return None
return str(attr)

In both cases the text is being passed through the str() builtin function which in Python (hence in PYJD) will throw the observed exception if it encounters any non-ascii characters.
But in Javascript, strings are UTF16 and apparently the implementation of the str() function in PYJS tolerates non-ascii characters.

Possible solution:

Change str() to unicode() in DOM.getAttribute and DOM.getElementAttribute() as appropriate and do the same in TextBoxBase.setText()

What version of Pyjamas are you using? which svn revision number?
4353ada...
I know this is not the latest but it is very recent and I don't think any changes have been made in DOM or TextBox base in a long time.

On what operating system?
Windows 7

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=681 (February 02, 2012 16:39:09)

Various

This isn't a bug. It belongs on the mailing list.

The first problem is I (russell-pyjs AT stuart.id.au) can't join the mailing list. Initially this was because a configuration error on my end, but my end is working now and I don't get a response from [email protected].

I am using pyjamas on Debian (0.7 is the most recent version on Debian), and was going through the tutorial in the manual. At one point the manuals says to run "python ../../pyjs/pyjs.py TestRect.py". There is no pyjs.py in the debian packages. I thought that might be because I was looking at the 0.8 doco and using 0.7. Turn out there is no pyjs.py in the 0.8 tar ball either, so I was barking up the wrong tree. Anyway, I didn't know that, so ...

The first question I wanted to ask on the mailing list was about the status of pyjamas-0.8alpha1.tar.bz2. 0.7 is the version of pyjamas available on debian. I am an Debian Maintainer, so I thought a solution to the doco problem would be to package 0.8, it being the current stable version. But there is no pyjamas-0.8.tar.bz2. Clicking on even pyjamas-0.8 on source forge takes you to pyjamas-0.8aplha1.tar.bz2. Is pyjamas-0.8alpha1.tar.bz2 the stable version?

Packaging 0.8alpha1 went OK for a while, until I hit the documentation. The README.txt in the tar ball is for 0.7. I patched over that, then noticed all the pages in the documentation are stamped with 0.7 as well. I decided to ignore that, but then realised the API documentation wasn't built (the file the /api link doesn't exist), and I don't have a clue how to build it. This seems like it would be important as the reason I was looking at 0.8 is the documentation didn't work too well in the debian package of 0.7, which is why I used the web site, and mismatches between the web site doco and 0.7 is why I was trying to package 0.8. In the end I put this down to 0.8alpha1 being alpha code, and gave up. Is there an up to date tar ball for 0.8, where the doco matches the source?

Back onto 0.7 now, and having done a few examples I decided to run them in pyjamas-desktop, as the manual emphasises using pyjamas-desktop as a debugging tool. The README.txt debian installs for pyjamas-desktop sends you to pyjd.org, which says it was superseded by pyjs.org as of 0.6. Anyway I couldn't find any documentation on python-desktop on pyjs.org.

That aside, the instructions in the README.txt say "install hulahop and python-xpcom" which I have done. But having done that, it doesn't say anymore, and in particular it is silent on how to run a pyjamas app under pyjamas-desktop. A simple "python Hello.py" gives the expected "ImportError: No module named pyjamas". Some wiki howto say to run pyjd, but the debian pyjamas-desktop package doesn't install executables, and in particular there is no pyjd executable. I am at a bit of a loss as to what else to try. Can you give me a clue?

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=722 (April 24, 2012 04:25:58)

ParseError on datefield example

What steps will reproduce the problem?

  1. build and installed pyjs
  2. cd examples
  3. python datefield

What is the expected output? What do you see instead?
expected: compilation succeeds. Instead I get:

Building : DateField
PYJSPATH : [
/Users/msyang/tmp/pyjamas/examples/datefield
/Users/msyang/tmp/pyjamas/library
/Users/msyang/tmp/pyjamas/addons
]
Translating file : /Users/msyang/tmp/pyjamas/examples/datefield/DateField.py
Traceback (most recent call last):
File "/Users/msyang/tmp/pyjamas/bin/pyjsbuild", line 21, in <module>
pyjs.browser.build_script()
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/browser.py", line 539, in build_script
runtime_options, args)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/browser.py", line 392, in build
l()
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 275, in call
self.visit_modules(self.modules, platform)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 329, in visit_modules
self.visit_module(p, override_paths, platform, module_name=mn)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 382, in visit_module
self.keep_lib_files)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/linker.py", line 151, in out_translate
raise translator.TranslationError(stderr_value, None)
pyjs.translator_proto.TranslationError: line Unknown:
Traceback (most recent call last):
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/translator.py", line 69, in <module>
main()
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/translator.py", line 56, in main
**get_compile_options(options))
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/translator_proto.py", line 4421, in translate
current_tree = compiler.parseFile(src)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pycompiler/transformer.py", line 51, in parseFile
return parse(src)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pycompiler/transformer.py", line 55, in parse
return Transformer().parsesuite(buf)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pycompiler/transformer.py", line 132, in parsesuite
return self.transform(parser.suite(text))
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pyparser/init.py", line 8, in suite
return d.parse_string(text)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pyparser/driver.py", line 104, in parse_string
return self.parse_tokens(tokens, debug)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pyparser/driver.py", line 69, in parse_tokens
if p.addtoken(type, value, (prefix, start)):
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pyparser/parse.py", line 138, in addtoken
ilabel = self.classify(type, value, context)
File "/Users/msyang/tmp/pyjamas/pyjs/src/pyjs/lib_trans/pyparser/parse.py", line 194, in classify
raise ParseError("bad token", type, value, context)
pyparser.parse.ParseError: bad token: type=55, value='\xef', context=('', (1, 0))

None

What version of Pyjamas are you using? which svn revision number?
On what operating system?

git pull from git://pyjs.org/git/pyjamas.git commit 65b360c
python 2.7.2 on Mac OS X or python 2.7.1 on Ubuntu 11.04

If using PyJS, what compiler options did you use?

None.

Please provide any additional information below.

DateField.py module says "Copyright (C) 2009 Yit Choong (http://code.google.com/u/yitchoong/)"

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=693 (February 25, 2012 15:00:54)

Logging module should mimic CPython's logging module

Pyjamas provides a log module, which can be used as follows:

import pyjd
from pyjamas import log
log.write("This test is appended to the end of the document body")

The log functions, as of today, append text to the end of the document body. This should be made more flexible (e.g. allow use of Firebug's console.log() function, window.alert() popups, etc). Also, there are no logging levels that allow logging statements to be left in the code (being ignored when the logging level is set higher).

What steps will reproduce the problem?

  1. Analyze pyjamas/library/log.py with regard to flexibility
  2. Compare with Python logging module: http://docs.python.org/howto/logging.html

What is the expected output? What do you see instead?
CPython allows specifying the output format and log level:
import logging
logging.basicConfig(format='%(levelname)s:%(message)s', level=logging.DEBUG)
logging.debug('Print only for level DEBUG an below')
logging.warn('This is a warning')

Pyjamas should support that in a similar way: e.g.
from pyjamas import logging

(rest identical as above)

Please use labels and text to provide additional information.
The following examples should also work: (As in Python's Logging HOWTO)

  1. Format string support:
    logging.warning('%s before you %s', 'Look', 'leap!')

  2. Date/time in output string:
    logging.basicConfig(format='%(asctime)s %(message)s')
    logging.warning('is when this event was logged.')

  3. Date/time format specification:
    logging.basicConfig(format='%(asctime)s %(message)s',
    datefmt='%m/%d/%Y %I:%M:%S %p')
    logging.warning('is when this event was logged.')

  4. Logging levels should be (numerically) identical to the CPython implementation

  5. Follow the modular approach of the CPython implementation:

  • Loggers expose the interface that application code directly uses.
  • Handlers send the log records (created by loggers) to the appropriate destination.
  • Filters provide a finer grained facility for determining which log records to output.
  • Formatters specify the layout of log records in the final output.

5.a) The 'root' logger should be called 'pyjs' (make message source crystal clear!)
5.b) Default handler should be the appender to document.body (works with all browsers!)

  1. Implement the current log function using the new logger implementation, and document the log functions (write, writebr) as @deprecated: (e.g. in log.py)

logger = logging.getLogger('pyjs') # Pyjamas' default logger name
logger.basicConfig(method=append, format='%(message)s', level=logging.DEBUG)

def write(text):
"""@deprecated(since=..., replacement=logging.debug)"""
logger.debug(text)

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=701 (March 11, 2012 23:53:02)

Popup calendar gives wrong dates in certain time zones

Before reporting a problem, please UPDATE TO LATEST SVN.
As this is a community-driven project, the developers only
have time available to fix problems reported in the LATEST
code. You are welcome to report problems in any other
version, but until you have upgraded to latest svn and provided
a test report against that, you will be reliant on people
OTHER than the core developers for bug-fixes. which could
happen, so feel free to ignore the above should you so choose.

What steps will reproduce the problem?

  1. Set your computer's time zone to somewhere in the western hemisphere (UTC - x, where x is positive). Do this before opening your web browser, so your web browser is synced to that time.
  2. Run the DateField example, either from your copy of Pyjamas or by going to the online demo at http://pyjs.org/examples/datefield/output/DateField.html.
  3. Click one of the calendar icons to bring up the popup calendar. The days are offset by one to the left (for example, it says April 1, 2012 is a Saturday instead of a Sunday).
  4. Click any date to have it fill in the datefield. The date filled in does not match the displayed date you clicked on. Instead, it is the date that should have been displayed if the popup calendar were correct.
  5. Click the calendar icon again. Select "Yesterday", "Today", or "Tomorrow". The date inserted into the datefield is offset one to the left of what it should be.

What is the expected output? What do you see instead?

  • See the above steps for expected and actual output at each step.

What version of Pyjamas are you using? which svn revision number?
On what operating system?

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?

  • Sorry, no stack trace, logging, etc. If I find time to come back to the problem, I'll add more documentation. In the meantime, I'm at least submitting the issue so that people are aware of it.

If using PyJD, have you attached a python stack trace?

  • No. The problem does not occur in pyjd. It is specific to the Javascript created by pyjs.

If using PyJS, what compiler options did you use?

  • None.

Please provide any additional information below.

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=709 (April 03, 2012 16:43:52)

Building a working pyjamas desktop on Mac OS X using webkit gtk+

I am posting here because I haven't figured out how to post a git patch to the wiki. There are a number of Darwin specific issues that are somewhat the fault of Apple, WebKit, etc. Anyhow, I have based my work from the python_codegen branch with revision 103cf3b45b16462a70de35d082d3100b7ee87e59.

Please excuse the commented out lines in WebKitTools/GNUmakefile.am as I didn't take the time to repair the issues arising from the fact that this WebKit code still tries to use QuickDraw which has been deprecated by Apple and either doesn't fully exist in Mac OS 10.6.8 or has been sufficiently changed to make it a pain to try to compile some of the WebKitTools.

Please check http://pyjs.org/wiki/pyjamasmaxosxwebkitgtk/ for more information

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=704 (March 17, 2012 04:22:39)

Logging module: Update of FAQ answer (debug output) needed

The FAQ question on debug output is out-of-date as it doesn't mention the log() function available in Pyjamas as follows:

import pyjd
from pyjamas import log
log("This test is appended to the end of the document body")

What steps will reproduce the problem?

  1. Go to http://pyjs.org#FAQ
  2. Search for the question "I want to throw some debug output onto the screen, how do I best do that?"

What is the expected output? What do you see instead?
The FAQ answer should mention the Pyjamas logging facility (e.g. "from pyjamas import log") with an appropriate example.
Currently, the info there is outdated (the last example is practically the implementation of the log function).

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=700 (March 11, 2012 23:02:48)

Form examples in examples/showcase

Someone a few years back showed how to do "click-jacking". Now, many sites, such as google, set a custom X-frame-options header to be only ORIGIN. This will not allow the html to be displayed in an iframe by browsers that respect that header. In short, for the showcase example, all of the forms use google search as an example.

There are many options to fix this:

  1. use a different url with a form that is static (url won't change, url will continue to exist, etc). and either set X-frame-options to allow embedding in an iframe, or don't even set the x-frame-options header.
  2. find a google url that allows embedding a search results page
  3. add some crud to the example to (if such a thing exists) add cruft to the returned google url to allow it to be embedded in an iframe (this is currently allowed, or was for google maps, but I haven't found the required option for google search results).

Comments

  • a standard google search sets x-frame-options to ORIGIN -- must respect this (well, browser does it for us).
  • google.com/custom fails with 403 if you specify a search via url (e.g. google.com/custom?q=red)
  • we could require one to start a simple http server to serve up a form (as is done by the jsonrpc example).

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=688 (February 16, 2012 14:40:59)

Comparison of lists with objects not working?

> What steps will reproduce the problem?

The following code runs fine in Python, but asserts in Firefox 11.0 when compiled with pyjs.

class C:
def init(self, value):
self.value = value

def __eq__(self, other):
    return self.value == other.value

assert [1, 2, 3] == [1, 2, 3] # OK
assert [C(1), C(2), C(3)] == [C(1), C(2), C(3)] # fails

>>> What version of Pyjamas are you using? which svn revision number?
On what operating system?

I'm using pyjamas-0.8.1~+alpha1 (same with older versions) on Mac OS X 10.6.

>>> If using PyJS, what compiler options did you use?
-d

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=721 (April 22, 2012 21:36:04)

HTML file should be clean (for Pyjamas Desktop) => inject Pyjamas "magic" at compile time

The HTML file for a pyjs application contains several tags that are only necessary for the pure Javascript version of the resulting application.

We should keep the HTML file clean from things that are not needed by Pyjamas Desktop (bootstrap Javascript file, history iframe, module meta tag). These tags should be injected into the HTML file by pyjsbuild at compile time.

This topic has been discussed in: https://groups.google.com/d/msg/pyjamas-dev/nH-FREwqwWo/asMPWGDGnkIJ

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=698 (March 07, 2012 02:40:08)

random.randint() errors if second value is greater than 2000000

Before reporting a problem, please UPDATE TO LATEST SVN.
As this is a community-driven project, the developers only
have time available to fix problems reported in the LATEST
code. You are welcome to report problems in any other
version, but until you have upgraded to latest svn and provided
a test report against that, you will be reliant on people
OTHER than the core developers for bug-fixes. which could
happen, so feel free to ignore the above should you so choose.

What steps will reproduce the problem?

import random
random.randint(0,3000000)

What is the expected output? What do you see instead?

Expect a random number within range. Get a very unhelpful alert saying "typeError: Object1 doesnt have 'lshift' "

What version of Pyjamas are you using? which svn revision number?
On what operating system?

latest pyjs as of feb 23 2012. Windows 7 starter. latest chrome.

If using PyJS, have you attached a javascript stack trace,
from IE's Script Debugger or from Firefox Venkman / Firebug?
Have you attached a stack trace from using "-d" compiler option?

no stack trace, only an alert.

If using PyJD, have you attached a python stack trace?

If using PyJS, what compiler options did you use?

-c -d

Please provide any additional information below.

probably caused by this line in random.py:

def randrange(self, start, stop=None, step=1, fint=int, default=None, maxwidth=1L<<BPF):

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=690 (February 23, 2012 12:47:10)

pyjsbuild = "invalid directory name" ?

Before reporting a problem, please UPDATE TO LATEST SVN.
As this is a community-driven project, the developers only
have time available to fix problems reported in the LATEST
code. You are welcome to report problems in any other
version, but until you have upgraded to latest svn and provided
a test report against that, you will be reliant on people
OTHER than the core developers for bug-fixes. which could
happen, so feel free to ignore the above should you so choose.

What steps will reproduce the problem?

  1. I just downloaded pyjamas 0.8
  2. python bootstrap.py
  3. pyjsbuild Hello.py # helloworld example

What is the expected output? What do you see instead?

  • Here is what I see:
    H:\Data\helloworld>pyjsbuild Hello
    Building : Hello
    PYJSPATH : [
    H:\Data\helloworld
    H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\library
    H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\addons
    ]
    Translating : H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\pyjs\src\pyjs\builtin\pyjslib.py
    Traceback (most recent call last):
    File "H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\bin\pyjsbuild.py", line 21, in <module>
    pyjs.browser.build_script()
    File "H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\pyjs\src\pyjs\browser.py", line 542, in build_script
    runtime_options, args)
    File "H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\pyjs\src\pyjs\browser.py", line 395, in build
    l()
    File "H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\pyjs\src\pyjs\linker.py", line 228, in call
    self.visit_modules(['pyjslib'], platform)
    File "H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\pyjs\src\pyjs\linker.py", line 282, in visit_modules
    self.visit_module(p, override_paths, platform, module_name=mn)
    File "H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\pyjs\src\pyjs\linker.py", line 335, in visit_module
    self.keep_lib_files)
    File "H:\Data#Progs\PortaPy\weitere module\pyjamas-0.8alpha1\pyjs\src\pyjs\linker.py", line 119, in out_translate
    env=os.environ
    File "H:\Data#Progs\PortaPy\PortablePython 2.7.2.1\Portable Python 2.7.2.1\App\lib\subprocess.py", line 679, in init
    errread, errwrite)
    File "H:\Data#Progs\PortaPy\PortablePython 2.7.2.1\Portable Python 2.7.2.1\App\lib\subprocess.py", line 893, in _execute_child
    startupinfo)
    WindowsError: [Error 267] Der Verzeichnisname ist ungⁿltig

Last thing is German and means: directory name is not valid. Maybe because of space character or character "#" ?!

What version of Pyjamas are you using? which svn revision number?
On what operating system?

  • pyjamas-0.8alpha1 on Python 2.7.2.1 on Win7

Original issue: http://code.google.com/p/pyjamas/issues/detail?id=676 (January 09, 2012 17:34:27)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.