Active Topics

 


Reply
Thread Tools
coderus's Avatar
Posts: 6,436 | Thanked: 12,701 times | Joined on Nov 2011 @ Ängelholm, Sweden
#61
lol. now read docs: https://github.com/thp/pyotherside
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following User Says Thank You to coderus For This Useful Post:
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#62
I have. Now what?
 
EmaNymton's Avatar
Posts: 141 | Thanked: 267 times | Joined on May 2010 @ Germany
#63
You don't have to import pyotherside in the interpreter.

Just install the packages python3-base, pyotherside-qml-plugin-python3-qt5, qt5-qtdeclarative-qmlscene

Then use some of the examples from the github repo to get starting, for example the events:

https://github.com/thp/pyotherside/b...nts_example.py
https://github.com/thp/pyotherside/b...ts_example.qml


Change in the qml-file the line

Code:
addImportPath(Qt.resolvedUrl('.'));
to
Code:
addImportPath(Qt.resolvedUrl('.').substr('file://'.length));
otherwise the path is incorrect (afaik this is fixed in version >1.1, but jolla repo has 1.1)

Then you can start it with

Code:
/usr/lib/qt5/bin/qmlscene events_example.qml

Have fun!
 

The Following 4 Users Say Thank You to EmaNymton For This Useful Post:
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#64
Thankyou kindly! That got things going!
 

The Following User Says Thank You to solbrit For This Useful Post:
Posts: 120 | Thanked: 279 times | Joined on Sep 2009 @ Perth, Australia
#65
Anyone else experiencing SSL/cert related problems with python3 on Sailfish OS?

I've now encountered problems in two different situations:

1) When creating a python3 virtualenv, I can't use pip to install anything:
Code:
ImportError: No module named 'ssl_match_hostname'
2) When attempting to use the "requests" library:
Code:
from _implementation import CertificateError, match_hostname
ImportError: No module named '_implementation'

I'm attempting to write a NewsBlur client, and need to use the requests library, so this has me a bit stumped .


EDIT 1: Possibly related: https://github.com/shazow/urllib3/issues/320
So it looks like the Python version in the repos might be compiled without SSL .

EDIT 2: Looks like this pull request has been merged which will allow ssl: https://github.com/thp/mer-python3/issues/1 and https://github.com/nemomobile-packages/python3/pull/1. I'm not sure how to track when this reaches the mer/nemo/sailfish repos though - anyone have any tips?

Last edited by mattaustin; 2014-02-23 at 05:01.
 

The Following 2 Users Say Thank You to mattaustin For This Useful Post:
Guest | Posts: n/a | Thanked: 0 times | Joined on
#66
Originally Posted by mattaustin View Post
Anyone else experiencing SSL/cert related problems with python3 on Sailfish OS?

I've now encountered problems in two different situations:

1) When creating a python3 virtualenv, I can't use pip to install anything:
Code:
ImportError: No module named 'ssl_match_hostname'
2) When attempting to use the "requests" library:
Code:
from _implementation import CertificateError, match_hostname
ImportError: No module named '_implementation'
I'm attempting to write a NewsBlur client, and need to use the requests library, so this has me a bit stumped .


EDIT 1: Possibly related: https://github.com/shazow/urllib3/issues/320
So it looks like the Python version in the repos might be compiled without SSL .

EDIT 2: Looks like this pull request has been merged which will allow ssl: https://github.com/thp/mer-python3/issues/1 and https://github.com/nemomobile-packages/python3/pull/1. I'm not sure how to track when this reaches the mer/nemo/sailfish repos though - anyone have any tips?
at least python 2.7.5 on repos have

Code:
[nemo@localhost ~]$ python
Python 2.7.5 (default, May 09 2013, 12:34:56) 
[GCC 4.6.4 20130412 (Mer 4.6.4-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> hasattr(socket, "ssl")
True
>>>
 

The Following User Says Thank You to For This Useful Post:
Posts: 120 | Thanked: 279 times | Joined on Sep 2009 @ Perth, Australia
#67
Originally Posted by nieldk View Post
at least python 2.7.5 on repos have

Code:
[nemo@localhost ~]$ python
Python 2.7.5 (default, May 09 2013, 12:34:56) 
[GCC 4.6.4 20130412 (Mer 4.6.4-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> hasattr(socket, "ssl")
True
>>>
Yep, looks like that's missing from python3 in the 1.0.3.8 repos:

Code:
[nemo@localhost ~]$ python3
Python 3.3.3 (default, Jan 20 2014, 16:21:36) 
[GCC 4.6.4 20130412 (Mer 4.6.4-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import socket
>>> hasattr(socket, 'ssl')
False
>>>
 
Guest | Posts: n/a | Thanked: 0 times | Joined on
#68
i guess someone needs to build Python 3.3.5 ...

Code:
[nemo@localhost ~]$ python3
Python 3.3.5rc1 (default, Feb 23 2014, 21:01:14) 
[GCC 4.6.4 20130412 (Mer 4.6.4-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> import sys
>>> sys.modules.keys()
dict_keys(['collections.abc', 'textwrap', 'signal', 'ssl', 'zipimport', '_warnings', 'copyreg', 'encodings.utf_8', 'abc', 'stat', '__main__', 'os', 'site', 'errno', 'keyword', 'encodings.latin_1', 'sys', 'readline', 'sre_parse', 'heapq', 'encodings', '_io', '_ssl', 'posix', 'encodings.aliases', 'os.path', '_codecs', 'traceback', '_frozen_importlib', 'genericpath', '_thread', '_socket', 'io', 'operator', '_imp', 'marshal', '_struct', '_sysconfigdata', 'pprint', 'sre_constants', '_sre', 'posixpath', '_collections', 'collections', 'base64', 'reprlib', 'sysconfig', 'codecs', 'functools', 'sre_compile', 'builtins', 'binascii', 'token', 'weakref', 'socket', 'linecache', 'struct', '_weakref', 'tokenize', '_functools', '_heapq', '_weakrefset', 'itertools', 're'])
>>>

Last edited by nieldk; 2014-02-23 at 20:32.
 

The Following 3 Users Say Thank You to For This Useful Post:
Posts: 120 | Thanked: 279 times | Joined on Sep 2009 @ Perth, Australia
#69
Originally Posted by nieldk View Post
i guess someone needs to build Python 3.3.5 ...
https://openrepos.net/content/nieldk/python3-0

Thanks! That will at allow me to continue development and testing on-device whilst (hopefully) an updated python3 is released as in the official repos.
 

The Following User Says Thank You to mattaustin For This Useful Post:
solbrit's Avatar
Posts: 126 | Thanked: 59 times | Joined on Jan 2011
#70
Among all the exciting warnings I get when I run an otherwise working pyotherside app:
Code:
[W] DeclarativeCoverWindow::DeclarativeCoverWindow:62 - DeclarativeCoverWindow: You should be calling QQuickWindow::setDefaultAlphaBuffer(true) before creating windows. Failing to do so will result in suboptimal performance.
[W] DeclarativeCoverWindow::DeclarativeCoverWindow:63 - DeclarativeCoverWindow: You also won't have cover transparency.
Now the interesting thing is that, while on the device i don't have cover transparency, in the emulator I do. Why is this and how can I set DefaultAlphaBuffer (or whatever needs to be done) to obtain transparency on device?
 

The Following User Says Thank You to solbrit For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 16:10.