├── Desktop ├── debian │ ├── .qtcreator │ ├── compat │ ├── README │ ├── control │ ├── changelog │ ├── copyright │ └── rules ├── python │ ├── requests │ │ ├── packages │ │ │ ├── urllib3 │ │ │ │ ├── contrib │ │ │ │ │ └── __init__.py │ │ │ │ ├── packages │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── ssl_match_hostname │ │ │ │ │ │ └── __init__.py │ │ │ │ └── __init__.py │ │ │ ├── __init__.py │ │ │ └── chardet │ │ │ │ ├── compat.py │ │ │ │ ├── chardetect.py │ │ │ │ ├── __init__.py │ │ │ │ ├── constants.py │ │ │ │ ├── euctwprober.py │ │ │ │ ├── euckrprober.py │ │ │ │ ├── gb2312prober.py │ │ │ │ ├── big5prober.py │ │ │ │ ├── cp949prober.py │ │ │ │ ├── charsetprober.py │ │ │ │ ├── mbcsgroupprober.py │ │ │ │ └── codingstatemachine.py │ │ ├── certs.py │ │ ├── hooks.py │ │ ├── exceptions.py │ │ └── __init__.py │ ├── markdown │ │ ├── extensions │ │ │ ├── nl2br.py │ │ │ ├── sane_lists.py │ │ │ ├── smart_strong.py │ │ │ ├── __init__.py │ │ │ └── extra.py │ │ └── etree_loader.py │ ├── khtcms.py │ ├── scriptogram.py │ └── tinydav │ │ └── exception.py ├── Desktop64.png ├── Desktop80.png ├── icons │ └── ownnotes.png ├── Desktop.desktop ├── main.cpp └── qpython.h ├── Harmattan ├── debian │ ├── .qtcreator │ ├── compat │ ├── README │ ├── copyright │ ├── changelog │ └── rules ├── qtc_packaging │ └── debian_harmattan │ │ ├── compat │ │ ├── README │ │ ├── copyright │ │ ├── changelog │ │ └── rules ├── ownNotes ├── ownNotes64.png ├── ownNotes80.png ├── icons │ └── ownnotes.png ├── README.md ├── qml │ └── Harmattan │ │ ├── common.js │ │ └── components │ │ ├── PageHeader.qml │ │ ├── ItemMenu.qml │ │ ├── SearchField.qml │ │ ├── TitleLabel.qml │ │ └── AboutPage.qml ├── ownNotes.desktop ├── ownNotes_harmattan.desktop ├── main.cpp ├── README ├── qmlapplicationviewer │ └── qmlapplicationviewer.h ├── qpython.h ├── ownNotes.pro └── moc │ └── moc_qmlapplicationviewer.cpp ├── python ├── merge3 │ ├── __init__.py │ └── textfile.py ├── requests │ ├── packages │ │ ├── urllib3 │ │ │ ├── contrib │ │ │ │ └── __init__.py │ │ │ ├── packages │ │ │ │ ├── __init__.py │ │ │ │ └── ssl_match_hostname │ │ │ │ │ └── __init__.py │ │ │ └── __init__.py │ │ ├── __init__.py │ │ └── charade │ │ │ ├── compat.py │ │ │ ├── __init__.py │ │ │ ├── constants.py │ │ │ ├── euctwprober.py │ │ │ ├── euckrprober.py │ │ │ ├── gb2312prober.py │ │ │ ├── big5prober.py │ │ │ ├── cp949prober.py │ │ │ ├── charsetprober.py │ │ │ └── mbcsgroupprober.py │ ├── certs.py │ ├── hooks.py │ ├── exceptions.py │ └── __init__.py ├── webdav │ ├── __init__.py │ ├── acp │ │ └── __init__.py │ └── logger.py ├── markdown │ ├── extensions │ │ ├── nl2br.py │ │ ├── sane_lists.py │ │ ├── smart_strong.py │ │ ├── __init__.py │ │ └── extra.py │ └── etree_loader.py ├── khtcms.py ├── scriptogram.py ├── logger.py └── md5util.py ├── Sailfish └── ownNotes │ ├── python │ ├── requests │ │ ├── packages │ │ │ ├── urllib3 │ │ │ │ ├── contrib │ │ │ │ │ └── __init__.py │ │ │ │ ├── packages │ │ │ │ │ ├── __init__.py │ │ │ │ │ └── ssl_match_hostname │ │ │ │ │ │ └── __init__.py │ │ │ │ └── __init__.py │ │ │ ├── __init__.py │ │ │ └── chardet │ │ │ │ ├── compat.py │ │ │ │ ├── chardetect.py │ │ │ │ ├── __init__.py │ │ │ │ ├── constants.py │ │ │ │ ├── euctwprober.py │ │ │ │ ├── euckrprober.py │ │ │ │ ├── gb2312prober.py │ │ │ │ ├── big5prober.py │ │ │ │ ├── cp949prober.py │ │ │ │ ├── charsetprober.py │ │ │ │ ├── mbcsgroupprober.py │ │ │ │ └── codingstatemachine.py │ │ ├── certs.py │ │ ├── hooks.py │ │ ├── __init__.py │ │ └── exceptions.py │ ├── fakelock.py │ ├── markdown │ │ ├── __version__.py │ │ └── extensions │ │ │ ├── nl2br.py │ │ │ ├── sane_lists.py │ │ │ ├── smart_strong.py │ │ │ ├── __init__.py │ │ │ └── extra.py │ ├── khtcms.py │ ├── scriptogram.py │ ├── pyaes │ │ ├── util.py │ │ ├── util.py.bak │ │ └── __init__.py │ ├── md5util.py │ ├── logger.py │ └── tinydav │ │ └── exception.py │ ├── version.pri │ ├── ownNotes.png │ ├── icons │ ├── about.png │ ├── ownnotes.png │ ├── coverlarge.png │ └── coversmall.png │ ├── i18n │ ├── ownNotes_cn.qm │ ├── ownNotes_en.qm │ ├── ownNotes_fi.qm │ ├── ownNotes_fr.qm │ ├── ownNotes_it.qm │ ├── ownNotes_nl.qm │ ├── ownNotes_no.qm │ └── ownNotes_ru.qm │ ├── ownNotes.desktop │ ├── datas │ └── datas.pri │ ├── resources.qrc │ ├── rpm │ ├── ownNotes.yaml │ └── ownNotes.spec │ ├── src │ └── qpython.h │ ├── qml │ └── pages │ │ ├── AboutPage.qml │ │ └── FontComboBox.qml │ └── ownNotes.pro ├── .gitignore └── README.md /Desktop/debian/.qtcreator: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Desktop/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /Harmattan/debian/.qtcreator: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /python/merge3/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Harmattan/debian/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /python/requests/packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Harmattan/qtc_packaging/debian_harmattan/compat: -------------------------------------------------------------------------------- 1 | 7 2 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/version.pri: -------------------------------------------------------------------------------- 1 | VERSION=1.8.2 2 | CODENAME=FlyingDuck 3 | -------------------------------------------------------------------------------- /Harmattan/ownNotes: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Harmattan/ownNotes -------------------------------------------------------------------------------- /Desktop/Desktop64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Desktop/Desktop64.png -------------------------------------------------------------------------------- /Desktop/Desktop80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Desktop/Desktop80.png -------------------------------------------------------------------------------- /Desktop/icons/ownnotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Desktop/icons/ownnotes.png -------------------------------------------------------------------------------- /Harmattan/ownNotes64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Harmattan/ownNotes64.png -------------------------------------------------------------------------------- /Harmattan/ownNotes80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Harmattan/ownNotes80.png -------------------------------------------------------------------------------- /Harmattan/icons/ownnotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Harmattan/icons/ownnotes.png -------------------------------------------------------------------------------- /Sailfish/ownNotes/ownNotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/ownNotes.png -------------------------------------------------------------------------------- /python/requests/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import urllib3 4 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import urllib3 4 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/icons/about.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/icons/about.png -------------------------------------------------------------------------------- /Sailfish/ownNotes/icons/ownnotes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/icons/ownnotes.png -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_cn.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_cn.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_en.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_en.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_fi.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_fi.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_fr.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_fr.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_it.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_it.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_nl.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_nl.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_no.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_no.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/i18n/ownNotes_ru.qm: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/i18n/ownNotes_ru.qm -------------------------------------------------------------------------------- /Sailfish/ownNotes/icons/coverlarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/icons/coverlarge.png -------------------------------------------------------------------------------- /Sailfish/ownNotes/icons/coversmall.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/brvier/ownNotes/HEAD/Sailfish/ownNotes/icons/coversmall.png -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import urllib3 4 | -------------------------------------------------------------------------------- /Harmattan/README.md: -------------------------------------------------------------------------------- 1 | ownNotes 2 | ======== 3 | 4 | a markdown notes taking application with ownCloud/WebDav synchronization. 5 | -------------------------------------------------------------------------------- /python/requests/packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/ownNotes.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Type=Application 3 | X-Nemo-Application-Type=silica-qt5 4 | Name=ownNotes 5 | Icon=ownNotes 6 | Exec=ownNotes 7 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/datas/datas.pri: -------------------------------------------------------------------------------- 1 | datas.files = datas/changelog.json \ 2 | datas/changelog.html 3 | datas.path = /usr/share/$$TARGET/datas 4 | INSTALLS += datas 5 | 6 | OTHER_FILES += datas/changelog.html 7 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/resources.qrc: -------------------------------------------------------------------------------- 1 | 2 | 3 | l10n/en_US.qm 4 | l10n/ru_RU.qm 5 | l10n/fr_FR.qm 6 | 7 | 8 | -------------------------------------------------------------------------------- /Desktop/debian/README: -------------------------------------------------------------------------------- 1 | The Debian Package ownnotes 2 | ---------------------------- 3 | 4 | Package created from source by QtCreator SDK 1.2.1 from Nokia 5 | 6 | -- Benoît HERVIER Wed, 31 Jul 2013 14:06:29 +0200 7 | -------------------------------------------------------------------------------- /Harmattan/debian/README: -------------------------------------------------------------------------------- 1 | The Debian Package ownnotes 2 | ---------------------------- 3 | 4 | Package created from source by QtCreator SDK 1.2.1 from Nokia 5 | 6 | -- Benoît HERVIER Wed, 31 Jul 2013 14:06:29 +0200 7 | -------------------------------------------------------------------------------- /Harmattan/qtc_packaging/debian_harmattan/README: -------------------------------------------------------------------------------- 1 | The Debian Package ownnotes 2 | ---------------------------- 3 | 4 | Package created from source by QtCreator SDK 1.2.1 from Nokia 5 | 6 | -- Benoît HERVIER Wed, 31 Jul 2013 14:06:29 +0200 7 | -------------------------------------------------------------------------------- /Harmattan/qml/Harmattan/common.js: -------------------------------------------------------------------------------- 1 | function beautifulPath(path) { 2 | var filepath = new String(path); 3 | filepath = filepath.replace('file://', ''); 4 | filepath = filepath.replace('/home/user', '~'); 5 | 6 | return filepath; 7 | } -------------------------------------------------------------------------------- /Desktop/Desktop.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Version=1.0 4 | Type=Application 5 | Terminal=false 6 | Name=Desktop 7 | Exec=/opt/Desktop/bin/Desktop 8 | Icon=Desktop64 9 | X-Window-Icon= 10 | X-HildonDesk-ShowInToolbar=true 11 | X-Osso-Type=application/x-executable 12 | -------------------------------------------------------------------------------- /Harmattan/ownNotes.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Version=1.0 4 | Type=Application 5 | Terminal=false 6 | Name=ownNotes 7 | Exec=/opt/ownNotes/bin/ownNotes 8 | Icon=ownNotes64 9 | X-Window-Icon= 10 | X-HildonDesk-ShowInToolbar=true 11 | X-Osso-Type=application/x-executable 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled Object files 2 | *.slo 3 | *.lo 4 | *.o 5 | 6 | # Compiled Dynamic libraries 7 | *.so 8 | *.dylib 9 | 10 | # Compiled Static libraries 11 | *.lai 12 | *.la 13 | *.a 14 | 15 | # Python 16 | *.pyc 17 | *.pyo 18 | 19 | # QtCreator 20 | *.pro.user 21 | 22 | # Gedit 23 | *~ 24 | 25 | #Compiled Package 26 | *.deb 27 | *.rpm 28 | -------------------------------------------------------------------------------- /Harmattan/ownNotes_harmattan.desktop: -------------------------------------------------------------------------------- 1 | [Desktop Entry] 2 | Encoding=UTF-8 3 | Version=1.0 4 | Type=Application 5 | Terminal=false 6 | Name=ownNotes 7 | Exec=/usr/bin/invoker --type=e -s /opt/ownNotes/bin/ownNotes 8 | Icon=/usr/share/icons/hicolor/80x80/apps/ownNotes80.png 9 | X-Window-Icon= 10 | X-HildonDesk-ShowInToolbar=true 11 | X-Osso-Type=application/x-executable 12 | -------------------------------------------------------------------------------- /Harmattan/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "qmlapplicationviewer.h" 3 | #include "qpython.h" 4 | 5 | Q_DECL_EXPORT int main(int argc, char *argv[]) 6 | { 7 | QScopedPointer app(createApplication(argc, argv)); 8 | 9 | QPython::registerQML(); 10 | 11 | QmlApplicationViewer viewer; 12 | viewer.setOrientation(QmlApplicationViewer::ScreenOrientationAuto); 13 | viewer.setMainQmlFile(QLatin1String("qml/Harmattan/main.qml")); 14 | viewer.showExpanded(); 15 | 16 | return app->exec(); 17 | } 18 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3.2+ 3 | from ssl import CertificateError, match_hostname 4 | except ImportError: 5 | try: 6 | # Backport of the function from a pypi module 7 | from backports.ssl_match_hostname import CertificateError, match_hostname 8 | except ImportError: 9 | # Our vendored copy 10 | from _implementation import CertificateError, match_hostname 11 | 12 | # Not needed, but documenting what we provide. 13 | __all__ = ('CertificateError', 'match_hostname') 14 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3.2+ 3 | from ssl import CertificateError, match_hostname 4 | except ImportError: 5 | try: 6 | # Backport of the function from a pypi module 7 | from backports.ssl_match_hostname import CertificateError, match_hostname 8 | except ImportError: 9 | # Our vendored copy 10 | from ._implementation import CertificateError, match_hostname 11 | 12 | # Not needed, but documenting what we provide. 13 | __all__ = ('CertificateError', 'match_hostname') 14 | -------------------------------------------------------------------------------- /Desktop/debian/control: -------------------------------------------------------------------------------- 1 | Source: ownnotes 2 | Section: user/other 3 | Priority: optional 4 | Maintainer: Benoît HERVIER 5 | Build-Depends: debhelper (>= 5), libqt5-dev, python-dev (=>2.7) 6 | Standards-Version: 3.7.3 7 | Homepage: http://khertan.net/ownnotes 8 | 9 | Package: ownnotes 10 | Architecture: any 11 | Depends: ${shlibs:Depends}, ${misc:Depends} 12 | Description: a note taking application with ownCloud/WebDav sync. 13 | A note taking application with sync for ownCloud or any WebDav. ownNotes support Markdown, and is able to send notes as blog post to KhtCms or Scriptogr.am. 14 | -------------------------------------------------------------------------------- /Desktop/python/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | certs.py 6 | ~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | 15 | import os.path 16 | 17 | 18 | def where(): 19 | """Return the preferred certificate bundle.""" 20 | # vendored bundle inside Requests 21 | return os.path.join(os.path.dirname(__file__), 'cacert.pem') 22 | 23 | if __name__ == '__main__': 24 | print(where()) 25 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | certs.py 6 | ~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | 15 | import os.path 16 | 17 | 18 | def where(): 19 | """Return the preferred certificate bundle.""" 20 | # vendored bundle inside Requests 21 | return os.path.join(os.path.dirname(__file__), 'cacert.pem') 22 | 23 | if __name__ == '__main__': 24 | print(where()) 25 | -------------------------------------------------------------------------------- /python/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | certs.py 6 | ~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | 15 | import os.path 16 | 17 | 18 | def where(): 19 | """Return the preferred certificate bundle.""" 20 | # vendored bundle inside Requests 21 | return os.path.join(os.path.dirname(__file__), 'cacert.pem') 22 | 23 | if __name__ == '__main__': 24 | print(where()) 25 | -------------------------------------------------------------------------------- /python/webdav/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008 German Aerospace Center (DLR) 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | __version__ = "$LastChangedRevision$" 17 | -------------------------------------------------------------------------------- /Desktop/debian/changelog: -------------------------------------------------------------------------------- 1 | ownnotes (1.1.0) unstable; urgency=low 2 | * Fix an other rehighlight bug 3 | * First desktop UI Release 4 | 5 | -- Benoît HERVIER Fri, 07 Oct 2013 11:07:11 +0200 6 | 7 | ownnotes (1.0.2) unstable; urgency=low 8 | * Fix position cursor error on rehighlight 9 | 10 | -- Benoît HERVIER Tue, 17 Sep 2013 07:45:44 +0200 11 | 12 | ownnotes (1.0.1) unstable; urgency=low 13 | * Add auto sync on launch 14 | * Push note to sync server once saved 15 | 16 | -- Benoît HERVIER Fri, 23 Aug 2013 08:51:04 +0200 17 | 18 | ownnotes (1.0.0) unstable; urgency=low 19 | 20 | * Initial Release. 21 | 22 | -- Benoît HERVIER Mon, 05 Aug 2013 16:29:33 +0200 23 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/fakelock.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """Fake a WebDAV LOCK request. 4 | 5 | OwnCloud doesn't support WebDAV LOCKs, which return a 501 error. This class 6 | fakes the interface so that the locking code can be kept in the sync 7 | code but not have it actually do anything. 8 | 9 | It doesn't provide any locking functionality, it just offers an interface 10 | to allow 'with' blocks that have no effect. 11 | 12 | See ownCloud issue #17732 for details about the lack of WebDAV LOCKs: 13 | https://github.com/owncloud/core/issues/17732 14 | """ 15 | 16 | import contextlib 17 | 18 | @contextlib.contextmanager 19 | 20 | def fakelock(): 21 | """ 22 | Empty context manager that does nothing. Courtesey of @brett_lempereurs 23 | pithiness :) 24 | https://gist.github.com/brett-lempereur/31c67d8d3b251bd5175e104e656d781c 25 | https://twitter.com/brettlempereur/status/773566420709994496 26 | """ 27 | yield 28 | -------------------------------------------------------------------------------- /python/markdown/extensions/nl2br.py: -------------------------------------------------------------------------------- 1 | """ 2 | NL2BR Extension 3 | =============== 4 | 5 | A Python-Markdown extension to treat newlines as hard breaks; like 6 | StackOverflow and GitHub flavored Markdown do. 7 | 8 | Usage: 9 | 10 | >>> import markdown 11 | >>> print markdown.markdown('line 1\\nline 2', extensions=['nl2br']) 12 |

line 1
13 | line 2

14 | 15 | Copyright 2011 [Brian Neal](http://deathofagremmie.com/) 16 | 17 | Dependencies: 18 | * [Python 2.4+](http://python.org) 19 | * [Markdown 2.1+](http://packages.python.org/Markdown/) 20 | 21 | """ 22 | 23 | import markdown 24 | 25 | BR_RE = r'\n' 26 | 27 | class Nl2BrExtension(markdown.Extension): 28 | 29 | def extendMarkdown(self, md, md_globals): 30 | br_tag = markdown.inlinepatterns.SubstituteTagPattern(BR_RE, 'br') 31 | md.inlinePatterns.add('nl', br_tag, '_end') 32 | 33 | 34 | def makeExtension(configs=None): 35 | return Nl2BrExtension(configs) 36 | 37 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/rpm/ownNotes.yaml: -------------------------------------------------------------------------------- 1 | Name: ownNotes 2 | Summary: A notes taking app with ownCloud Sync 3 | Version: '1.8.2' 4 | Release: 1 5 | Group: Qt/Qt 6 | URL: http://example.org/ 7 | License: LICENSE 8 | Sources: 9 | - '%{name}-%{version}.tar.bz2' 10 | Description: |- 11 | A notes taking app with ownCloud Sync and markdown support. 12 | Configure: none 13 | Builder: qtc5 14 | PkgConfigBR: 15 | - Qt5Quick 16 | - Qt5Qml 17 | - Qt5Core 18 | - sailfishapp >= 0.0.10 19 | - Qt5Widgets 20 | Requires: 21 | - sailfishsilica-qt5 >= 0.10.9 22 | - python3-base 23 | Files: 24 | - 25 | - /usr/share/ownNotes/i18n 26 | - /usr/share/ownNotes/python 27 | - '%{_datadir}/%{name}/python' 28 | - '%{_bindir}' 29 | - '%{_datadir}/%{name}/qml' 30 | - '%{_datadir}/applications/%{name}.desktop' 31 | - '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png' 32 | - /usr/bin 33 | - /usr/share/ownNotes 34 | - /usr/share/applications 35 | - /usr/share/icons/hicolor/86x86/apps 36 | - /usr/share/ownNotes/datas 37 | PkgBR: [python3-devel] 38 | -------------------------------------------------------------------------------- /Desktop/python/markdown/extensions/nl2br.py: -------------------------------------------------------------------------------- 1 | """ 2 | NL2BR Extension 3 | =============== 4 | 5 | A Python-Markdown extension to treat newlines as hard breaks; like 6 | StackOverflow and GitHub flavored Markdown do. 7 | 8 | Usage: 9 | 10 | >>> import markdown 11 | >>> print markdown.markdown('line 1\\nline 2', extensions=['nl2br']) 12 |

line 1
13 | line 2

14 | 15 | Copyright 2011 [Brian Neal](http://deathofagremmie.com/) 16 | 17 | Dependencies: 18 | * [Python 2.4+](http://python.org) 19 | * [Markdown 2.1+](http://packages.python.org/Markdown/) 20 | 21 | """ 22 | 23 | import markdown 24 | 25 | BR_RE = r'\n' 26 | 27 | class Nl2BrExtension(markdown.Extension): 28 | 29 | def extendMarkdown(self, md, md_globals): 30 | br_tag = markdown.inlinepatterns.SubstituteTagPattern(BR_RE, 'br') 31 | md.inlinePatterns.add('nl', br_tag, '_end') 32 | 33 | 34 | def makeExtension(configs=None): 35 | return Nl2BrExtension(configs) 36 | 37 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/markdown/__version__.py: -------------------------------------------------------------------------------- 1 | # 2 | # markdown/__version__.py 3 | # 4 | # version_info should conform to PEP 386 5 | # (major, minor, micro, alpha/beta/rc/final, #) 6 | # (1, 1, 2, 'alpha', 0) => "1.1.2.dev" 7 | # (1, 2, 0, 'beta', 2) => "1.2b2" 8 | version_info = (2, 3, 1, 'final', 0) 9 | 10 | def _get_version(): 11 | " Returns a PEP 386-compliant version number from version_info. " 12 | assert len(version_info) == 5 13 | assert version_info[3] in ('alpha', 'beta', 'rc', 'final') 14 | 15 | parts = 2 if version_info[2] == 0 else 3 16 | main = '.'.join(map(str, version_info[:parts])) 17 | 18 | sub = '' 19 | if version_info[3] == 'alpha' and version_info[4] == 0: 20 | # TODO: maybe append some sort of git info here?? 21 | sub = '.dev' 22 | elif version_info[3] != 'final': 23 | mapping = {'alpha': 'a', 'beta': 'b', 'rc': 'c'} 24 | sub = mapping[version_info[3]] + str(version_info[4]) 25 | 26 | return str(main + sub) 27 | 28 | version = _get_version() 29 | -------------------------------------------------------------------------------- /Desktop/python/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | 14 | """ 15 | 16 | 17 | HOOKS = ['response'] 18 | 19 | 20 | def default_hooks(): 21 | hooks = {} 22 | for event in HOOKS: 23 | hooks[event] = [] 24 | return hooks 25 | 26 | # TODO: response is the only one 27 | 28 | 29 | def dispatch_hook(key, hooks, hook_data, **kwargs): 30 | """Dispatches a hook dictionary on a given piece of data.""" 31 | 32 | hooks = hooks or dict() 33 | 34 | if key in hooks: 35 | hooks = hooks.get(key) 36 | 37 | if hasattr(hooks, '__call__'): 38 | hooks = [hooks] 39 | 40 | for hook in hooks: 41 | _hook_data = hook(hook_data, **kwargs) 42 | if _hook_data is not None: 43 | hook_data = _hook_data 44 | 45 | return hook_data 46 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | 14 | """ 15 | 16 | 17 | HOOKS = ['response'] 18 | 19 | 20 | def default_hooks(): 21 | hooks = {} 22 | for event in HOOKS: 23 | hooks[event] = [] 24 | return hooks 25 | 26 | # TODO: response is the only one 27 | 28 | 29 | def dispatch_hook(key, hooks, hook_data, **kwargs): 30 | """Dispatches a hook dictionary on a given piece of data.""" 31 | 32 | hooks = hooks or dict() 33 | 34 | if key in hooks: 35 | hooks = hooks.get(key) 36 | 37 | if hasattr(hooks, '__call__'): 38 | hooks = [hooks] 39 | 40 | for hook in hooks: 41 | _hook_data = hook(hook_data, **kwargs) 42 | if _hook_data is not None: 43 | hook_data = _hook_data 44 | 45 | return hook_data 46 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/markdown/extensions/nl2br.py: -------------------------------------------------------------------------------- 1 | """ 2 | NL2BR Extension 3 | =============== 4 | 5 | A Python-Markdown extension to treat newlines as hard breaks; like 6 | GitHub-flavored Markdown does. 7 | 8 | Usage: 9 | 10 | >>> import markdown 11 | >>> print markdown.markdown('line 1\\nline 2', extensions=['nl2br']) 12 |

line 1
13 | line 2

14 | 15 | Copyright 2011 [Brian Neal](http://deathofagremmie.com/) 16 | 17 | Dependencies: 18 | * [Python 2.4+](http://python.org) 19 | * [Markdown 2.1+](http://packages.python.org/Markdown/) 20 | 21 | """ 22 | 23 | from __future__ import absolute_import 24 | from __future__ import unicode_literals 25 | from . import Extension 26 | from ..inlinepatterns import SubstituteTagPattern 27 | 28 | BR_RE = r'\n' 29 | 30 | class Nl2BrExtension(Extension): 31 | 32 | def extendMarkdown(self, md, md_globals): 33 | br_tag = SubstituteTagPattern(BR_RE, 'br') 34 | md.inlinePatterns.add('nl', br_tag, '_end') 35 | 36 | 37 | def makeExtension(configs=None): 38 | return Nl2BrExtension(configs) 39 | -------------------------------------------------------------------------------- /python/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | 14 | """ 15 | 16 | 17 | HOOKS = ['response'] 18 | 19 | 20 | def default_hooks(): 21 | hooks = {} 22 | for event in HOOKS: 23 | hooks[event] = [] 24 | return hooks 25 | 26 | # TODO: response is the only one 27 | 28 | 29 | def dispatch_hook(key, hooks, hook_data, **kwargs): 30 | """Dispatches a hook dictionary on a given piece of data.""" 31 | 32 | hooks = hooks or dict() 33 | 34 | if key in hooks: 35 | hooks = hooks.get(key) 36 | 37 | if hasattr(hooks, '__call__'): 38 | hooks = [hooks] 39 | 40 | for hook in hooks: 41 | _hook_data = hook(hook_data, **kwargs) 42 | if _hook_data is not None: 43 | hook_data = _hook_data 44 | 45 | return hook_data 46 | -------------------------------------------------------------------------------- /Harmattan/qml/Harmattan/components/PageHeader.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 1.1 2 | import com.nokia.meego 1.0 3 | 4 | Rectangle { 5 | id:header 6 | 7 | property alias title: headerlabel.text 8 | 9 | anchors.top: parent.top 10 | width:parent.width 11 | height: 70 //Settings.displayHeader ? 70 : 0 12 | color:'#663366' 13 | z:2 14 | visible: true // Settings.displayHeader ? 1.0 : 0.0 15 | opacity: visible 16 | 17 | Text{ 18 | id:headerlabel 19 | anchors.right: busyindicatorsmall.left 20 | anchors.left: parent.left 21 | anchors.verticalCenter: parent.verticalCenter 22 | anchors.leftMargin: 20 23 | anchors.rightMargin: 10 24 | font { bold: false; family: "Nokia Pure Text"; pixelSize: 36; } 25 | color:"white" 26 | text:'KhtNotes' 27 | 28 | } 29 | 30 | BusyIndicator { 31 | id: busyindicatorsmall 32 | platformStyle: BusyIndicatorStyle { size: "medium"; spinnerFrames: "image://theme/spinnerinverted"} 33 | running: sync.running ? true : false; 34 | opacity: sync.running ? 1.0 : 0.0; 35 | anchors.right: header.right 36 | anchors.rightMargin: 10 37 | anchors.verticalCenter: header.verticalCenter 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Harmattan/qml/Harmattan/components/ItemMenu.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 1.1 2 | import com.nokia.meego 1.0 3 | 4 | Menu { 5 | id: itemMenu 6 | visualParent: pageStack 7 | 8 | property string path 9 | 10 | MenuLayout { 11 | /*MenuItem { 12 | text: qsTr("Favorite") 13 | onClicked: { 14 | notesModelLoader.favorite(index) 15 | } 16 | }*/ 17 | MenuItem { 18 | text: qsTr("Category") 19 | onClicked: { 20 | var categories = pyNotes.getCategories(); 21 | categoryQueryDialog.model.clear(); 22 | for (var idx=0; idx 2 | #include "qtquick2applicationviewer.h" 3 | #include "qpython.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | QGuiApplication app(argc, argv); 8 | 9 | QPython::registerQML(); 10 | 11 | QtQuick2ApplicationViewer viewer; 12 | viewer.setMainQmlFile(QStringLiteral("qml/Desktop/main.qml")); 13 | viewer.showExpanded(); 14 | 15 | return app.exec(); 16 | } 17 | */ 18 | 19 | #include 20 | #include 21 | #include 22 | #include "qpython.h" 23 | 24 | //SRC : http://doc-snapshot.qt-project.org/qt5-stable/qtquickcontrols/text-src-main-cpp.html 25 | int main(int argc, char *argv[]) 26 | { 27 | QApplication app(argc, argv); 28 | 29 | QPython::registerQML(); 30 | 31 | //#ifdef QT_NO_DEBUG 32 | // QQmlApplicationEngine engine(QUrl("qrc:/qml/Desktop/main.qml")); 33 | //#else 34 | QQmlApplicationEngine engine(QUrl("qrc:/qml/Desktop/main.qml")); 35 | //#endif 36 | 37 | QObject *topLevel = engine.rootObjects().value(0); 38 | QQuickWindow *window = qobject_cast(topLevel); 39 | if ( !window ) { 40 | qWarning("Error: Your root item has to be a Window."); 41 | return -1; 42 | } 43 | window->show(); 44 | return app.exec(); 45 | } 46 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/chardetect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Script which takes one or more file paths and reports on their detected 4 | encodings 5 | 6 | Example:: 7 | 8 | % chardetect somefile someotherfile 9 | somefile: windows-1252 with confidence 0.5 10 | someotherfile: ascii with confidence 1.0 11 | 12 | If no paths are provided, it takes its input from stdin. 13 | 14 | """ 15 | from io import open 16 | from sys import argv, stdin 17 | 18 | from chardet.universaldetector import UniversalDetector 19 | 20 | 21 | def description_of(file, name='stdin'): 22 | """Return a string describing the probable encoding of a file.""" 23 | u = UniversalDetector() 24 | for line in file: 25 | u.feed(line) 26 | u.close() 27 | result = u.result 28 | if result['encoding']: 29 | return '%s: %s with confidence %s' % (name, 30 | result['encoding'], 31 | result['confidence']) 32 | else: 33 | return '%s: no result' % name 34 | 35 | 36 | def main(): 37 | if len(argv) <= 1: 38 | print(description_of(stdin)) 39 | else: 40 | for path in argv[1:]: 41 | with open(path, 'rb') as f: 42 | print(description_of(f, path)) 43 | 44 | 45 | if __name__ == '__main__': 46 | main() 47 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/chardetect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Script which takes one or more file paths and reports on their detected 4 | encodings 5 | 6 | Example:: 7 | 8 | % chardetect somefile someotherfile 9 | somefile: windows-1252 with confidence 0.5 10 | someotherfile: ascii with confidence 1.0 11 | 12 | If no paths are provided, it takes its input from stdin. 13 | 14 | """ 15 | from io import open 16 | from sys import argv, stdin 17 | 18 | from chardet.universaldetector import UniversalDetector 19 | 20 | 21 | def description_of(file, name='stdin'): 22 | """Return a string describing the probable encoding of a file.""" 23 | u = UniversalDetector() 24 | for line in file: 25 | u.feed(line) 26 | u.close() 27 | result = u.result 28 | if result['encoding']: 29 | return '%s: %s with confidence %s' % (name, 30 | result['encoding'], 31 | result['confidence']) 32 | else: 33 | return '%s: no result' % name 34 | 35 | 36 | def main(): 37 | if len(argv) <= 1: 38 | print(description_of(stdin)) 39 | else: 40 | for path in argv[1:]: 41 | with open(path, 'rb') as f: 42 | print(description_of(f, path)) 43 | 44 | 45 | if __name__ == '__main__': 46 | main() 47 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ownNotes 2 | ======== 3 | 4 | A markdown notes taking application with ownCloud/WebDav synchronization. 5 | 6 | **Sources** : [Git Repository](http://github.com/khertan/ownNotes) 7 | **Bug Tracker** : [Bug Tracker](http://github.com/khertan/ownNotes/issues) 8 | **Download** : Not yet available 9 | 10 | 11 | Features 12 | -------- 13 | 14 | * Sync with ownCloud or other webdav server 15 | * Highlight some part of markdown syntax while editing : Title, bold, italics, link 16 | * File are stored as text file, so you can directly edit them in ownCloud or via a mounted webdav point and a text editor. 17 | * Upload a note to KhtCms or Scriptogr.am 18 | * Categories 19 | * Search 20 | * Available for multiple plateform : Sailfish OS, Harmattan, or Linux Desktop (still in development) 21 | 22 | Licence 23 | ------- 24 | Licensed under GPLv3 25 | 26 | Screenshots 27 | ----------- 28 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForSailfish_1.png) 29 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForSailfish_2.png) 30 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForSailfish_3.png) 31 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForHarmattan_1.png) 32 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForHarmattan_2.png) 33 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForHarmattan_3.png) 34 | -------------------------------------------------------------------------------- /Harmattan/README: -------------------------------------------------------------------------------- 1 | ownNotes 2 | ======== 3 | 4 | A markdown notes taking application with ownCloud/WebDav synchronization. 5 | 6 | **Sources** : [Git Repository](http://github.com/khertan/ownNotes) 7 | **Bug Tracker** : [Bug Tracker](http://github.com/khertan/ownNotes/issues) 8 | **Download** : Not yet available 9 | 10 | 11 | Features 12 | -------- 13 | 14 | * Sync with ownCloud or other webdav server 15 | * Highlight some part of markdown syntax while editing : Title, bold, italics, link 16 | * File are stored as text file, so you can directly edit them in ownCloud or via a mounted webdav point and a text editor. 17 | * Upload a note to KhtCms or Scriptogr.am 18 | * Categories 19 | * Search 20 | * Available for multiple plateform : Sailfish OS, Harmattan, or Linux Desktop (still in development) 21 | 22 | Licence 23 | ------- 24 | Licensed under GPLv3 25 | 26 | Screenshots 27 | ----------- 28 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForSailfish_1.png) 29 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForSailfish_2.png) 30 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForSailfish_3.png) 31 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForHarmattan_1.png) 32 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForHarmattan_2.png) 33 | ![ownNotes on Sailfish](http://khertan.net/medias/ownNotesForHarmattan_3.png) 34 | -------------------------------------------------------------------------------- /Desktop/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Benoît HERVIER on 2 | Wed, 31 Jul 2013 14:06:29 +0200. 3 | 4 | It was downloaded from 5 | 6 | Upstream Author(s): 7 | 8 | Benoît HERVIER 9 | 10 | Copyright: 11 | 12 | Copyright (C) 2013 Benoît HERVIER 13 | 14 | License: 15 | 16 | This package is free software; you can redistribute it and/or modify 17 | it under the terms of the GNU General Public License as published by 18 | the Free Software Foundation; either version 3 of the License, or 19 | any later version. 20 | 21 | This package is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | GNU General Public License for more details. 25 | 26 | You should have received a copy of the GNU General Public License 27 | along with this package; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 | 30 | On Debian systems, the complete text of the GNU General 31 | Public License can be found in `/usr/share/common-licenses/GPL'. 32 | 33 | The Debian packaging is (C) 2013, Benoît HERVIER and 34 | is licensed under the GPLv3, see above. 35 | -------------------------------------------------------------------------------- /Harmattan/debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Benoît HERVIER on 2 | Wed, 31 Jul 2013 14:06:29 +0200. 3 | 4 | It was downloaded from 5 | 6 | Upstream Author(s): 7 | 8 | Benoît HERVIER 9 | 10 | Copyright: 11 | 12 | Copyright (C) 2013 Benoît HERVIER 13 | 14 | License: 15 | 16 | This package is free software; you can redistribute it and/or modify 17 | it under the terms of the GNU General Public License as published by 18 | the Free Software Foundation; either version 3 of the License, or 19 | any later version. 20 | 21 | This package is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | GNU General Public License for more details. 25 | 26 | You should have received a copy of the GNU General Public License 27 | along with this package; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 | 30 | On Debian systems, the complete text of the GNU General 31 | Public License can be found in `/usr/share/common-licenses/GPL'. 32 | 33 | The Debian packaging is (C) 2013, Benoît HERVIER and 34 | is licensed under the GPLv3, see above. 35 | -------------------------------------------------------------------------------- /Harmattan/qtc_packaging/debian_harmattan/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Benoît HERVIER on 2 | Wed, 31 Jul 2013 14:06:29 +0200. 3 | 4 | It was downloaded from 5 | 6 | Upstream Author(s): 7 | 8 | Benoît HERVIER 9 | 10 | Copyright: 11 | 12 | Copyright (C) 2013 Benoît HERVIER 13 | 14 | License: 15 | 16 | This package is free software; you can redistribute it and/or modify 17 | it under the terms of the GNU General Public License as published by 18 | the Free Software Foundation; either version 3 of the License, or 19 | any later version. 20 | 21 | This package is distributed in the hope that it will be useful, 22 | but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | GNU General Public License for more details. 25 | 26 | You should have received a copy of the GNU General Public License 27 | along with this package; if not, write to the Free Software 28 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 29 | 30 | On Debian systems, the complete text of the GNU General 31 | Public License can be found in `/usr/share/common-licenses/GPL'. 32 | 33 | The Debian packaging is (C) 2013, Benoît HERVIER and 34 | is licensed under the GPLv3, see above. 35 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | __version__ = "2.2.1" 19 | from sys import version_info 20 | 21 | 22 | def detect(aBuf): 23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or 24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))): 25 | raise ValueError('Expected a bytes object, not a unicode object') 26 | 27 | from . import universaldetector 28 | u = universaldetector.UniversalDetector() 29 | u.reset() 30 | u.feed(aBuf) 31 | u.close() 32 | return u.result 33 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | __version__ = "2.2.1" 19 | from sys import version_info 20 | 21 | 22 | def detect(aBuf): 23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or 24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))): 25 | raise ValueError('Expected a bytes object, not a unicode object') 26 | 27 | from . import universaldetector 28 | u = universaldetector.UniversalDetector() 29 | u.reset() 30 | u.feed(aBuf) 31 | u.close() 32 | return u.result 33 | -------------------------------------------------------------------------------- /python/requests/packages/charade/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | __version__ = "1.0.3" 19 | from sys import version_info 20 | 21 | 22 | def detect(aBuf): 23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or 24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))): 25 | raise ValueError('Expected a bytes object, not a unicode object') 26 | 27 | from . import universaldetector 28 | u = universaldetector.UniversalDetector() 29 | u.reset() 30 | u.feed(aBuf) 31 | u.close() 32 | return u.result 33 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/constants.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | _debug = 0 30 | 31 | eDetecting = 0 32 | eFoundIt = 1 33 | eNotMe = 2 34 | 35 | eStart = 0 36 | eError = 1 37 | eItsMe = 2 38 | 39 | SHORTCUT_THRESHOLD = 0.95 40 | -------------------------------------------------------------------------------- /python/khtcms.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) 2011 Benoit HERVIER 5 | # Licenced under GPLv3 6 | 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published 9 | # by the Free Software Foundation; version 3 only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | import requests 17 | 18 | 19 | class NetworkError(Exception): 20 | pass 21 | 22 | 23 | class KhtCMS(): 24 | 25 | def publish(self, url, title, type, text, apikey, verify_ssl): 26 | 27 | datas = {'apiKey': apikey, 28 | 'title': title, 29 | 'type': type, 30 | 'content': text} 31 | 32 | res = requests.post(url, data=datas, verify=verify_ssl) 33 | if res.status_code != requests.codes.ok: 34 | raise NetworkError('HTTP Error : %d' % res.status_code) 35 | else: 36 | print res.text 37 | jdata = res.json() 38 | if 'status' not in jdata: 39 | raise NetworkError('Invalid answer from KhtCMS API' 40 | % jdata['reason']) 41 | if jdata['status'] != 'success': 42 | raise NetworkError('%s' % jdata['reason']) 43 | -------------------------------------------------------------------------------- /Desktop/python/khtcms.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) 2011 Benoit HERVIER 5 | # Licenced under GPLv3 6 | 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published 9 | # by the Free Software Foundation; version 3 only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | import requests 17 | 18 | 19 | class NetworkError(Exception): 20 | pass 21 | 22 | 23 | class KhtCMS(): 24 | 25 | def publish(self, url, title, type, text, apikey, verify_ssl): 26 | 27 | datas = {'apiKey': apikey, 28 | 'title': title, 29 | 'type': type, 30 | 'content': text} 31 | 32 | res = requests.post(url, data=datas, verify=verify_ssl) 33 | if res.status_code != requests.codes.ok: 34 | raise NetworkError('HTTP Error : %d' % res.status_code) 35 | else: 36 | print res.text 37 | jdata = res.json() 38 | if 'status' not in jdata: 39 | raise NetworkError('Invalid answer from KhtCMS API' 40 | % jdata['reason']) 41 | if jdata['status'] != 'success': 42 | raise NetworkError('%s' % jdata['reason']) 43 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/constants.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | _debug = 0 30 | 31 | eDetecting = 0 32 | eFoundIt = 1 33 | eNotMe = 2 34 | 35 | eStart = 0 36 | eError = 1 37 | eItsMe = 2 38 | 39 | SHORTCUT_THRESHOLD = 0.95 40 | -------------------------------------------------------------------------------- /python/markdown/etree_loader.py: -------------------------------------------------------------------------------- 1 | 2 | ## Import 3 | def importETree(): 4 | """Import the best implementation of ElementTree, return a module object.""" 5 | etree_in_c = None 6 | try: # Is it Python 2.5+ with C implemenation of ElementTree installed? 7 | import xml.etree.cElementTree as etree_in_c 8 | from xml.etree.ElementTree import Comment 9 | except ImportError: 10 | try: # Is it Python 2.5+ with Python implementation of ElementTree? 11 | import xml.etree.ElementTree as etree 12 | except ImportError: 13 | try: # An earlier version of Python with cElementTree installed? 14 | import cElementTree as etree_in_c 15 | from elementtree.ElementTree import Comment 16 | except ImportError: 17 | try: # An earlier version of Python with Python ElementTree? 18 | import elementtree.ElementTree as etree 19 | except ImportError: 20 | raise ImportError("Failed to import ElementTree") 21 | if etree_in_c: 22 | if etree_in_c.VERSION < "1.0.5": 23 | raise RuntimeError("cElementTree version 1.0.5 or higher is required.") 24 | # Third party serializers (including ours) test with non-c Comment 25 | etree_in_c.test_comment = Comment 26 | return etree_in_c 27 | elif etree.VERSION < "1.1": 28 | raise RuntimeError("ElementTree version 1.1 or higher is required") 29 | else: 30 | return etree 31 | 32 | -------------------------------------------------------------------------------- /python/markdown/extensions/sane_lists.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Sane List Extension for Python-Markdown 4 | ======================================= 5 | 6 | Modify the behavior of Lists in Python-Markdown t act in a sane manor. 7 | 8 | In standard Markdown sytex, the following would constitute a single 9 | ordered list. However, with this extension, the output would include 10 | two lists, the first an ordered list and the second and unordered list. 11 | 12 | 1. ordered 13 | 2. list 14 | 15 | * unordered 16 | * list 17 | 18 | Copyright 2011 - [Waylan Limberg](http://achinghead.com) 19 | 20 | """ 21 | 22 | import re 23 | import markdown 24 | 25 | 26 | class SaneOListProcessor(markdown.blockprocessors.OListProcessor): 27 | 28 | CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.))[ ]+(.*)') 29 | SIBLING_TAGS = ['ol'] 30 | 31 | 32 | class SaneUListProcessor(markdown.blockprocessors.UListProcessor): 33 | 34 | CHILD_RE = re.compile(r'^[ ]{0,3}(([*+-]))[ ]+(.*)') 35 | SIBLING_TAGS = ['ul'] 36 | 37 | 38 | class SaneListExtension(markdown.Extension): 39 | """ Add sane lists to Markdown. """ 40 | 41 | def extendMarkdown(self, md, md_globals): 42 | """ Override existing Processors. """ 43 | md.parser.blockprocessors['olist'] = SaneOListProcessor(md.parser) 44 | md.parser.blockprocessors['ulist'] = SaneUListProcessor(md.parser) 45 | 46 | 47 | def makeExtension(configs={}): 48 | return SaneListExtension(configs=configs) 49 | 50 | -------------------------------------------------------------------------------- /Desktop/python/markdown/extensions/sane_lists.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Sane List Extension for Python-Markdown 4 | ======================================= 5 | 6 | Modify the behavior of Lists in Python-Markdown t act in a sane manor. 7 | 8 | In standard Markdown sytex, the following would constitute a single 9 | ordered list. However, with this extension, the output would include 10 | two lists, the first an ordered list and the second and unordered list. 11 | 12 | 1. ordered 13 | 2. list 14 | 15 | * unordered 16 | * list 17 | 18 | Copyright 2011 - [Waylan Limberg](http://achinghead.com) 19 | 20 | """ 21 | 22 | import re 23 | import markdown 24 | 25 | 26 | class SaneOListProcessor(markdown.blockprocessors.OListProcessor): 27 | 28 | CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.))[ ]+(.*)') 29 | SIBLING_TAGS = ['ol'] 30 | 31 | 32 | class SaneUListProcessor(markdown.blockprocessors.UListProcessor): 33 | 34 | CHILD_RE = re.compile(r'^[ ]{0,3}(([*+-]))[ ]+(.*)') 35 | SIBLING_TAGS = ['ul'] 36 | 37 | 38 | class SaneListExtension(markdown.Extension): 39 | """ Add sane lists to Markdown. """ 40 | 41 | def extendMarkdown(self, md, md_globals): 42 | """ Override existing Processors. """ 43 | md.parser.blockprocessors['olist'] = SaneOListProcessor(md.parser) 44 | md.parser.blockprocessors['ulist'] = SaneUListProcessor(md.parser) 45 | 46 | 47 | def makeExtension(configs={}): 48 | return SaneListExtension(configs=configs) 49 | 50 | -------------------------------------------------------------------------------- /Harmattan/qmlapplicationviewer/qmlapplicationviewer.h: -------------------------------------------------------------------------------- 1 | // checksum 0x898f version 0x70013 2 | /* 3 | This file was generated by the Qt Quick Application wizard of Qt Creator. 4 | QmlApplicationViewer is a convenience class containing mobile device specific 5 | code such as screen orientation handling. Also QML paths and debugging are 6 | handled here. 7 | It is recommended not to modify this file, since newer versions of Qt Creator 8 | may offer an updated version of it. 9 | */ 10 | 11 | #ifndef QMLAPPLICATIONVIEWER_H 12 | #define QMLAPPLICATIONVIEWER_H 13 | 14 | #include 15 | 16 | class QmlApplicationViewer : public QDeclarativeView 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | enum ScreenOrientation { 22 | ScreenOrientationLockPortrait, 23 | ScreenOrientationLockLandscape, 24 | ScreenOrientationAuto 25 | }; 26 | 27 | explicit QmlApplicationViewer(QWidget *parent = 0); 28 | virtual ~QmlApplicationViewer(); 29 | 30 | static QmlApplicationViewer *create(); 31 | 32 | void setMainQmlFile(const QString &file); 33 | void addImportPath(const QString &path); 34 | 35 | // Note that this will only have an effect on Symbian and Fremantle. 36 | void setOrientation(ScreenOrientation orientation); 37 | 38 | void showExpanded(); 39 | 40 | private: 41 | class QmlApplicationViewerPrivate *d; 42 | }; 43 | 44 | QApplication *createApplication(int &argc, char **argv); 45 | 46 | #endif // QMLAPPLICATIONVIEWER_H 47 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/khtcms.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) 2011 Benoit HERVIER 5 | # Licenced under GPLv3 6 | 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published 9 | # by the Free Software Foundation; version 3 only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | import requests 17 | 18 | 19 | class NetworkError(Exception): 20 | pass 21 | 22 | 23 | class KhtCMS(): 24 | 25 | def publish(self, url, title, type, text, apikey, verify_ssl): 26 | 27 | datas = {'apiKey': apikey, 28 | 'title': title, 29 | 'type': type, 30 | 'content': text} 31 | 32 | res = requests.post(url, data=datas, verify=verify_ssl) 33 | if res.status_code != requests.codes.ok: 34 | raise NetworkError('HTTP Error : %d' % res.status_code) 35 | else: 36 | print(res.text) 37 | jdata = res.json() 38 | if 'status' not in jdata: 39 | raise NetworkError('Invalid answer from KhtCMS API' 40 | % jdata['reason']) 41 | if jdata['status'] != 'success': 42 | raise NetworkError('%s' % jdata['reason']) 43 | -------------------------------------------------------------------------------- /Desktop/python/markdown/etree_loader.py: -------------------------------------------------------------------------------- 1 | 2 | ## Import 3 | def importETree(): 4 | """Import the best implementation of ElementTree, return a module object.""" 5 | etree_in_c = None 6 | try: # Is it Python 2.5+ with C implemenation of ElementTree installed? 7 | import xml.etree.cElementTree as etree_in_c 8 | from xml.etree.ElementTree import Comment 9 | except ImportError: 10 | try: # Is it Python 2.5+ with Python implementation of ElementTree? 11 | import xml.etree.ElementTree as etree 12 | except ImportError: 13 | try: # An earlier version of Python with cElementTree installed? 14 | import cElementTree as etree_in_c 15 | from elementtree.ElementTree import Comment 16 | except ImportError: 17 | try: # An earlier version of Python with Python ElementTree? 18 | import elementtree.ElementTree as etree 19 | except ImportError: 20 | raise ImportError("Failed to import ElementTree") 21 | if etree_in_c: 22 | if etree_in_c.VERSION < "1.0.5": 23 | raise RuntimeError("cElementTree version 1.0.5 or higher is required.") 24 | # Third party serializers (including ours) test with non-c Comment 25 | etree_in_c.test_comment = Comment 26 | return etree_in_c 27 | elif etree.VERSION < "1.1": 28 | raise RuntimeError("ElementTree version 1.1 or higher is required") 29 | else: 30 | return etree 31 | 32 | -------------------------------------------------------------------------------- /python/requests/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.exceptions 5 | ~~~~~~~~~~~~~~~~~~~ 6 | 7 | This module contains the set of Requests' exceptions. 8 | 9 | """ 10 | 11 | 12 | class RequestException(RuntimeError): 13 | """There was an ambiguous exception that occurred while handling your 14 | request.""" 15 | 16 | 17 | class HTTPError(RequestException): 18 | """An HTTP error occurred.""" 19 | 20 | def __init__(self, *args, **kwargs): 21 | """ Initializes HTTPError with optional `response` object. """ 22 | self.response = kwargs.pop('response', None) 23 | super(HTTPError, self).__init__(*args, **kwargs) 24 | 25 | 26 | class ConnectionError(RequestException): 27 | """A Connection error occurred.""" 28 | 29 | 30 | class SSLError(ConnectionError): 31 | """An SSL error occurred.""" 32 | 33 | 34 | class Timeout(RequestException): 35 | """The request timed out.""" 36 | 37 | 38 | class URLRequired(RequestException): 39 | """A valid URL is required to make a request.""" 40 | 41 | 42 | class TooManyRedirects(RequestException): 43 | """Too many redirects.""" 44 | 45 | 46 | class MissingSchema(RequestException, ValueError): 47 | """The URL schema (e.g. http or https) is missing.""" 48 | 49 | 50 | class InvalidSchema(RequestException, ValueError): 51 | """See defaults.py for valid schemas.""" 52 | 53 | 54 | class InvalidURL(RequestException, ValueError): 55 | """ The URL provided was somehow invalid. """ 56 | -------------------------------------------------------------------------------- /python/requests/packages/charade/constants.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | _debug = 0 30 | 31 | eDetecting = 0 32 | eFoundIt = 1 33 | eNotMe = 2 34 | 35 | eStart = 0 36 | eError = 1 37 | eItsMe = 2 38 | 39 | SHORTCUT_THRESHOLD = 0.95 40 | -------------------------------------------------------------------------------- /python/scriptogram.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) 2011 Benoit HERVIER 5 | # Licenced under GPLv3 6 | 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published 9 | # by the Free Software Foundation; version 3 only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | import requests 17 | 18 | 19 | class NetworkError(Exception): 20 | pass 21 | 22 | 23 | class Scriptogram(): 24 | app_key = 'v2sgBSIBgWfb942b5960126f830ed8c44f8839d21a' 25 | 26 | def publish(self, title, user_id, text): 27 | url = 'http://scriptogr.am/api/article/post/' 28 | datas = {'app_key': self.app_key, 29 | 'user_id': user_id, 30 | 'name': title, 31 | 'text': text} 32 | 33 | res = requests.post(url, data=datas) 34 | if res.status_code != requests.codes.ok: 35 | raise NetworkError('HTTP Error : %d' % res.status_code) 36 | else: 37 | if 'status' not in res.json(): 38 | raise NetworkError('Invalid answer from scriptogr.am API' 39 | % res.json()['reason']) 40 | if res.json()['status'] != 'success': 41 | raise NetworkError('%s' % res.json()['reason']) 42 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/markdown/extensions/sane_lists.py: -------------------------------------------------------------------------------- 1 | """ 2 | Sane List Extension for Python-Markdown 3 | ======================================= 4 | 5 | Modify the behavior of Lists in Python-Markdown t act in a sane manor. 6 | 7 | In standard Markdown sytex, the following would constitute a single 8 | ordered list. However, with this extension, the output would include 9 | two lists, the first an ordered list and the second and unordered list. 10 | 11 | 1. ordered 12 | 2. list 13 | 14 | * unordered 15 | * list 16 | 17 | Copyright 2011 - [Waylan Limberg](http://achinghead.com) 18 | 19 | """ 20 | 21 | from __future__ import absolute_import 22 | from __future__ import unicode_literals 23 | from . import Extension 24 | from ..blockprocessors import OListProcessor, UListProcessor 25 | import re 26 | 27 | 28 | class SaneOListProcessor(OListProcessor): 29 | 30 | CHILD_RE = re.compile(r'^[ ]{0,3}((\d+\.))[ ]+(.*)') 31 | SIBLING_TAGS = ['ol'] 32 | 33 | 34 | class SaneUListProcessor(UListProcessor): 35 | 36 | CHILD_RE = re.compile(r'^[ ]{0,3}(([*+-]))[ ]+(.*)') 37 | SIBLING_TAGS = ['ul'] 38 | 39 | 40 | class SaneListExtension(Extension): 41 | """ Add sane lists to Markdown. """ 42 | 43 | def extendMarkdown(self, md, md_globals): 44 | """ Override existing Processors. """ 45 | md.parser.blockprocessors['olist'] = SaneOListProcessor(md.parser) 46 | md.parser.blockprocessors['ulist'] = SaneUListProcessor(md.parser) 47 | 48 | 49 | def makeExtension(configs={}): 50 | return SaneListExtension(configs=configs) 51 | 52 | -------------------------------------------------------------------------------- /Desktop/python/scriptogram.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) 2011 Benoit HERVIER 5 | # Licenced under GPLv3 6 | 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published 9 | # by the Free Software Foundation; version 3 only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | import requests 17 | 18 | 19 | class NetworkError(Exception): 20 | pass 21 | 22 | 23 | class Scriptogram(): 24 | app_key = 'v2sgBSIBgWfb942b5960126f830ed8c44f8839d21a' 25 | 26 | def publish(self, title, user_id, text): 27 | url = 'http://scriptogr.am/api/article/post/' 28 | datas = {'app_key': self.app_key, 29 | 'user_id': user_id, 30 | 'name': title, 31 | 'text': text} 32 | 33 | res = requests.post(url, data=datas) 34 | if res.status_code != requests.codes.ok: 35 | raise NetworkError('HTTP Error : %d' % res.status_code) 36 | else: 37 | if 'status' not in res.json(): 38 | raise NetworkError('Invalid answer from scriptogr.am API' 39 | % res.json()['reason']) 40 | if res.json()['status'] != 'success': 41 | raise NetworkError('%s' % res.json()['reason']) 42 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/scriptogram.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (c) 2011 Benoit HERVIER 5 | # Licenced under GPLv3 6 | 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published 9 | # by the Free Software Foundation; version 3 only. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | 16 | import requests 17 | 18 | 19 | class NetworkError(Exception): 20 | pass 21 | 22 | 23 | class Scriptogram(): 24 | app_key = 'v2sgBSIBgWfb942b5960126f830ed8c44f8839d21a' 25 | 26 | def publish(self, title, user_id, text): 27 | url = 'http://scriptogr.am/api/article/post/' 28 | datas = {'app_key': self.app_key, 29 | 'user_id': user_id, 30 | 'name': title, 31 | 'text': text} 32 | 33 | res = requests.post(url, data=datas) 34 | if res.status_code != requests.codes.ok: 35 | raise NetworkError('HTTP Error : %d' % res.status_code) 36 | else: 37 | if 'status' not in res.json(): 38 | raise NetworkError('Invalid answer from scriptogr.am API' 39 | % res.json()['reason']) 40 | if res.json()['status'] != 'success': 41 | raise NetworkError('%s' % res.json()['reason']) 42 | -------------------------------------------------------------------------------- /python/webdav/acp/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008 German Aerospace Center (DLR) 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | from webdav import Constants 17 | from webdav.acp.Acl import ACL 18 | from webdav.acp.Ace import ACE 19 | from webdav.acp.GrantDeny import GrantDeny 20 | from webdav.acp.Privilege import Privilege 21 | from webdav.acp.Principal import Principal 22 | 23 | 24 | __version__ = "$LastChangedRevision$" 25 | 26 | 27 | privileges = [Constants.TAG_READ, Constants.TAG_WRITE, Constants.TAG_WRITE_PROPERTIES, 28 | Constants.TAG_WRITE_CONTENT, Constants.TAG_UNLOCK, Constants.TAG_READ_ACL, 29 | Constants.TAG_READ_CURRENT_USER_PRIVILEGE_SET, Constants.TAG_WRITE_ACL, Constants.TAG_ALL, 30 | Constants.TAG_BIND, Constants.TAG_UNBIND, Constants.TAG_TAMINO_SECURITY, 31 | Constants.TAG_BIND_COLLECTION, Constants.TAG_UNBIND_COLLECTION, Constants.TAG_READ_PRIVATE_PROPERTIES, 32 | Constants.TAG_WRITE_PRIVATE_PROPERTIES] 33 | Privilege.registerPrivileges(privileges) 34 | -------------------------------------------------------------------------------- /Harmattan/debian/changelog: -------------------------------------------------------------------------------- 1 | ownnotes (1.2.3) unstable; urgency=low 2 | 3 | * Bump release version (as previous release didn\'t display right version) 4 | 5 | -- Benoît HERVIER Sat, 23 Nov 2013 17:24:55 +0100 6 | 7 | ownnotes (1.2.2) unstable; urgency=low 8 | 9 | * Fix unicode error in list view 10 | 11 | -- Benoît HERVIER Sat, 23 Nov 2013 13:15:45 +0100 12 | 13 | ownnotes (1.2.1) unstable; urgency=low 14 | * Fix sync encoding error in sync 15 | 16 | -- Benoît HERVIER Sat, 23 Nov 2013 08:33:27 +0100 17 | 18 | ownnotes (1.2.0) unstable; urgency=low 19 | * Fix rehighlighting bug 20 | * Russian and French translation of Sailfish UI 21 | * Fix sync encoding error 22 | 23 | -- Benoît HERVIER Wed, 20 Nov 2013 22:44:22 +0100 24 | 25 | ownnotes (1.1.0) unstable; urgency=low 26 | * Fix an other rehighlight bug 27 | * First desktop UI Release 28 | 29 | -- Benoît HERVIER Fri, 04 Oct 2013 11:07:11 +0200 30 | 31 | ownnotes (1.0.2) unstable; urgency=low 32 | * Fix position cursor error on rehighlight 33 | 34 | -- Benoît HERVIER Tue, 17 Sep 2013 07:45:44 +0200 35 | 36 | ownnotes (1.0.1) unstable; urgency=low 37 | * Add auto sync on launch 38 | * Push note to sync server once saved 39 | 40 | -- Benoît HERVIER Fri, 23 Aug 2013 08:51:04 +0200 41 | 42 | ownnotes (1.0.0) unstable; urgency=low 43 | 44 | * Initial Release. 45 | 46 | -- Benoît HERVIER Mon, 05 Aug 2013 16:29:33 +0200 47 | -------------------------------------------------------------------------------- /Harmattan/qml/Harmattan/components/TitleLabel.qml: -------------------------------------------------------------------------------- 1 | // This file qml component is part of KhtNotes but 2 | // was copied from IRC Chatter, the first IRC Client for MeeGo. 3 | // 4 | // This program is free software: you can redistribute it and/or modify 5 | // it under the terms of the GNU General Public License as published by 6 | // the Free Software Foundation, either version 2 of the License, or 7 | // (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // You should have received a copy of the GNU General Public License 15 | // along with this program. If not, see . 16 | // 17 | // Copyright (C) 2011-2012, Timur Kristóf 18 | // Copyright (C) 2011, Hiemanshu Sharma 19 | 20 | import QtQuick 1.1 21 | import com.nokia.meego 1.0 22 | 23 | Row { 24 | id: titleLabel 25 | spacing: 10 26 | width: parent.width 27 | anchors.bottomMargin: 10 28 | 29 | property string text: "Your title here" 30 | 31 | Rectangle { 32 | anchors.verticalCenter: parent.verticalCenter 33 | height: 1 34 | color: "#000000" 35 | width: (parent.width - title1.width) - 10 36 | } 37 | Label { 38 | id: title1 39 | text: titleLabel.text 40 | font.bold: true 41 | font.pixelSize: 20 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Harmattan/qtc_packaging/debian_harmattan/changelog: -------------------------------------------------------------------------------- 1 | ownnotes (1.2.3) unstable; urgency=low 2 | 3 | * Bump release version (as previous release didn\'t display right version) 4 | 5 | -- Benoît HERVIER Sat, 23 Nov 2013 17:24:55 +0100 6 | 7 | ownnotes (1.2.2) unstable; urgency=low 8 | 9 | * Fix unicode error in list view 10 | 11 | -- Benoît HERVIER Sat, 23 Nov 2013 13:15:45 +0100 12 | 13 | ownnotes (1.2.1) unstable; urgency=low 14 | * Fix sync encoding error in sync 15 | 16 | -- Benoît HERVIER Sat, 23 Nov 2013 08:33:27 +0100 17 | 18 | ownnotes (1.2.0) unstable; urgency=low 19 | * Fix rehighlighting bug 20 | * Russian and French translation of Sailfish UI 21 | * Fix sync encoding error 22 | 23 | -- Benoît HERVIER Wed, 20 Nov 2013 22:44:22 +0100 24 | 25 | ownnotes (1.1.0) unstable; urgency=low 26 | * Fix an other rehighlight bug 27 | * First desktop UI Release 28 | 29 | -- Benoît HERVIER Fri, 04 Oct 2013 11:07:11 +0200 30 | 31 | ownnotes (1.0.2) unstable; urgency=low 32 | * Fix position cursor error on rehighlight 33 | 34 | -- Benoît HERVIER Tue, 17 Sep 2013 07:45:44 +0200 35 | 36 | ownnotes (1.0.1) unstable; urgency=low 37 | * Add auto sync on launch 38 | * Push note to sync server once saved 39 | 40 | -- Benoît HERVIER Fri, 23 Aug 2013 08:51:04 +0200 41 | 42 | ownnotes (1.0.0) unstable; urgency=low 43 | 44 | * Initial Release. 45 | 46 | -- Benoît HERVIER Mon, 05 Aug 2013 16:29:33 +0200 47 | -------------------------------------------------------------------------------- /python/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008 German Aerospace Center (DLR) 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Module from the libwebdav module 16 | 17 | """" 18 | Module provides access to a configured logger instance. 19 | The logger writes C{sys.stdout}. 20 | """ 21 | 22 | import logging 23 | import sys 24 | 25 | 26 | _defaultLoggerName = "ownNotes" 27 | _fileLogFormat = "%(asctime)s: %(levelname)s: %(message)s" 28 | 29 | 30 | def getDefaultLogger(handler=None): 31 | """ 32 | Returns a configured logger object. 33 | 34 | @return: Logger instance. 35 | @rtype: C{logging.Logger} 36 | """ 37 | 38 | myLogger = logging.getLogger(_defaultLoggerName) 39 | if len(myLogger.handlers) == 0: 40 | myLogger.level = logging.DEBUG 41 | formatter = logging.Formatter(_fileLogFormat) 42 | if handler is None: 43 | stdoutHandler = logging.StreamHandler(sys.stdout) 44 | stdoutHandler.setFormatter(formatter) 45 | myLogger.addHandler(stdoutHandler) 46 | else: 47 | myLogger.addHandler(handler) 48 | return myLogger 49 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/markdown/extensions/smart_strong.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Smart_Strong Extension for Python-Markdown 3 | ========================================== 4 | 5 | This extention adds smarter handling of double underscores within words. 6 | 7 | Simple Usage: 8 | 9 | >>> import markdown 10 | >>> print markdown.markdown('Text with double__underscore__words.', 11 | ... extensions=['smart_strong']) 12 |

Text with double__underscore__words.

13 | >>> print markdown.markdown('__Strong__ still works.', 14 | ... extensions=['smart_strong']) 15 |

Strong still works.

16 | >>> print markdown.markdown('__this__works__too__.', 17 | ... extensions=['smart_strong']) 18 |

this__works__too.

19 | 20 | Copyright 2011 21 | [Waylan Limberg](http://achinghead.com) 22 | 23 | ''' 24 | 25 | from __future__ import absolute_import 26 | from __future__ import unicode_literals 27 | from . import Extension 28 | from ..inlinepatterns import SimpleTagPattern 29 | 30 | SMART_STRONG_RE = r'(?emphasis2') 40 | 41 | def makeExtension(configs={}): 42 | return SmartEmphasisExtension(configs=dict(configs)) 43 | -------------------------------------------------------------------------------- /python/markdown/extensions/smart_strong.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Smart_Strong Extension for Python-Markdown 3 | ========================================== 4 | 5 | This extention adds smarter handling of double underscores within words. 6 | 7 | Simple Usage: 8 | 9 | >>> import markdown 10 | >>> print markdown.markdown('Text with double__underscore__words.', 11 | ... extensions=['smart_strong']) 12 |

Text with double__underscore__words.

13 | >>> print markdown.markdown('__Strong__ still works.', 14 | ... extensions=['smart_strong']) 15 |

Strong still works.

16 | >>> print markdown.markdown('__this__works__too__.', 17 | ... extensions=['smart_strong']) 18 |

this__works__too.

19 | 20 | Copyright 2011 21 | [Waylan Limberg](http://achinghead.com) 22 | 23 | ''' 24 | 25 | import re 26 | import markdown 27 | from markdown.inlinepatterns import SimpleTagPattern 28 | 29 | SMART_STRONG_RE = r'(?emphasis2') 39 | 40 | def makeExtension(configs={}): 41 | return SmartEmphasisExtension(configs=dict(configs)) 42 | 43 | if __name__ == '__main__': 44 | import doctest 45 | doctest.testmod() 46 | -------------------------------------------------------------------------------- /Desktop/python/markdown/extensions/smart_strong.py: -------------------------------------------------------------------------------- 1 | ''' 2 | Smart_Strong Extension for Python-Markdown 3 | ========================================== 4 | 5 | This extention adds smarter handling of double underscores within words. 6 | 7 | Simple Usage: 8 | 9 | >>> import markdown 10 | >>> print markdown.markdown('Text with double__underscore__words.', 11 | ... extensions=['smart_strong']) 12 |

Text with double__underscore__words.

13 | >>> print markdown.markdown('__Strong__ still works.', 14 | ... extensions=['smart_strong']) 15 |

Strong still works.

16 | >>> print markdown.markdown('__this__works__too__.', 17 | ... extensions=['smart_strong']) 18 |

this__works__too.

19 | 20 | Copyright 2011 21 | [Waylan Limberg](http://achinghead.com) 22 | 23 | ''' 24 | 25 | import re 26 | import markdown 27 | from markdown.inlinepatterns import SimpleTagPattern 28 | 29 | SMART_STRONG_RE = r'(?emphasis2') 39 | 40 | def makeExtension(configs={}): 41 | return SmartEmphasisExtension(configs=dict(configs)) 42 | 43 | if __name__ == '__main__': 44 | import doctest 45 | doctest.testmod() 46 | -------------------------------------------------------------------------------- /python/webdav/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008 German Aerospace Center (DLR) 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | 16 | """" 17 | Module provides access to a configured logger instance. 18 | The logger writes C{sys.stdout}. 19 | """ 20 | 21 | 22 | import logging 23 | import sys 24 | 25 | 26 | __version__ = "$LastChangedRevision$"[11:-2] 27 | 28 | 29 | _defaultLoggerName = "webdavLogger" 30 | _fileLogFormat = "%(asctime)s: %(levelname)s: %(message)s" 31 | 32 | 33 | def getDefaultLogger(handler=None): 34 | """ 35 | Returns a configured logger object. 36 | 37 | @return: Logger instance. 38 | @rtype: C{logging.Logger} 39 | """ 40 | 41 | myLogger = logging.getLogger(_defaultLoggerName) 42 | if len(myLogger.handlers) == 0: 43 | myLogger.level = logging.DEBUG 44 | formatter = logging.Formatter(_fileLogFormat) 45 | if handler is None: 46 | stdoutHandler = logging.StreamHandler(sys.stdout) 47 | stdoutHandler.setFormatter(formatter) 48 | myLogger.addHandler(stdoutHandler) 49 | else: 50 | myLogger.addHandler(handler) 51 | return myLogger 52 | -------------------------------------------------------------------------------- /python/md5util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (C) 2007 Khertan khertan@khertan.net 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published 8 | # by the Free Software Foundation; version 2 only. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # md5hash 16 | # 17 | # 2004-01-30 18 | # Nick Vargish 19 | # 20 | # 2012-05-31 21 | # Benoit HERVIER (Khertan) use now hashlib 22 | # 23 | # Simple md5 hash utility for generating md5 checksums of files. 24 | # 25 | # usage: md5hash [..] 26 | # 27 | # Use '-' as filename to sum standard input. 28 | 29 | from hashlib import md5 30 | import sys 31 | 32 | 33 | def sumfile(fobj): 34 | '''Returns an md5 hash for an object with read() method.''' 35 | m = md5() 36 | while True: 37 | d = fobj.read(8096) 38 | if not d: 39 | break 40 | m.update(d) 41 | return m.hexdigest() 42 | 43 | 44 | def md5sum(fname): 45 | '''Returns an md5 hash for file fname, or stdin if fname is "-".''' 46 | if fname == '-': 47 | ret = sumfile(sys.stdin) 48 | else: 49 | try: 50 | f = file(fname, 'rb') 51 | except: 52 | return 'Failed to open file' 53 | ret = sumfile(f) 54 | f.close() 55 | return ret 56 | 57 | 58 | # if invoked on command line, print md5 hashes of specified files. 59 | if __name__ == '__main__': 60 | for fname in sys.argv[1:]: 61 | print '%32s %s' % (md5sum(fname), fname) 62 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/pyaes/util.py: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2014 Richard Moore 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | 24 | def append_PKCS7_padding(data): 25 | pad = 16 - (len(data) % 16) 26 | return data + pad * chr(pad) 27 | 28 | def strip_PKCS7_padding(data): 29 | if len(data) % 16 != 0: 30 | raise ValueError("invalid length") 31 | 32 | pad = ord(data[-1]) 33 | 34 | if pad > 16: 35 | raise ValueError("invalid padding byte") 36 | 37 | return data[:-pad] 38 | 39 | if __name__ == '__main__': 40 | for i in range(0, 17): 41 | data = 'A' * i 42 | padded = append_PKCS7_padding(data) 43 | print(repr(padded), strip_PKCS7_padding(padded) == data) 44 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/md5util.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | # 4 | # Copyright (C) 2007 Khertan khertan@khertan.net 5 | # 6 | # This program is free software; you can redistribute it and/or modify 7 | # it under the terms of the GNU General Public License as published 8 | # by the Free Software Foundation; version 2 only. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # md5hash 16 | # 17 | # 2004-01-30 18 | # Nick Vargish 19 | # 20 | # 2012-05-31 21 | # Benoit HERVIER (Khertan) use now hashlib 22 | # 23 | # Simple md5 hash utility for generating md5 checksums of files. 24 | # 25 | # usage: md5hash [..] 26 | # 27 | # Use '-' as filename to sum standard input. 28 | 29 | from hashlib import md5 30 | import sys 31 | 32 | 33 | def sumfile(fobj): 34 | '''Returns an md5 hash for an object with read() method.''' 35 | m = md5() 36 | while True: 37 | d = fobj.read(8096) 38 | if not d: 39 | break 40 | m.update(d) 41 | return m.hexdigest() 42 | 43 | 44 | def md5sum(fname): 45 | '''Returns an md5 hash for file fname, or stdin if fname is "-".''' 46 | if fname == '-': 47 | ret = sumfile(sys.stdin) 48 | else: 49 | try: 50 | f = file(fname, 'rb') 51 | except: 52 | return 'Failed to open file' 53 | ret = sumfile(f) 54 | f.close() 55 | return ret 56 | 57 | 58 | # if invoked on command line, print md5 hashes of specified files. 59 | if __name__ == '__main__': 60 | for fname in sys.argv[1:]: 61 | print('%32s %s' % (md5sum(fname), fname)) 62 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/pyaes/util.py.bak: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2014 Richard Moore 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | 24 | def append_PKCS7_padding(data): 25 | pad = 16 - (len(data) % 16) 26 | return data + pad * chr(pad) 27 | 28 | def strip_PKCS7_padding(data): 29 | if len(data) % 16 != 0: 30 | raise ValueError("invalid length") 31 | 32 | pad = ord(data[-1]) 33 | 34 | if pad > 16: 35 | raise ValueError("invalid padding byte") 36 | 37 | return data[:-pad] 38 | 39 | if __name__ == '__main__': 40 | for i in xrange(0, 17): 41 | data = 'A' * i 42 | padded = append_PKCS7_padding(data) 43 | print repr(padded), strip_PKCS7_padding(padded) == data 44 | -------------------------------------------------------------------------------- /Harmattan/qpython.h: -------------------------------------------------------------------------------- 1 | #ifndef _QPYTHON_H 2 | #define _QPYTHON_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "Python.h" 12 | 13 | 14 | class QPython : public QObject 15 | { 16 | Q_OBJECT 17 | 18 | public: 19 | QPython(QObject *parent=NULL); 20 | virtual ~QPython(); 21 | 22 | Q_INVOKABLE void 23 | addImportPath(QString path); 24 | 25 | Q_INVOKABLE bool 26 | importModule(QString name); 27 | 28 | Q_INVOKABLE QVariant 29 | evaluate(QString expr); 30 | 31 | Q_INVOKABLE QVariant 32 | call(QString func, QVariant args); 33 | 34 | Q_INVOKABLE void 35 | threadedCall(QString func, QVariant args); 36 | 37 | static void 38 | registerQML(); 39 | 40 | // Convert a Python value to a Qt value 41 | QVariant fromPython(PyObject *o); 42 | 43 | // Convert a Qt value to a Python value 44 | PyObject *toPython(QVariant v); 45 | 46 | // Internal function to evaluate a string to a PyObject * 47 | // Used by evaluate() and call() 48 | PyObject *eval(QString expr); 49 | 50 | private: 51 | PyObject *locals; 52 | PyObject *globals; 53 | QList > futures; 54 | QList *> watchers; 55 | 56 | static int instances; 57 | 58 | signals: 59 | void finished(); 60 | void message(const QVariant data); 61 | void exception(const QString type, const QString data); 62 | 63 | public slots: 64 | void threadedCallFinished(); 65 | void threadedCallResultReady(int index); 66 | 67 | }; 68 | 69 | #endif 70 | 71 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/euctwprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCTWDistributionAnalysis 31 | from .mbcssm import EUCTWSMModel 32 | 33 | class EUCTWProber(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel) 37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "EUC-TW" 42 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/euckrprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import EUCKRSMModel 32 | 33 | 34 | class EUCKRProber(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel) 38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "EUC-KR" 43 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/gb2312prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import GB2312DistributionAnalysis 31 | from .mbcssm import GB2312SMModel 32 | 33 | class GB2312Prober(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(GB2312SMModel) 37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "GB2312" 42 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/euctwprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCTWDistributionAnalysis 31 | from .mbcssm import EUCTWSMModel 32 | 33 | class EUCTWProber(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel) 37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "EUC-TW" 42 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/big5prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Communicator client code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import Big5DistributionAnalysis 31 | from .mbcssm import Big5SMModel 32 | 33 | 34 | class Big5Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(Big5SMModel) 38 | self._mDistributionAnalyzer = Big5DistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "Big5" 43 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/euckrprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import EUCKRSMModel 32 | 33 | 34 | class EUCKRProber(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel) 38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "EUC-KR" 43 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/gb2312prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import GB2312DistributionAnalysis 31 | from .mbcssm import GB2312SMModel 32 | 33 | class GB2312Prober(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(GB2312SMModel) 37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "GB2312" 42 | -------------------------------------------------------------------------------- /python/markdown/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Extensions 3 | ----------------------------------------------------------------------------- 4 | """ 5 | 6 | class Extension: 7 | """ Base class for extensions to subclass. """ 8 | def __init__(self, configs = {}): 9 | """Create an instance of an Extention. 10 | 11 | Keyword arguments: 12 | 13 | * configs: A dict of configuration setting used by an Extension. 14 | """ 15 | self.config = configs 16 | 17 | def getConfig(self, key, default=''): 18 | """ Return a setting for the given key or an empty string. """ 19 | if key in self.config: 20 | return self.config[key][0] 21 | else: 22 | return default 23 | 24 | def getConfigs(self): 25 | """ Return all configs settings as a dict. """ 26 | return dict([(key, self.getConfig(key)) for key in self.config.keys()]) 27 | 28 | def getConfigInfo(self): 29 | """ Return all config descriptions as a list of tuples. """ 30 | return [(key, self.config[key][1]) for key in self.config.keys()] 31 | 32 | def setConfig(self, key, value): 33 | """ Set a config setting for `key` with the given `value`. """ 34 | self.config[key][0] = value 35 | 36 | def extendMarkdown(self, md, md_globals): 37 | """ 38 | Add the various proccesors and patterns to the Markdown Instance. 39 | 40 | This method must be overriden by every extension. 41 | 42 | Keyword arguments: 43 | 44 | * md: The Markdown instance. 45 | 46 | * md_globals: Global variables in the markdown module namespace. 47 | 48 | """ 49 | raise NotImplementedError, 'Extension "%s.%s" must define an "extendMarkdown"' \ 50 | 'method.' % (self.__class__.__module__, self.__class__.__name__) 51 | 52 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/big5prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Communicator client code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import Big5DistributionAnalysis 31 | from .mbcssm import Big5SMModel 32 | 33 | 34 | class Big5Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(Big5SMModel) 38 | self._mDistributionAnalyzer = Big5DistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "Big5" 43 | -------------------------------------------------------------------------------- /Desktop/python/markdown/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Extensions 3 | ----------------------------------------------------------------------------- 4 | """ 5 | 6 | class Extension: 7 | """ Base class for extensions to subclass. """ 8 | def __init__(self, configs = {}): 9 | """Create an instance of an Extention. 10 | 11 | Keyword arguments: 12 | 13 | * configs: A dict of configuration setting used by an Extension. 14 | """ 15 | self.config = configs 16 | 17 | def getConfig(self, key, default=''): 18 | """ Return a setting for the given key or an empty string. """ 19 | if key in self.config: 20 | return self.config[key][0] 21 | else: 22 | return default 23 | 24 | def getConfigs(self): 25 | """ Return all configs settings as a dict. """ 26 | return dict([(key, self.getConfig(key)) for key in self.config.keys()]) 27 | 28 | def getConfigInfo(self): 29 | """ Return all config descriptions as a list of tuples. """ 30 | return [(key, self.config[key][1]) for key in self.config.keys()] 31 | 32 | def setConfig(self, key, value): 33 | """ Set a config setting for `key` with the given `value`. """ 34 | self.config[key][0] = value 35 | 36 | def extendMarkdown(self, md, md_globals): 37 | """ 38 | Add the various proccesors and patterns to the Markdown Instance. 39 | 40 | This method must be overriden by every extension. 41 | 42 | Keyword arguments: 43 | 44 | * md: The Markdown instance. 45 | 46 | * md_globals: Global variables in the markdown module namespace. 47 | 48 | """ 49 | raise NotImplementedError, 'Extension "%s.%s" must define an "extendMarkdown"' \ 50 | 'method.' % (self.__class__.__module__, self.__class__.__name__) 51 | 52 | -------------------------------------------------------------------------------- /Desktop/qpython.h: -------------------------------------------------------------------------------- 1 | #ifndef _QPYTHON_H 2 | #define _QPYTHON_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | class QPython : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | QPython(QObject *parent=NULL); 21 | virtual ~QPython(); 22 | 23 | Q_INVOKABLE void 24 | addImportPath(QString path); 25 | 26 | Q_INVOKABLE bool 27 | importModule(QString name); 28 | 29 | Q_INVOKABLE QVariant 30 | evaluate(QString expr); 31 | 32 | Q_INVOKABLE QVariant 33 | call(QString func, QVariant args); 34 | 35 | Q_INVOKABLE void 36 | threadedCall(QString func, QVariant args); 37 | 38 | static void 39 | registerQML(); 40 | 41 | // Convert a Python value to a Qt value 42 | QVariant fromPython(PyObject *o); 43 | 44 | // Convert a Qt value to a Python value 45 | PyObject *toPython(QVariant v); 46 | 47 | // Internal function to evaluate a string to a PyObject * 48 | // Used by evaluate() and call() 49 | PyObject *eval(QString expr); 50 | 51 | private: 52 | PyObject *locals; 53 | PyObject *globals; 54 | QList > futures; 55 | QList *> watchers; 56 | 57 | static int instances; 58 | 59 | signals: 60 | void finished(); 61 | void message(const QVariant data); 62 | void exception(const QString type, const QString data); 63 | 64 | public slots: 65 | void threadedCallFinished(); 66 | void threadedCallResultReady(int index); 67 | 68 | }; 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /python/requests/packages/charade/euctwprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCTWDistributionAnalysis 31 | from .mbcssm import EUCTWSMModel 32 | 33 | class EUCTWProber(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(EUCTWSMModel) 37 | self._mDistributionAnalyzer = EUCTWDistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "EUC-TW" 42 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/logger.py: -------------------------------------------------------------------------------- 1 | # Copyright 2008 German Aerospace Center (DLR) 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | 15 | # Module from the libwebdav module 16 | 17 | """" 18 | Module provides access to a configured logger instance. 19 | The logger writes C{sys.stdout}. 20 | """ 21 | 22 | import logging 23 | from logging.handlers import RotatingFileHandler 24 | import os 25 | 26 | 27 | class Logger(): 28 | 29 | def __init__(self, debug=False): 30 | self.logger = logging.getLogger('ownNotes') 31 | formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') 32 | 33 | if debug: 34 | # File Log 35 | file_hdlr = RotatingFileHandler(os.path.join( 36 | os.path.expanduser('~/.ownnotes/'), 37 | 'OwnNotes Log.log'), 38 | 100000, 1) 39 | file_hdlr.setFormatter(formatter) 40 | file_hdlr.setLevel(logging.DEBUG) 41 | self.logger.addHandler(file_hdlr) 42 | 43 | # Steam Log 44 | steam_hdlr = logging.StreamHandler() 45 | steam_hdlr.setFormatter(formatter) 46 | steam_hdlr.setLevel(logging.DEBUG) 47 | self.logger.addHandler(steam_hdlr) 48 | 49 | if debug: 50 | self.logger.setLevel(logging.DEBUG) 51 | -------------------------------------------------------------------------------- /python/requests/packages/charade/euckrprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import EUCKRSMModel 32 | 33 | 34 | class EUCKRProber(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(EUCKRSMModel) 38 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "EUC-KR" 43 | -------------------------------------------------------------------------------- /python/requests/packages/charade/gb2312prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import GB2312DistributionAnalysis 31 | from .mbcssm import GB2312SMModel 32 | 33 | class GB2312Prober(MultiByteCharSetProber): 34 | def __init__(self): 35 | MultiByteCharSetProber.__init__(self) 36 | self._mCodingSM = CodingStateMachine(GB2312SMModel) 37 | self._mDistributionAnalyzer = GB2312DistributionAnalysis() 38 | self.reset() 39 | 40 | def get_charset_name(self): 41 | return "GB2312" 42 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/markdown/extensions/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Extensions 3 | ----------------------------------------------------------------------------- 4 | """ 5 | 6 | from __future__ import unicode_literals 7 | 8 | class Extension(object): 9 | """ Base class for extensions to subclass. """ 10 | def __init__(self, configs = {}): 11 | """Create an instance of an Extention. 12 | 13 | Keyword arguments: 14 | 15 | * configs: A dict of configuration setting used by an Extension. 16 | """ 17 | self.config = configs 18 | 19 | def getConfig(self, key, default=''): 20 | """ Return a setting for the given key or an empty string. """ 21 | if key in self.config: 22 | return self.config[key][0] 23 | else: 24 | return default 25 | 26 | def getConfigs(self): 27 | """ Return all configs settings as a dict. """ 28 | return dict([(key, self.getConfig(key)) for key in self.config.keys()]) 29 | 30 | def getConfigInfo(self): 31 | """ Return all config descriptions as a list of tuples. """ 32 | return [(key, self.config[key][1]) for key in self.config.keys()] 33 | 34 | def setConfig(self, key, value): 35 | """ Set a config setting for `key` with the given `value`. """ 36 | self.config[key][0] = value 37 | 38 | def extendMarkdown(self, md, md_globals): 39 | """ 40 | Add the various proccesors and patterns to the Markdown Instance. 41 | 42 | This method must be overriden by every extension. 43 | 44 | Keyword arguments: 45 | 46 | * md: The Markdown instance. 47 | 48 | * md_globals: Global variables in the markdown module namespace. 49 | 50 | """ 51 | raise NotImplementedError('Extension "%s.%s" must define an "extendMarkdown"' \ 52 | 'method.' % (self.__class__.__module__, self.__class__.__name__)) 53 | 54 | -------------------------------------------------------------------------------- /python/requests/packages/charade/big5prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Communicator client code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import Big5DistributionAnalysis 31 | from .mbcssm import Big5SMModel 32 | 33 | 34 | class Big5Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(Big5SMModel) 38 | self._mDistributionAnalyzer = Big5DistributionAnalysis() 39 | self.reset() 40 | 41 | def get_charset_name(self): 42 | return "Big5" 43 | -------------------------------------------------------------------------------- /Desktop/python/requests/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.exceptions 5 | ~~~~~~~~~~~~~~~~~~~ 6 | 7 | This module contains the set of Requests' exceptions. 8 | 9 | """ 10 | from .packages.urllib3.exceptions import HTTPError as BaseHTTPError 11 | 12 | 13 | class RequestException(IOError): 14 | """There was an ambiguous exception that occurred while handling your 15 | request.""" 16 | 17 | 18 | class HTTPError(RequestException): 19 | """An HTTP error occurred.""" 20 | 21 | def __init__(self, *args, **kwargs): 22 | """ Initializes HTTPError with optional `response` object. """ 23 | self.response = kwargs.pop('response', None) 24 | super(HTTPError, self).__init__(*args, **kwargs) 25 | 26 | 27 | class ConnectionError(RequestException): 28 | """A Connection error occurred.""" 29 | 30 | 31 | class ProxyError(ConnectionError): 32 | """A proxy error occurred.""" 33 | 34 | 35 | class SSLError(ConnectionError): 36 | """An SSL error occurred.""" 37 | 38 | 39 | class Timeout(RequestException): 40 | """The request timed out.""" 41 | 42 | 43 | class URLRequired(RequestException): 44 | """A valid URL is required to make a request.""" 45 | 46 | 47 | class TooManyRedirects(RequestException): 48 | """Too many redirects.""" 49 | 50 | 51 | class MissingSchema(RequestException, ValueError): 52 | """The URL schema (e.g. http or https) is missing.""" 53 | 54 | 55 | class InvalidSchema(RequestException, ValueError): 56 | """See defaults.py for valid schemas.""" 57 | 58 | 59 | class InvalidURL(RequestException, ValueError): 60 | """ The URL provided was somehow invalid. """ 61 | 62 | 63 | class ChunkedEncodingError(RequestException): 64 | """The server declared chunked encoding but sent an invalid chunk.""" 65 | 66 | 67 | class ContentDecodingError(RequestException, BaseHTTPError): 68 | """Failed to decode response content""" 69 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/src/qpython.h: -------------------------------------------------------------------------------- 1 | #ifndef _QPYTHON_H 2 | #define _QPYTHON_H 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | 15 | class QPython : public QObject 16 | { 17 | Q_OBJECT 18 | 19 | public: 20 | QPython(QObject *parent=NULL); 21 | virtual ~QPython(); 22 | 23 | Q_INVOKABLE void 24 | addImportPath(QString path); 25 | 26 | Q_INVOKABLE bool 27 | importModule(QString name); 28 | 29 | Q_INVOKABLE QVariant 30 | evaluate(QString expr); 31 | 32 | Q_INVOKABLE QVariant 33 | call(QString func, QVariant args); 34 | 35 | Q_INVOKABLE void 36 | threadedCall(QString func, QVariant args); 37 | 38 | static void 39 | registerQML(); 40 | 41 | // Convert a Python value to a Qt value 42 | QVariant fromPython(PyObject *o); 43 | 44 | // Convert a Qt value to a Python value 45 | PyObject *toPython(QVariant v); 46 | 47 | // Internal function to evaluate a string to a PyObject * 48 | // Used by evaluate() and call() 49 | PyObject *eval(QString expr); 50 | 51 | private: 52 | PyObject *locals; 53 | PyObject *globals; 54 | QList > futures; 55 | QList *> watchers; 56 | 57 | static int instances; 58 | 59 | signals: 60 | void finished(); 61 | void message(const QVariant data); 62 | void exception(const QString type, const QString data); 63 | 64 | public slots: 65 | void threadedCallFinished(); 66 | void threadedCallResultReady(int index); 67 | 68 | }; 69 | 70 | #endif 71 | 72 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/urllib3/__init__.py: -------------------------------------------------------------------------------- 1 | # urllib3/__init__.py 2 | # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) 3 | # 4 | # This module is part of urllib3 and is released under 5 | # the MIT License: http://www.opensource.org/licenses/mit-license.php 6 | 7 | """ 8 | urllib3 - Thread-safe connection pooling and re-using. 9 | """ 10 | 11 | __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' 12 | __license__ = 'MIT' 13 | __version__ = 'dev' 14 | 15 | 16 | from .connectionpool import ( 17 | HTTPConnectionPool, 18 | HTTPSConnectionPool, 19 | connection_from_url 20 | ) 21 | 22 | from . import exceptions 23 | from .filepost import encode_multipart_formdata 24 | from .poolmanager import PoolManager, ProxyManager, proxy_from_url 25 | from .response import HTTPResponse 26 | from .util import make_headers, get_host, Timeout 27 | 28 | 29 | # Set default logging handler to avoid "No handler found" warnings. 30 | import logging 31 | try: # Python 2.7+ 32 | from logging import NullHandler 33 | except ImportError: 34 | class NullHandler(logging.Handler): 35 | def emit(self, record): 36 | pass 37 | 38 | logging.getLogger(__name__).addHandler(NullHandler()) 39 | 40 | def add_stderr_logger(level=logging.DEBUG): 41 | """ 42 | Helper for quickly adding a StreamHandler to the logger. Useful for 43 | debugging. 44 | 45 | Returns the handler after adding it. 46 | """ 47 | # This method needs to be in this __init__.py to get the __name__ correct 48 | # even if urllib3 is vendored within another package. 49 | logger = logging.getLogger(__name__) 50 | handler = logging.StreamHandler() 51 | handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) 52 | logger.addHandler(handler) 53 | logger.setLevel(level) 54 | logger.debug('Added an stderr logging handler to logger: %s' % __name__) 55 | return handler 56 | 57 | # ... Clean up. 58 | del NullHandler 59 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/cp949prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import CP949SMModel 32 | 33 | 34 | class CP949Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(CP949SMModel) 38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be 39 | # not different. 40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 41 | self.reset() 42 | 43 | def get_charset_name(self): 44 | return "CP949" 45 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/urllib3/__init__.py: -------------------------------------------------------------------------------- 1 | # urllib3/__init__.py 2 | # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) 3 | # 4 | # This module is part of urllib3 and is released under 5 | # the MIT License: http://www.opensource.org/licenses/mit-license.php 6 | 7 | """ 8 | urllib3 - Thread-safe connection pooling and re-using. 9 | """ 10 | 11 | __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' 12 | __license__ = 'MIT' 13 | __version__ = '1.8' 14 | 15 | 16 | from .connectionpool import ( 17 | HTTPConnectionPool, 18 | HTTPSConnectionPool, 19 | connection_from_url 20 | ) 21 | 22 | from . import exceptions 23 | from .filepost import encode_multipart_formdata 24 | from .poolmanager import PoolManager, ProxyManager, proxy_from_url 25 | from .response import HTTPResponse 26 | from .util import make_headers, get_host, Timeout 27 | 28 | 29 | # Set default logging handler to avoid "No handler found" warnings. 30 | import logging 31 | try: # Python 2.7+ 32 | from logging import NullHandler 33 | except ImportError: 34 | class NullHandler(logging.Handler): 35 | def emit(self, record): 36 | pass 37 | 38 | logging.getLogger(__name__).addHandler(NullHandler()) 39 | 40 | def add_stderr_logger(level=logging.DEBUG): 41 | """ 42 | Helper for quickly adding a StreamHandler to the logger. Useful for 43 | debugging. 44 | 45 | Returns the handler after adding it. 46 | """ 47 | # This method needs to be in this __init__.py to get the __name__ correct 48 | # even if urllib3 is vendored within another package. 49 | logger = logging.getLogger(__name__) 50 | handler = logging.StreamHandler() 51 | handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) 52 | logger.addHandler(handler) 53 | logger.setLevel(level) 54 | logger.debug('Added an stderr logging handler to logger: %s' % __name__) 55 | return handler 56 | 57 | # ... Clean up. 58 | del NullHandler 59 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/cp949prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import CP949SMModel 32 | 33 | 34 | class CP949Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(CP949SMModel) 38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be 39 | # not different. 40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 41 | self.reset() 42 | 43 | def get_charset_name(self): 44 | return "CP949" 45 | -------------------------------------------------------------------------------- /python/requests/packages/urllib3/__init__.py: -------------------------------------------------------------------------------- 1 | # urllib3/__init__.py 2 | # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) 3 | # 4 | # This module is part of urllib3 and is released under 5 | # the MIT License: http://www.opensource.org/licenses/mit-license.php 6 | 7 | """ 8 | urllib3 - Thread-safe connection pooling and re-using. 9 | """ 10 | 11 | __author__ = 'Andrey Petrov (andrey.petrov@shazow.net)' 12 | __license__ = 'MIT' 13 | __version__ = 'dev' 14 | 15 | 16 | from .connectionpool import ( 17 | HTTPConnectionPool, 18 | HTTPSConnectionPool, 19 | connection_from_url 20 | ) 21 | 22 | from . import exceptions 23 | from .filepost import encode_multipart_formdata 24 | from .poolmanager import PoolManager, ProxyManager, proxy_from_url 25 | from .response import HTTPResponse 26 | from .util import make_headers, get_host 27 | 28 | 29 | # Set default logging handler to avoid "No handler found" warnings. 30 | import logging 31 | try: # Python 2.7+ 32 | from logging import NullHandler 33 | except ImportError: 34 | class NullHandler(logging.Handler): 35 | def emit(self, record): 36 | pass 37 | 38 | logging.getLogger(__name__).addHandler(NullHandler()) 39 | 40 | def add_stderr_logger(level=logging.DEBUG): 41 | """ 42 | Helper for quickly adding a StreamHandler to the logger. Useful for 43 | debugging. 44 | 45 | Returns the handler after adding it. 46 | """ 47 | # This method needs to be in this __init__.py to get the __name__ correct 48 | # even if urllib3 is vendored within another package. 49 | logger = logging.getLogger(__name__) 50 | handler = logging.StreamHandler() 51 | handler.setFormatter(logging.Formatter('%(asctime)s %(levelname)s %(message)s')) 52 | logger.addHandler(handler) 53 | logger.setLevel(level) 54 | logger.debug('Added an stderr logging handler to logger: %s' % __name__) 55 | return handler 56 | 57 | # ... Clean up. 58 | del NullHandler 59 | -------------------------------------------------------------------------------- /python/requests/packages/charade/cp949prober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .mbcharsetprober import MultiByteCharSetProber 29 | from .codingstatemachine import CodingStateMachine 30 | from .chardistribution import EUCKRDistributionAnalysis 31 | from .mbcssm import CP949SMModel 32 | 33 | 34 | class CP949Prober(MultiByteCharSetProber): 35 | def __init__(self): 36 | MultiByteCharSetProber.__init__(self) 37 | self._mCodingSM = CodingStateMachine(CP949SMModel) 38 | # NOTE: CP949 is a superset of EUC-KR, so the distribution should be 39 | # not different. 40 | self._mDistributionAnalyzer = EUCKRDistributionAnalysis() 41 | self.reset() 42 | 43 | def get_charset_name(self): 44 | return "CP949" 45 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/rpm/ownNotes.spec: -------------------------------------------------------------------------------- 1 | # 2 | # Do NOT Edit the Auto-generated Part! 3 | # Generated by: spectacle version 0.27 4 | # 5 | 6 | Name: ownNotes 7 | 8 | # >> macros 9 | # << macros 10 | 11 | %{!?qtc_qmake:%define qtc_qmake %qmake} 12 | %{!?qtc_qmake5:%define qtc_qmake5 %qmake5} 13 | %{!?qtc_make:%define qtc_make make} 14 | %{?qtc_builddir:%define _builddir %qtc_builddir} 15 | Summary: A notes taking app with ownCloud Sync 16 | Version: 1.8.2 17 | Release: 1 18 | Group: Qt/Qt 19 | License: LICENSE 20 | URL: http://example.org/ 21 | Source0: %{name}-%{version}.tar.bz2 22 | Source100: ownNotes.yaml 23 | Requires: sailfishsilica-qt5 >= 0.10.9 24 | Requires: python3-base 25 | BuildRequires: pkgconfig(Qt5Quick) 26 | BuildRequires: pkgconfig(Qt5Qml) 27 | BuildRequires: pkgconfig(Qt5Core) 28 | BuildRequires: pkgconfig(sailfishapp) >= 0.0.10 29 | BuildRequires: pkgconfig(Qt5Widgets) 30 | BuildRequires: python3-devel 31 | BuildRequires: desktop-file-utils 32 | 33 | %description 34 | A notes taking app with ownCloud Sync and markdown support. 35 | 36 | %prep 37 | %setup -q -n %{name}-%{version} 38 | 39 | # >> setup 40 | # << setup 41 | 42 | %build 43 | # >> build pre 44 | # << build pre 45 | 46 | %qtc_qmake5 47 | 48 | %qtc_make %{?_smp_mflags} 49 | 50 | # >> build post 51 | # << build post 52 | 53 | %install 54 | rm -rf %{buildroot} 55 | # >> install pre 56 | # << install pre 57 | %qmake5_install 58 | 59 | # >> install post 60 | # << install post 61 | 62 | desktop-file-install --delete-original \ 63 | --dir %{buildroot}%{_datadir}/applications \ 64 | %{buildroot}%{_datadir}/applications/*.desktop 65 | 66 | %files 67 | %defattr(-,root,root,-) 68 | /usr/share/ownNotes/i18n 69 | /usr/share/ownNotes/python 70 | %{_datadir}/%{name}/python 71 | %{_bindir} 72 | %{_datadir}/%{name}/qml 73 | %{_datadir}/applications/%{name}.desktop 74 | %{_datadir}/icons/hicolor/86x86/apps/%{name}.png 75 | /usr/bin 76 | /usr/share/ownNotes 77 | /usr/share/applications 78 | /usr/share/icons/hicolor/86x86/apps 79 | /usr/share/ownNotes/datas 80 | # >> files 81 | # << files 82 | -------------------------------------------------------------------------------- /Desktop/python/tinydav/exception.py: -------------------------------------------------------------------------------- 1 | # Exceptions for the tinydav WebDAV client. 2 | # Copyright (C) 2009 Manuel Hermann 3 | # 4 | # This file is part of tinydav. 5 | # 6 | # tinydav is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU Lesser General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public License 17 | # along with this program. If not, see . 18 | """Exceptions for the tinydav WebDAV client.""" 19 | 20 | 21 | class HTTPError(Exception): 22 | """Base exception class for HTTP errors. 23 | 24 | response -- httplib.Response object. 25 | method -- String with uppercase method name. 26 | 27 | This object has the following attributes: 28 | response -- The HTTPResponse object. 29 | 30 | """ 31 | def __init__(self, response): 32 | """Initialize the HTTPError. 33 | 34 | response -- HTTPClient or one of its subclasses. 35 | method -- The uppercase method name where the error occured. 36 | 37 | This instance has the following attributes: 38 | 39 | response -- Given HTTPClient. 40 | 41 | """ 42 | Exception.__init__(self) 43 | self.response = response 44 | 45 | def __repr__(self): 46 | """Return representation of an HTTPError.""" 47 | return "<%s: %d>" % (self.__class__.__name__, self.response) 48 | 49 | def __str__(self): 50 | """Return string representation of an HTTPError.""" 51 | return self.response.statusline 52 | 53 | 54 | class HTTPUserError(HTTPError): 55 | """Exception class for 4xx HTTP errors.""" 56 | 57 | 58 | class HTTPServerError(HTTPError): 59 | """Exception class for 5xx HTTP errors.""" 60 | 61 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/qml/pages/AboutPage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | import Sailfish.Silica 1.0 3 | import Sailfish.Silica.theme 1.0 4 | 5 | 6 | Page { 7 | id: page 8 | 9 | property alias title:title.text 10 | property alias icon: icon.source 11 | property alias slogan: slogan.text 12 | property string contentText 13 | 14 | SilicaFlickable { 15 | id: aboutFlick 16 | anchors.fill: parent 17 | contentHeight: contentItem.childrenRect.height 18 | contentWidth: aboutFlick.width 19 | 20 | Column { 21 | id: aboutColumn 22 | 23 | anchors { 24 | left: parent.left 25 | right: parent.right 26 | margins: 0 27 | } 28 | 29 | spacing: 2 30 | 31 | PageHeader { 32 | title: qsTr('About ownNotes') 33 | } 34 | 35 | Image { 36 | id: icon 37 | source: '' 38 | anchors.horizontalCenter: parent.horizontalCenter 39 | } 40 | 41 | Label { 42 | id:title 43 | text: 'Name 0.0.0' 44 | font.pixelSize: 40 45 | font.bold: true 46 | anchors.horizontalCenter: parent.horizontalCenter 47 | } 48 | 49 | Label { 50 | id: slogan 51 | text: 'Slogan!' 52 | anchors.horizontalCenter: parent.horizontalCenter 53 | } 54 | 55 | Item { 56 | width: 1 57 | height: 50 58 | } 59 | 60 | TextArea { 61 | id: content 62 | text: '' + contentText 63 | width: aboutFlick.width 64 | wrapMode: TextEdit.WordWrap 65 | readOnly: true 66 | Component.onCompleted: { 67 | _editor.textFormat = Text.RichText; 68 | } 69 | } 70 | } 71 | } 72 | } 73 | 74 | 75 | 76 | 77 | 78 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/tinydav/exception.py: -------------------------------------------------------------------------------- 1 | # Exceptions for the tinydav WebDAV client. 2 | # Copyright (C) 2009 Manuel Hermann 3 | # 4 | # This file is part of tinydav. 5 | # 6 | # tinydav is free software: you can redistribute it and/or modify 7 | # it under the terms of the GNU Lesser General Public License as published by 8 | # the Free Software Foundation, either version 3 of the License, or 9 | # (at your option) any later version. 10 | # 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public License 17 | # along with this program. If not, see . 18 | """Exceptions for the tinydav WebDAV client.""" 19 | 20 | 21 | class HTTPError(Exception): 22 | """Base exception class for HTTP errors. 23 | 24 | response -- httplib.Response object. 25 | method -- String with uppercase method name. 26 | 27 | This object has the following attributes: 28 | response -- The HTTPResponse object. 29 | 30 | """ 31 | def __init__(self, response): 32 | """Initialize the HTTPError. 33 | 34 | response -- HTTPClient or one of its subclasses. 35 | method -- The uppercase method name where the error occured. 36 | 37 | This instance has the following attributes: 38 | 39 | response -- Given HTTPClient. 40 | 41 | """ 42 | Exception.__init__(self) 43 | self.response = response 44 | 45 | def __repr__(self): 46 | """Return representation of an HTTPError.""" 47 | return "<%s: %d>" % (self.__class__.__name__, self.response) 48 | 49 | def __str__(self): 50 | """Return string representation of an HTTPError.""" 51 | return self.response.statusline 52 | 53 | 54 | class HTTPUserError(HTTPError): 55 | """Exception class for 4xx HTTP errors.""" 56 | 57 | 58 | class HTTPServerError(HTTPError): 59 | """Exception class for 5xx HTTP errors.""" 60 | 61 | -------------------------------------------------------------------------------- /python/markdown/extensions/extra.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Python-Markdown Extra Extension 4 | =============================== 5 | 6 | A compilation of various Python-Markdown extensions that imitates 7 | [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). 8 | 9 | Note that each of the individual extensions still need to be available 10 | on your PYTHONPATH. This extension simply wraps them all up as a 11 | convenience so that only one extension needs to be listed when 12 | initiating Markdown. See the documentation for each individual 13 | extension for specifics about that extension. 14 | 15 | In the event that one or more of the supported extensions are not 16 | available for import, Markdown will issue a warning and simply continue 17 | without that extension. 18 | 19 | There may be additional extensions that are distributed with 20 | Python-Markdown that are not included here in Extra. Those extensions 21 | are not part of PHP Markdown Extra, and therefore, not part of 22 | Python-Markdown Extra. If you really would like Extra to include 23 | additional extensions, we suggest creating your own clone of Extra 24 | under a differant name. You could also edit the `extensions` global 25 | variable defined below, but be aware that such changes may be lost 26 | when you upgrade to any future version of Python-Markdown. 27 | 28 | """ 29 | 30 | import markdown 31 | 32 | extensions = ['smart_strong', 33 | 'fenced_code', 34 | 'footnotes', 35 | 'attr_list', 36 | 'def_list', 37 | 'tables', 38 | 'abbr', 39 | ] 40 | 41 | 42 | class ExtraExtension(markdown.Extension): 43 | """ Add various extensions to Markdown class.""" 44 | 45 | def extendMarkdown(self, md, md_globals): 46 | """ Register extension instances. """ 47 | md.registerExtensions(extensions, self.config) 48 | # Turn on processing of markdown text within raw html 49 | md.preprocessors['html_block'].markdown_in_raw = True 50 | 51 | def makeExtension(configs={}): 52 | return ExtraExtension(configs=dict(configs)) 53 | -------------------------------------------------------------------------------- /Desktop/python/markdown/extensions/extra.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Python-Markdown Extra Extension 4 | =============================== 5 | 6 | A compilation of various Python-Markdown extensions that imitates 7 | [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). 8 | 9 | Note that each of the individual extensions still need to be available 10 | on your PYTHONPATH. This extension simply wraps them all up as a 11 | convenience so that only one extension needs to be listed when 12 | initiating Markdown. See the documentation for each individual 13 | extension for specifics about that extension. 14 | 15 | In the event that one or more of the supported extensions are not 16 | available for import, Markdown will issue a warning and simply continue 17 | without that extension. 18 | 19 | There may be additional extensions that are distributed with 20 | Python-Markdown that are not included here in Extra. Those extensions 21 | are not part of PHP Markdown Extra, and therefore, not part of 22 | Python-Markdown Extra. If you really would like Extra to include 23 | additional extensions, we suggest creating your own clone of Extra 24 | under a differant name. You could also edit the `extensions` global 25 | variable defined below, but be aware that such changes may be lost 26 | when you upgrade to any future version of Python-Markdown. 27 | 28 | """ 29 | 30 | import markdown 31 | 32 | extensions = ['smart_strong', 33 | 'fenced_code', 34 | 'footnotes', 35 | 'attr_list', 36 | 'def_list', 37 | 'tables', 38 | 'abbr', 39 | ] 40 | 41 | 42 | class ExtraExtension(markdown.Extension): 43 | """ Add various extensions to Markdown class.""" 44 | 45 | def extendMarkdown(self, md, md_globals): 46 | """ Register extension instances. """ 47 | md.registerExtensions(extensions, self.config) 48 | # Turn on processing of markdown text within raw html 49 | md.preprocessors['html_block'].markdown_in_raw = True 50 | 51 | def makeExtension(configs={}): 52 | return ExtraExtension(configs=dict(configs)) 53 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/charsetprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | from . import constants 30 | import re 31 | 32 | 33 | class CharSetProber: 34 | def __init__(self): 35 | pass 36 | 37 | def reset(self): 38 | self._mState = constants.eDetecting 39 | 40 | def get_charset_name(self): 41 | return None 42 | 43 | def feed(self, aBuf): 44 | pass 45 | 46 | def get_state(self): 47 | return self._mState 48 | 49 | def get_confidence(self): 50 | return 0.0 51 | 52 | def filter_high_bit_only(self, aBuf): 53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf) 54 | return aBuf 55 | 56 | def filter_without_english_letters(self, aBuf): 57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf) 58 | return aBuf 59 | 60 | def filter_with_english_letters(self, aBuf): 61 | # TODO 62 | return aBuf 63 | -------------------------------------------------------------------------------- /Desktop/python/requests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # __ 4 | # /__) _ _ _ _ _/ _ 5 | # / ( (- (/ (/ (- _) / _) 6 | # / 7 | 8 | """ 9 | requests HTTP library 10 | ~~~~~~~~~~~~~~~~~~~~~ 11 | 12 | Requests is an HTTP library, written in Python, for human beings. Basic GET 13 | usage: 14 | 15 | >>> import requests 16 | >>> r = requests.get('http://python.org') 17 | >>> r.status_code 18 | 200 19 | >>> 'Python is a programming language' in r.content 20 | True 21 | 22 | ... or POST: 23 | 24 | >>> payload = dict(key1='value1', key2='value2') 25 | >>> r = requests.post("http://httpbin.org/post", data=payload) 26 | >>> print(r.text) 27 | { 28 | ... 29 | "form": { 30 | "key2": "value2", 31 | "key1": "value1" 32 | }, 33 | ... 34 | } 35 | 36 | The other HTTP methods are supported - see `requests.api`. Full documentation 37 | is at . 38 | 39 | :copyright: (c) 2014 by Kenneth Reitz. 40 | :license: Apache 2.0, see LICENSE for more details. 41 | 42 | """ 43 | 44 | __title__ = 'requests' 45 | __version__ = '2.2.1' 46 | __build__ = 0x020201 47 | __author__ = 'Kenneth Reitz' 48 | __license__ = 'Apache 2.0' 49 | __copyright__ = 'Copyright 2014 Kenneth Reitz' 50 | 51 | # Attempt to enable urllib3's SNI support, if possible 52 | try: 53 | from .packages.urllib3.contrib import pyopenssl 54 | pyopenssl.inject_into_urllib3() 55 | except ImportError: 56 | pass 57 | 58 | from . import utils 59 | from .models import Request, Response, PreparedRequest 60 | from .api import request, get, head, post, patch, put, delete, options 61 | from .sessions import session, Session 62 | from .status_codes import codes 63 | from .exceptions import ( 64 | RequestException, Timeout, URLRequired, 65 | TooManyRedirects, HTTPError, ConnectionError 66 | ) 67 | 68 | # Set default logging handler to avoid "No handler found" warnings. 69 | import logging 70 | try: # Python 2.7+ 71 | from logging import NullHandler 72 | except ImportError: 73 | class NullHandler(logging.Handler): 74 | def emit(self, record): 75 | pass 76 | 77 | logging.getLogger(__name__).addHandler(NullHandler()) 78 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/charsetprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | from . import constants 30 | import re 31 | 32 | 33 | class CharSetProber: 34 | def __init__(self): 35 | pass 36 | 37 | def reset(self): 38 | self._mState = constants.eDetecting 39 | 40 | def get_charset_name(self): 41 | return None 42 | 43 | def feed(self, aBuf): 44 | pass 45 | 46 | def get_state(self): 47 | return self._mState 48 | 49 | def get_confidence(self): 50 | return 0.0 51 | 52 | def filter_high_bit_only(self, aBuf): 53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf) 54 | return aBuf 55 | 56 | def filter_without_english_letters(self, aBuf): 57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf) 58 | return aBuf 59 | 60 | def filter_with_english_letters(self, aBuf): 61 | # TODO 62 | return aBuf 63 | -------------------------------------------------------------------------------- /Harmattan/ownNotes.pro: -------------------------------------------------------------------------------- 1 | # Add more folders to ship with the application, here 2 | folder_01.source = qml/Harmattan 3 | folder_01.target = qml 4 | folder_02.source = python 5 | folder_02.target = . 6 | folder_03.source = icons 7 | folder_03.target = . 8 | 9 | DEPLOYMENTFOLDERS = folder_01 10 | DEPLOYMENTFOLDERS += folder_02 11 | DEPLOYMENTFOLDERS += folder_03 12 | 13 | 14 | # Additional import path used to resolve QML modules in Creator's code model 15 | QML_IMPORT_PATH = 16 | 17 | symbian:TARGET.UID3 = 0xE76B9599 18 | 19 | # Smart Installer package's UID 20 | # This UID is from the protected range and therefore the package will 21 | # fail to install if self-signed. By default qmake uses the unprotected 22 | # range value if unprotected UID is defined for the application and 23 | # 0x2002CCCF value if protected UID is given to the application 24 | #symbian:DEPLOYMENT.installer_header = 0x2002CCCF 25 | 26 | # Allow network access on Symbian 27 | symbian:TARGET.CAPABILITY += NetworkServices 28 | 29 | # If your application uses the Qt Mobility libraries, uncomment the following 30 | # lines and add the respective components to the MOBILITY variable. 31 | # CONFIG += mobility 32 | # MOBILITY += 33 | 34 | # Speed up launching on MeeGo/Harmattan when using applauncherd daemon 35 | CONFIG += qdeclarative-boostable 36 | 37 | # Add dependency to Symbian components 38 | # CONFIG += qt-components 39 | 40 | # The .cpp file which was generated for your project. Feel free to hack it. 41 | SOURCES += main.cpp \ 42 | qpython.cpp 43 | 44 | QMAKE_CXXFLAGS += -I/usr/include/python2.6 45 | QMAKE_LIBS += -lpython2.6 46 | 47 | # Please do not modify the following two lines. Required for deployment. 48 | include(qmlapplicationviewer/qmlapplicationviewer.pri) 49 | qtcAddDeployment() 50 | 51 | OTHER_FILES += \ 52 | qtc_packaging/debian_harmattan/rules \ 53 | qtc_packaging/debian_harmattan/README \ 54 | qtc_packaging/debian_harmattan/manifest.aegis \ 55 | qtc_packaging/debian_harmattan/copyright \ 56 | qtc_packaging/debian_harmattan/control \ 57 | qtc_packaging/debian_harmattan/compat \ 58 | qtc_packaging/debian_harmattan/changelog \ 59 | README \ 60 | LICENCE 61 | 62 | HEADERS += \ 63 | qpython.h 64 | 65 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # __ 4 | # /__) _ _ _ _ _/ _ 5 | # / ( (- (/ (/ (- _) / _) 6 | # / 7 | 8 | """ 9 | requests HTTP library 10 | ~~~~~~~~~~~~~~~~~~~~~ 11 | 12 | Requests is an HTTP library, written in Python, for human beings. Basic GET 13 | usage: 14 | 15 | >>> import requests 16 | >>> r = requests.get('http://python.org') 17 | >>> r.status_code 18 | 200 19 | >>> 'Python is a programming language' in r.content 20 | True 21 | 22 | ... or POST: 23 | 24 | >>> payload = dict(key1='value1', key2='value2') 25 | >>> r = requests.post("http://httpbin.org/post", data=payload) 26 | >>> print(r.text) 27 | { 28 | ... 29 | "form": { 30 | "key2": "value2", 31 | "key1": "value1" 32 | }, 33 | ... 34 | } 35 | 36 | The other HTTP methods are supported - see `requests.api`. Full documentation 37 | is at . 38 | 39 | :copyright: (c) 2014 by Kenneth Reitz. 40 | :license: Apache 2.0, see LICENSE for more details. 41 | 42 | """ 43 | 44 | __title__ = 'requests' 45 | __version__ = '2.3.0' 46 | __build__ = 0x020300 47 | __author__ = 'Kenneth Reitz' 48 | __license__ = 'Apache 2.0' 49 | __copyright__ = 'Copyright 2014 Kenneth Reitz' 50 | 51 | # Attempt to enable urllib3's SNI support, if possible 52 | try: 53 | from .packages.urllib3.contrib import pyopenssl 54 | pyopenssl.inject_into_urllib3() 55 | except ImportError: 56 | pass 57 | 58 | from . import utils 59 | from .models import Request, Response, PreparedRequest 60 | from .api import request, get, head, post, patch, put, delete, options 61 | from .sessions import session, Session 62 | from .status_codes import codes 63 | from .exceptions import ( 64 | RequestException, Timeout, URLRequired, 65 | TooManyRedirects, HTTPError, ConnectionError 66 | ) 67 | 68 | # Set default logging handler to avoid "No handler found" warnings. 69 | import logging 70 | try: # Python 2.7+ 71 | from logging import NullHandler 72 | except ImportError: 73 | class NullHandler(logging.Handler): 74 | def emit(self, record): 75 | pass 76 | 77 | logging.getLogger(__name__).addHandler(NullHandler()) 78 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/mbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | from .charsetgroupprober import CharSetGroupProber 31 | from .utf8prober import UTF8Prober 32 | from .sjisprober import SJISProber 33 | from .eucjpprober import EUCJPProber 34 | from .gb2312prober import GB2312Prober 35 | from .euckrprober import EUCKRProber 36 | from .cp949prober import CP949Prober 37 | from .big5prober import Big5Prober 38 | from .euctwprober import EUCTWProber 39 | 40 | 41 | class MBCSGroupProber(CharSetGroupProber): 42 | def __init__(self): 43 | CharSetGroupProber.__init__(self) 44 | self._mProbers = [ 45 | UTF8Prober(), 46 | SJISProber(), 47 | EUCJPProber(), 48 | GB2312Prober(), 49 | EUCKRProber(), 50 | CP949Prober(), 51 | Big5Prober(), 52 | EUCTWProber() 53 | ] 54 | self.reset() 55 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/ownNotes.pro: -------------------------------------------------------------------------------- 1 | # The name of your app. 2 | # NOTICE: name defined in TARGET has a corresponding QML filename. 3 | # If name defined in TARGET is changed, following needs to be 4 | # done to match new name: 5 | # - corresponding QML filename must be changed 6 | # - desktop icon filename must be changed 7 | # - desktop filename must be changed 8 | # - icon definition filename in desktop file must be changed 9 | TARGET = ownNotes 10 | 11 | INCLUDEPATH += $$system(python3-config --includes) 12 | QMAKE_CXXFLAGS += $$system(python3-config --includes) 13 | QMAKE_LIBS += $$system(python3-config --libs) 14 | 15 | CONFIG += sailfishapp 16 | 17 | include(version.pri) 18 | include(datas/datas.pri) 19 | DEFINES *= 'VERSION=\'\"$${VERSION}\"\'' 20 | 21 | #qtHaveModule(widgets) { 22 | QT += widgets 23 | #} 24 | 25 | SOURCES += src/ownNotes.cpp \ 26 | src/qpython.cpp \ 27 | src/documenthandler.cpp \ 28 | src/highlighter.cpp 29 | 30 | OTHER_FILES += qml/ownNotes.qml \ 31 | qml/cover/CoverPage.qml \ 32 | rpm/ownNotes.spec \ 33 | rpm/ownNotes.yaml \ 34 | ownNotes.desktop \ 35 | qml/pages/SettingsPage.qml \ 36 | qml/pages/MainPage.qml \ 37 | qml/pages/InfoBanner.qml \ 38 | qml/pages/FontComboBox.qml \ 39 | qml/pages/EditPage.qml \ 40 | qml/pages/AboutPage.qml \ 41 | icons/* \ 42 | i18n/* 43 | 44 | HEADERS += \ 45 | src/qpython.h \ 46 | src/documenthandler.h \ 47 | src/highlighter.h 48 | 49 | python_files.files = python 50 | python_files.path = /usr/share/$$TARGET 51 | qm_files.files = i18n 52 | qm_files.path = /usr/share/$$TARGET 53 | icons_files.files = icons 54 | icons_files.path = /usr/share/$$TARGET 55 | 56 | INSTALLS += python_files qm_files icons_files 57 | 58 | lupdate_only { 59 | SOURCES = qml/ownNotes.qml \ 60 | qml/pages/*.qml \ 61 | qml/cover/*.qml 62 | } 63 | 64 | RESOURCES += 65 | 66 | TRANSLATIONS = i18n/ownNotes_en.ts \ 67 | i18n/ownNotes_ru.ts \ 68 | i18n/ownNotes_it.ts \ 69 | i18n/ownNotes_fr.ts \ 70 | i18n/ownNotes_fi.ts \ 71 | i18n/ownNotes_cn.ts \ 72 | i18n/ownNotes_no.ts \ 73 | i18n/ownNotes_nl.ts 74 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.exceptions 5 | ~~~~~~~~~~~~~~~~~~~ 6 | 7 | This module contains the set of Requests' exceptions. 8 | 9 | """ 10 | from .packages.urllib3.exceptions import HTTPError as BaseHTTPError 11 | 12 | 13 | class RequestException(IOError): 14 | """There was an ambiguous exception that occurred while handling your 15 | request.""" 16 | 17 | def __init__(self, *args, **kwargs): 18 | """ 19 | Initialize RequestException with `request` and `response` objects. 20 | """ 21 | response = kwargs.pop('response', None) 22 | self.response = response 23 | self.request = kwargs.pop('request', None) 24 | if (response is not None and not self.request and 25 | hasattr(response, 'request')): 26 | self.request = self.response.request 27 | super(RequestException, self).__init__(*args, **kwargs) 28 | 29 | 30 | class HTTPError(RequestException): 31 | """An HTTP error occurred.""" 32 | 33 | 34 | class ConnectionError(RequestException): 35 | """A Connection error occurred.""" 36 | 37 | 38 | class ProxyError(ConnectionError): 39 | """A proxy error occurred.""" 40 | 41 | 42 | class SSLError(ConnectionError): 43 | """An SSL error occurred.""" 44 | 45 | 46 | class Timeout(RequestException): 47 | """The request timed out.""" 48 | 49 | 50 | class URLRequired(RequestException): 51 | """A valid URL is required to make a request.""" 52 | 53 | 54 | class TooManyRedirects(RequestException): 55 | """Too many redirects.""" 56 | 57 | 58 | class MissingSchema(RequestException, ValueError): 59 | """The URL schema (e.g. http or https) is missing.""" 60 | 61 | 62 | class InvalidSchema(RequestException, ValueError): 63 | """See defaults.py for valid schemas.""" 64 | 65 | 66 | class InvalidURL(RequestException, ValueError): 67 | """ The URL provided was somehow invalid. """ 68 | 69 | 70 | class ChunkedEncodingError(RequestException): 71 | """The server declared chunked encoding but sent an invalid chunk.""" 72 | 73 | 74 | class ContentDecodingError(RequestException, BaseHTTPError): 75 | """Failed to decode response content""" 76 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/mbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | from .charsetgroupprober import CharSetGroupProber 31 | from .utf8prober import UTF8Prober 32 | from .sjisprober import SJISProber 33 | from .eucjpprober import EUCJPProber 34 | from .gb2312prober import GB2312Prober 35 | from .euckrprober import EUCKRProber 36 | from .cp949prober import CP949Prober 37 | from .big5prober import Big5Prober 38 | from .euctwprober import EUCTWProber 39 | 40 | 41 | class MBCSGroupProber(CharSetGroupProber): 42 | def __init__(self): 43 | CharSetGroupProber.__init__(self) 44 | self._mProbers = [ 45 | UTF8Prober(), 46 | SJISProber(), 47 | EUCJPProber(), 48 | GB2312Prober(), 49 | EUCKRProber(), 50 | CP949Prober(), 51 | Big5Prober(), 52 | EUCTWProber() 53 | ] 54 | self.reset() 55 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/pyaes/__init__.py: -------------------------------------------------------------------------------- 1 | # The MIT License (MIT) 2 | # 3 | # Copyright (c) 2014 Richard Moore 4 | # 5 | # Permission is hereby granted, free of charge, to any person obtaining a copy 6 | # of this software and associated documentation files (the "Software"), to deal 7 | # in the Software without restriction, including without limitation the rights 8 | # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | # copies of the Software, and to permit persons to whom the Software is 10 | # furnished to do so, subject to the following conditions: 11 | # 12 | # The above copyright notice and this permission notice shall be included in 13 | # all copies or substantial portions of the Software. 14 | # 15 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | # THE SOFTWARE. 22 | 23 | # This is a pure-Python implementation of the AES algorithm and AES common 24 | # modes of operation. 25 | 26 | # See: https://en.wikipedia.org/wiki/Advanced_Encryption_Standard 27 | # See: https://en.wikipedia.org/wiki/Block_cipher_mode_of_operation 28 | 29 | 30 | # Supported key sizes: 31 | # 128-bit 32 | # 192-bit 33 | # 256-bit 34 | 35 | 36 | # Supported modes of operation: 37 | # ECB - Electronic Codebook 38 | # CBC - Cipher-Block Chaining 39 | # CFB - Cipher Feedback 40 | # OFB - Output Feedback 41 | # CTR - Counter 42 | 43 | # See the README.md for API details and general information. 44 | 45 | # Also useful, PyCrypto, a crypto library implemented in C with Python bindings: 46 | # https://www.dlitz.net/software/pycrypto/ 47 | 48 | 49 | VERSION = [1, 1, 0] 50 | 51 | from pyaes.aes import AES, AESModeOfOperationCTR, AESModeOfOperationCBC, AESModeOfOperationCFB, AESModeOfOperationECB, AESModeOfOperationOFB, AESModesOfOperation, Counter 52 | from pyaes.blockfeeder import Decrypter, Encrypter 53 | -------------------------------------------------------------------------------- /python/merge3/textfile.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2006 Canonical Ltd 2 | # 3 | # This program is free software; you can redistribute it and/or modify 4 | # it under the terms of the GNU General Public License as published by 5 | # the Free Software Foundation; either version 2 of the License, or 6 | # (at your option) any later version. 7 | # 8 | # This program is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | # GNU General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU General Public License 14 | # along with this program; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | """Utilities for distinguishing binary files from text files""" 18 | 19 | #from __future__ import absolute_import 20 | 21 | from itertools import chain 22 | 23 | from errors import BinaryFile 24 | from iterablefile import IterableFile 25 | 26 | def file_iterator(input_file, readsize=32768): 27 | while True: 28 | b = input_file.read(readsize) 29 | if len(b) == 0: 30 | break 31 | yield b 32 | 33 | def text_file(input): 34 | """Produce a file iterator that is guaranteed to be text, without seeking. 35 | BinaryFile is raised if the file contains a NUL in the first 1024 bytes. 36 | """ 37 | first_chunk = input.read(1024) 38 | if '\x00' in first_chunk: 39 | raise BinaryFile() 40 | return IterableFile(chain((first_chunk,), file_iterator(input))) 41 | 42 | 43 | def check_text_lines(lines): 44 | """Raise BinaryFile if the supplied lines contain NULs. 45 | Only the first 1024 characters are checked. 46 | """ 47 | f = IterableFile(lines) 48 | if '\x00' in f.read(1024): 49 | raise BinaryFile() 50 | 51 | 52 | def check_text_path(path): 53 | """Check whether the supplied path is a text, not binary file. 54 | Raise BinaryFile if a NUL occurs in the first 1024 bytes. 55 | """ 56 | f = open(path, 'rb') 57 | try: 58 | text_file(f) 59 | finally: 60 | f.close() 61 | -------------------------------------------------------------------------------- /python/requests/packages/charade/charsetprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | from . import constants 30 | import re 31 | 32 | 33 | class CharSetProber: 34 | def __init__(self): 35 | pass 36 | 37 | def reset(self): 38 | self._mState = constants.eDetecting 39 | 40 | def get_charset_name(self): 41 | return None 42 | 43 | def feed(self, aBuf): 44 | pass 45 | 46 | def get_state(self): 47 | return self._mState 48 | 49 | def get_confidence(self): 50 | return 0.0 51 | 52 | def filter_high_bit_only(self, aBuf): 53 | aBuf = re.sub(b'([\x00-\x7F])+', b' ', aBuf) 54 | return aBuf 55 | 56 | def filter_without_english_letters(self, aBuf): 57 | aBuf = re.sub(b'([A-Za-z])+', b' ', aBuf) 58 | return aBuf 59 | 60 | def filter_with_english_letters(self, aBuf): 61 | # TODO 62 | return aBuf 63 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/markdown/extensions/extra.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python-Markdown Extra Extension 3 | =============================== 4 | 5 | A compilation of various Python-Markdown extensions that imitates 6 | [PHP Markdown Extra](http://michelf.com/projects/php-markdown/extra/). 7 | 8 | Note that each of the individual extensions still need to be available 9 | on your PYTHONPATH. This extension simply wraps them all up as a 10 | convenience so that only one extension needs to be listed when 11 | initiating Markdown. See the documentation for each individual 12 | extension for specifics about that extension. 13 | 14 | In the event that one or more of the supported extensions are not 15 | available for import, Markdown will issue a warning and simply continue 16 | without that extension. 17 | 18 | There may be additional extensions that are distributed with 19 | Python-Markdown that are not included here in Extra. Those extensions 20 | are not part of PHP Markdown Extra, and therefore, not part of 21 | Python-Markdown Extra. If you really would like Extra to include 22 | additional extensions, we suggest creating your own clone of Extra 23 | under a differant name. You could also edit the `extensions` global 24 | variable defined below, but be aware that such changes may be lost 25 | when you upgrade to any future version of Python-Markdown. 26 | 27 | """ 28 | 29 | from __future__ import absolute_import 30 | from __future__ import unicode_literals 31 | from . import Extension 32 | 33 | extensions = ['smart_strong', 34 | 'fenced_code', 35 | 'footnotes', 36 | 'attr_list', 37 | 'def_list', 38 | 'tables', 39 | 'abbr', 40 | ] 41 | 42 | 43 | class ExtraExtension(Extension): 44 | """ Add various extensions to Markdown class.""" 45 | 46 | def extendMarkdown(self, md, md_globals): 47 | """ Register extension instances. """ 48 | md.registerExtensions(extensions, self.config) 49 | if not md.safeMode: 50 | # Turn on processing of markdown text within raw html 51 | md.preprocessors['html_block'].markdown_in_raw = True 52 | 53 | def makeExtension(configs={}): 54 | return ExtraExtension(configs=dict(configs)) 55 | -------------------------------------------------------------------------------- /python/requests/packages/charade/mbcsgroupprober.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # Proofpoint, Inc. 13 | # 14 | # This library is free software; you can redistribute it and/or 15 | # modify it under the terms of the GNU Lesser General Public 16 | # License as published by the Free Software Foundation; either 17 | # version 2.1 of the License, or (at your option) any later version. 18 | # 19 | # This library is distributed in the hope that it will be useful, 20 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 | # Lesser General Public License for more details. 23 | # 24 | # You should have received a copy of the GNU Lesser General Public 25 | # License along with this library; if not, write to the Free Software 26 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 27 | # 02110-1301 USA 28 | ######################### END LICENSE BLOCK ######################### 29 | 30 | from .charsetgroupprober import CharSetGroupProber 31 | from .utf8prober import UTF8Prober 32 | from .sjisprober import SJISProber 33 | from .eucjpprober import EUCJPProber 34 | from .gb2312prober import GB2312Prober 35 | from .euckrprober import EUCKRProber 36 | from .cp949prober import CP949Prober 37 | from .big5prober import Big5Prober 38 | from .euctwprober import EUCTWProber 39 | 40 | 41 | class MBCSGroupProber(CharSetGroupProber): 42 | def __init__(self): 43 | CharSetGroupProber.__init__(self) 44 | self._mProbers = [ 45 | UTF8Prober(), 46 | SJISProber(), 47 | EUCJPProber(), 48 | GB2312Prober(), 49 | EUCKRProber(), 50 | CP949Prober(), 51 | Big5Prober(), 52 | EUCTWProber() 53 | ] 54 | self.reset() 55 | -------------------------------------------------------------------------------- /python/requests/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | # __ 4 | # /__) _ _ _ _ _/ _ 5 | # / ( (- (/ (/ (- _) / _) 6 | # / 7 | 8 | """ 9 | requests HTTP library 10 | ~~~~~~~~~~~~~~~~~~~~~ 11 | 12 | Requests is an HTTP library, written in Python, for human beings. Basic GET 13 | usage: 14 | 15 | >>> import requests 16 | >>> r = requests.get('http://python.org') 17 | >>> r.status_code 18 | 200 19 | >>> 'Python is a programming language' in r.content 20 | True 21 | 22 | ... or POST: 23 | 24 | >>> payload = dict(key1='value1', key2='value2') 25 | >>> r = requests.post("http://httpbin.org/post", data=payload) 26 | >>> print r.text 27 | { 28 | ... 29 | "form": { 30 | "key2": "value2", 31 | "key1": "value1" 32 | }, 33 | ... 34 | } 35 | 36 | The other HTTP methods are supported - see `requests.api`. Full documentation 37 | is at . 38 | 39 | :copyright: (c) 2013 by Kenneth Reitz. 40 | :license: Apache 2.0, see LICENSE for more details. 41 | 42 | """ 43 | 44 | __title__ = 'requests' 45 | __version__ = '1.2.3' 46 | __build__ = 0x010203 47 | __author__ = 'Kenneth Reitz' 48 | __license__ = 'Apache 2.0' 49 | __copyright__ = 'Copyright 2013 Kenneth Reitz' 50 | 51 | # Attempt to enable urllib3's SNI support, if possible 52 | try: 53 | from requests.packages.urllib3.contrib import pyopenssl 54 | pyopenssl.inject_into_urllib3() 55 | except ImportError: 56 | pass 57 | 58 | from . import utils 59 | from .models import Request, Response, PreparedRequest 60 | from .api import request, get, head, post, patch, put, delete, options 61 | from .sessions import session, Session 62 | from .status_codes import codes 63 | from .exceptions import ( 64 | RequestException, Timeout, URLRequired, 65 | TooManyRedirects, HTTPError, ConnectionError 66 | ) 67 | 68 | # Set default logging handler to avoid "No handler found" warnings. 69 | import logging 70 | try: # Python 2.7+ 71 | from logging import NullHandler 72 | except ImportError: 73 | class NullHandler(logging.Handler): 74 | def emit(self, record): 75 | pass 76 | 77 | logging.getLogger(__name__).addHandler(NullHandler()) 78 | -------------------------------------------------------------------------------- /Harmattan/qml/Harmattan/components/AboutPage.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 1.1 2 | import com.nokia.meego 1.0 3 | 4 | Page { 5 | id: aboutPage 6 | property alias iconSource: icon.source 7 | property alias title: title.text 8 | property alias slogan: slogan.text 9 | property alias text: content.text 10 | 11 | 12 | tools: ToolBarLayout { 13 | ToolIcon { 14 | iconId: 'toolbar-back' 15 | onClicked: pageStack.pop() 16 | } 17 | } 18 | 19 | Flickable { 20 | anchors.fill: parent 21 | contentHeight: aboutContainer.height + 10 22 | contentWidth: aboutContainer.width - 10 23 | 24 | Item { 25 | id: aboutContainer 26 | width: aboutPage.width - 20 27 | height: aboutColumn.height 28 | 29 | Column { 30 | id: aboutColumn 31 | 32 | anchors { 33 | left: parent.left 34 | top: parent.top 35 | right: parent.right 36 | margins: 10 37 | } 38 | 39 | spacing: 10 40 | 41 | Image { 42 | id: icon 43 | source: '' 44 | anchors.horizontalCenter: parent.horizontalCenter 45 | } 46 | 47 | Label { 48 | id:title 49 | text: 'Name 0.0.0' 50 | font.pixelSize: 40 51 | font.bold: true 52 | anchors.horizontalCenter: parent.horizontalCenter 53 | } 54 | 55 | Label { 56 | id: slogan 57 | text: 'Slogan !' 58 | anchors.horizontalCenter: parent.horizontalCenter 59 | } 60 | 61 | Item { 62 | width: 1 63 | height: 50 64 | } 65 | 66 | Label { 67 | id: content 68 | text: '' 69 | // textFormat: Text.RichText 70 | width: aboutContainer.width 71 | wrapMode: TextEdit.WordWrap 72 | } 73 | } 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /Harmattan/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | 14 | 15 | 16 | configure: configure-stamp 17 | configure-stamp: 18 | dh_testdir 19 | # qmake PREFIX=/usr# Uncomment this line for use without Qt Creator 20 | 21 | touch configure-stamp 22 | 23 | 24 | build: build-stamp 25 | 26 | build-stamp: configure-stamp 27 | dh_testdir 28 | 29 | # Add here commands to compile the package. 30 | # $(MAKE) # Uncomment this line for use without Qt Creator 31 | #docbook-to-man debian/ownnotes.sgml > ownnotes.1 32 | 33 | touch $@ 34 | 35 | clean: 36 | dh_testdir 37 | dh_testroot 38 | rm -f build-stamp configure-stamp 39 | 40 | # Add here commands to clean up after the build process. 41 | $(MAKE) clean 42 | 43 | dh_clean 44 | 45 | install: build 46 | dh_testdir 47 | dh_testroot 48 | dh_clean -k 49 | dh_installdirs 50 | 51 | # Add here commands to install the package into debian/ownnotes. 52 | $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/ownnotes install 53 | 54 | 55 | # Build architecture-independent files here. 56 | binary-indep: build install 57 | # We have nothing to do by default. 58 | 59 | # Build architecture-dependent files here. 60 | binary-arch: build install 61 | dh_testdir 62 | dh_testroot 63 | dh_installchangelogs 64 | dh_installdocs 65 | dh_installexamples 66 | # dh_install 67 | # dh_installmenu 68 | # dh_installdebconf 69 | # dh_installlogrotate 70 | # dh_installemacsen 71 | # dh_installpam 72 | # dh_installmime 73 | # dh_python 74 | # dh_installinit 75 | # dh_installcron 76 | # dh_installinfo 77 | dh_installman 78 | dh_link 79 | dh_strip 80 | dh_compress 81 | dh_fixperms 82 | # dh_perl 83 | # dh_makeshlibs 84 | dh_installdeb 85 | dh_shlibdeps # Uncomment this line for use without Qt Creator 86 | dh_gencontrol 87 | dh_md5sums 88 | dh_builddeb 89 | 90 | binary: binary-indep binary-arch 91 | .PHONY: build clean binary-indep binary-arch binary install configure 92 | -------------------------------------------------------------------------------- /Harmattan/qtc_packaging/debian_harmattan/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | 14 | 15 | 16 | configure: configure-stamp 17 | configure-stamp: 18 | dh_testdir 19 | # qmake PREFIX=/usr# Uncomment this line for use without Qt Creator 20 | 21 | touch configure-stamp 22 | 23 | 24 | build: build-stamp 25 | 26 | build-stamp: configure-stamp 27 | dh_testdir 28 | 29 | # Add here commands to compile the package. 30 | # $(MAKE) # Uncomment this line for use without Qt Creator 31 | #docbook-to-man debian/ownnotes.sgml > ownnotes.1 32 | 33 | touch $@ 34 | 35 | clean: 36 | dh_testdir 37 | dh_testroot 38 | rm -f build-stamp configure-stamp 39 | 40 | # Add here commands to clean up after the build process. 41 | $(MAKE) clean 42 | 43 | dh_clean 44 | 45 | install: build 46 | dh_testdir 47 | dh_testroot 48 | dh_clean -k 49 | dh_installdirs 50 | 51 | # Add here commands to install the package into debian/ownnotes. 52 | $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/ownnotes install 53 | 54 | 55 | # Build architecture-independent files here. 56 | binary-indep: build install 57 | # We have nothing to do by default. 58 | 59 | # Build architecture-dependent files here. 60 | binary-arch: build install 61 | dh_testdir 62 | dh_testroot 63 | dh_installchangelogs 64 | dh_installdocs 65 | dh_installexamples 66 | # dh_install 67 | # dh_installmenu 68 | # dh_installdebconf 69 | # dh_installlogrotate 70 | # dh_installemacsen 71 | # dh_installpam 72 | # dh_installmime 73 | # dh_python 74 | # dh_installinit 75 | # dh_installcron 76 | # dh_installinfo 77 | dh_installman 78 | dh_link 79 | dh_strip 80 | dh_compress 81 | dh_fixperms 82 | # dh_perl 83 | # dh_makeshlibs 84 | dh_installdeb 85 | # dh_shlibdeps # Uncomment this line for use without Qt Creator 86 | dh_gencontrol 87 | dh_md5sums 88 | dh_builddeb 89 | 90 | binary: binary-indep binary-arch 91 | .PHONY: build clean binary-indep binary-arch binary install configure 92 | -------------------------------------------------------------------------------- /Desktop/debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | # Sample debian/rules that uses debhelper. 4 | # This file was originally written by Joey Hess and Craig Small. 5 | # As a special exception, when this file is copied by dh-make into a 6 | # dh-make output file, you may use that output file without restriction. 7 | # This special exception was added by Craig Small in version 0.37 of dh-make. 8 | 9 | # Uncomment this to turn on verbose mode. 10 | #export DH_VERBOSE=1 11 | 12 | 13 | 14 | 15 | 16 | configure: configure-stamp 17 | configure-stamp: 18 | dh_testdir 19 | qmake PREFIX=/usr # Uncomment this line for use without Qt Creator 20 | 21 | touch configure-stamp 22 | 23 | 24 | build: build-stamp 25 | 26 | build-stamp: configure-stamp 27 | dh_testdir 28 | 29 | # Add here commands to compile the package. 30 | # $(MAKE) # Uncomment this line for use without Qt Creator 31 | #docbook-to-man debian/ownnotes.sgml > ownnotes.1 32 | 33 | touch $@ 34 | 35 | clean: 36 | dh_testdir 37 | dh_testroot 38 | rm -f build-stamp configure-stamp 39 | 40 | # Add here commands to clean up after the build process. 41 | $(MAKE) clean 42 | 43 | dh_clean 44 | 45 | install: build 46 | dh_testdir 47 | dh_testroot 48 | dh_clean -k 49 | dh_installdirs 50 | 51 | # Add here commands to install the package into debian/ownnotes. 52 | $(MAKE) INSTALL_ROOT="$(CURDIR)"/debian/ownnotes install 53 | 54 | 55 | # Build architecture-independent files here. 56 | binary-indep: build install 57 | # We have nothing to do by default. 58 | 59 | # Build architecture-dependent files here. 60 | binary-arch: build install 61 | dh_testdir 62 | dh_testroot 63 | dh_installchangelogs 64 | dh_installdocs 65 | dh_installexamples 66 | # dh_install 67 | # dh_installmenu 68 | # dh_installdebconf 69 | # dh_installlogrotate 70 | # dh_installemacsen 71 | # dh_installpam 72 | # dh_installmime 73 | # dh_python 74 | # dh_installinit 75 | # dh_installcron 76 | # dh_installinfo 77 | dh_installman 78 | dh_link 79 | dh_strip 80 | dh_compress 81 | dh_fixperms 82 | # dh_perl 83 | # dh_makeshlibs 84 | dh_installdeb 85 | dh_shlibdeps # Uncomment this line for use without Qt Creator 86 | dh_gencontrol 87 | dh_md5sums 88 | dh_builddeb 89 | 90 | binary: binary-indep binary-arch 91 | .PHONY: build clean binary-indep binary-arch binary install configure 92 | -------------------------------------------------------------------------------- /python/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | """The match_hostname() function from Python 3.2, essential when using SSL.""" 2 | 3 | import re 4 | 5 | __version__ = '3.2.2' 6 | 7 | class CertificateError(ValueError): 8 | pass 9 | 10 | def _dnsname_to_pat(dn): 11 | pats = [] 12 | for frag in dn.split(r'.'): 13 | if frag == '*': 14 | # When '*' is a fragment by itself, it matches a non-empty dotless 15 | # fragment. 16 | pats.append('[^.]+') 17 | else: 18 | # Otherwise, '*' matches any dotless fragment. 19 | frag = re.escape(frag) 20 | pats.append(frag.replace(r'\*', '[^.]*')) 21 | return re.compile(r'\A' + r'\.'.join(pats) + r'\Z', re.IGNORECASE) 22 | 23 | def match_hostname(cert, hostname): 24 | """Verify that *cert* (in decoded format as returned by 25 | SSLSocket.getpeercert()) matches the *hostname*. RFC 2818 rules 26 | are mostly followed, but IP addresses are not accepted for *hostname*. 27 | 28 | CertificateError is raised on failure. On success, the function 29 | returns nothing. 30 | """ 31 | if not cert: 32 | raise ValueError("empty or no certificate") 33 | dnsnames = [] 34 | san = cert.get('subjectAltName', ()) 35 | for key, value in san: 36 | if key == 'DNS': 37 | if _dnsname_to_pat(value).match(hostname): 38 | return 39 | dnsnames.append(value) 40 | if not dnsnames: 41 | # The subject is only checked when there is no dNSName entry 42 | # in subjectAltName 43 | for sub in cert.get('subject', ()): 44 | for key, value in sub: 45 | # XXX according to RFC 2818, the most specific Common Name 46 | # must be used. 47 | if key == 'commonName': 48 | if _dnsname_to_pat(value).match(hostname): 49 | return 50 | dnsnames.append(value) 51 | if len(dnsnames) > 1: 52 | raise CertificateError("hostname %r " 53 | "doesn't match either of %s" 54 | % (hostname, ', '.join(map(repr, dnsnames)))) 55 | elif len(dnsnames) == 1: 56 | raise CertificateError("hostname %r " 57 | "doesn't match %r" 58 | % (hostname, dnsnames[0])) 59 | else: 60 | raise CertificateError("no appropriate commonName or " 61 | "subjectAltName fields were found") 62 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/qml/pages/FontComboBox.qml: -------------------------------------------------------------------------------- 1 | /**************************************************************************************** 2 | ** 3 | ** Copyright (C) 2013 Jolla Ltd. 4 | ** Contact: Joona Petrell 5 | ** All rights reserved. 6 | ** 7 | ** This file is part of Sailfish Silica UI component package. 8 | ** 9 | ** You may use this file under the terms of BSD license as follows: 10 | ** 11 | ** Redistribution and use in source and binary forms, with or without 12 | ** modification, are permitted provided that the following conditions are met: 13 | ** * Redistributions of source code must retain the above copyright 14 | ** notice, this list of conditions and the following disclaimer. 15 | ** * Redistributions in binary form must reproduce the above copyright 16 | ** notice, this list of conditions and the following disclaimer in the 17 | ** documentation and/or other materials provided with the distribution. 18 | ** * Neither the name of the Jolla Ltd nor the 19 | ** names of its contributors may be used to endorse or promote products 20 | ** derived from this software without specific prior written permission. 21 | ** 22 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 23 | ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 24 | ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 25 | ** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR 26 | ** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 27 | ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 28 | ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 29 | ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 30 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 31 | ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 32 | ** 33 | ****************************************************************************************/ 34 | 35 | import QtQuick 2.0 36 | import Sailfish.Silica 1.0 37 | 38 | ComboBox { 39 | id: comboBox 40 | 41 | property variant model 42 | 43 | width: parent.width 44 | menu: ContextMenu { 45 | Repeater { 46 | model: comboBox.model 47 | MenuItem { 48 | text: family 49 | font.family: family 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Desktop/python/requests/packages/chardet/codingstatemachine.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .constants import eStart 29 | from .compat import wrap_ord 30 | 31 | 32 | class CodingStateMachine: 33 | def __init__(self, sm): 34 | self._mModel = sm 35 | self._mCurrentBytePos = 0 36 | self._mCurrentCharLen = 0 37 | self.reset() 38 | 39 | def reset(self): 40 | self._mCurrentState = eStart 41 | 42 | def next_state(self, c): 43 | # for each byte we get its class 44 | # if it is first byte, we also get byte length 45 | # PY3K: aBuf is a byte stream, so c is an int, not a byte 46 | byteCls = self._mModel['classTable'][wrap_ord(c)] 47 | if self._mCurrentState == eStart: 48 | self._mCurrentBytePos = 0 49 | self._mCurrentCharLen = self._mModel['charLenTable'][byteCls] 50 | # from byte's class and stateTable, we get its next state 51 | curr_state = (self._mCurrentState * self._mModel['classFactor'] 52 | + byteCls) 53 | self._mCurrentState = self._mModel['stateTable'][curr_state] 54 | self._mCurrentBytePos += 1 55 | return self._mCurrentState 56 | 57 | def get_current_charlen(self): 58 | return self._mCurrentCharLen 59 | 60 | def get_coding_state_machine(self): 61 | return self._mModel['name'] 62 | -------------------------------------------------------------------------------- /Sailfish/ownNotes/python/requests/packages/chardet/codingstatemachine.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is mozilla.org code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 1998 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # 12 | # This library is free software; you can redistribute it and/or 13 | # modify it under the terms of the GNU Lesser General Public 14 | # License as published by the Free Software Foundation; either 15 | # version 2.1 of the License, or (at your option) any later version. 16 | # 17 | # This library is distributed in the hope that it will be useful, 18 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 20 | # Lesser General Public License for more details. 21 | # 22 | # You should have received a copy of the GNU Lesser General Public 23 | # License along with this library; if not, write to the Free Software 24 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 25 | # 02110-1301 USA 26 | ######################### END LICENSE BLOCK ######################### 27 | 28 | from .constants import eStart 29 | from .compat import wrap_ord 30 | 31 | 32 | class CodingStateMachine: 33 | def __init__(self, sm): 34 | self._mModel = sm 35 | self._mCurrentBytePos = 0 36 | self._mCurrentCharLen = 0 37 | self.reset() 38 | 39 | def reset(self): 40 | self._mCurrentState = eStart 41 | 42 | def next_state(self, c): 43 | # for each byte we get its class 44 | # if it is first byte, we also get byte length 45 | # PY3K: aBuf is a byte stream, so c is an int, not a byte 46 | byteCls = self._mModel['classTable'][wrap_ord(c)] 47 | if self._mCurrentState == eStart: 48 | self._mCurrentBytePos = 0 49 | self._mCurrentCharLen = self._mModel['charLenTable'][byteCls] 50 | # from byte's class and stateTable, we get its next state 51 | curr_state = (self._mCurrentState * self._mModel['classFactor'] 52 | + byteCls) 53 | self._mCurrentState = self._mModel['stateTable'][curr_state] 54 | self._mCurrentBytePos += 1 55 | return self._mCurrentState 56 | 57 | def get_current_charlen(self): 58 | return self._mCurrentCharLen 59 | 60 | def get_coding_state_machine(self): 61 | return self._mModel['name'] 62 | -------------------------------------------------------------------------------- /Harmattan/moc/moc_qmlapplicationviewer.cpp: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | ** Meta object code from reading C++ file 'qmlapplicationviewer.h' 3 | ** 4 | ** Created: Mon 12. Aug 16:47:44 2013 5 | ** by: The Qt Meta Object Compiler version 62 (Qt 4.7.4) 6 | ** 7 | ** WARNING! All changes made in this file will be lost! 8 | *****************************************************************************/ 9 | 10 | #include "../qmlapplicationviewer/qmlapplicationviewer.h" 11 | #if !defined(Q_MOC_OUTPUT_REVISION) 12 | #error "The header file 'qmlapplicationviewer.h' doesn't include ." 13 | #elif Q_MOC_OUTPUT_REVISION != 62 14 | #error "This file was generated using the moc from 4.7.4. It" 15 | #error "cannot be used with the include files from this version of Qt." 16 | #error "(The moc has changed too much.)" 17 | #endif 18 | 19 | QT_BEGIN_MOC_NAMESPACE 20 | static const uint qt_meta_data_QmlApplicationViewer[] = { 21 | 22 | // content: 23 | 5, // revision 24 | 0, // classname 25 | 0, 0, // classinfo 26 | 0, 0, // methods 27 | 0, 0, // properties 28 | 0, 0, // enums/sets 29 | 0, 0, // constructors 30 | 0, // flags 31 | 0, // signalCount 32 | 33 | 0 // eod 34 | }; 35 | 36 | static const char qt_meta_stringdata_QmlApplicationViewer[] = { 37 | "QmlApplicationViewer\0" 38 | }; 39 | 40 | const QMetaObject QmlApplicationViewer::staticMetaObject = { 41 | { &QDeclarativeView::staticMetaObject, qt_meta_stringdata_QmlApplicationViewer, 42 | qt_meta_data_QmlApplicationViewer, 0 } 43 | }; 44 | 45 | #ifdef Q_NO_DATA_RELOCATION 46 | const QMetaObject &QmlApplicationViewer::getStaticMetaObject() { return staticMetaObject; } 47 | #endif //Q_NO_DATA_RELOCATION 48 | 49 | const QMetaObject *QmlApplicationViewer::metaObject() const 50 | { 51 | return QObject::d_ptr->metaObject ? QObject::d_ptr->metaObject : &staticMetaObject; 52 | } 53 | 54 | void *QmlApplicationViewer::qt_metacast(const char *_clname) 55 | { 56 | if (!_clname) return 0; 57 | if (!strcmp(_clname, qt_meta_stringdata_QmlApplicationViewer)) 58 | return static_cast(const_cast< QmlApplicationViewer*>(this)); 59 | return QDeclarativeView::qt_metacast(_clname); 60 | } 61 | 62 | int QmlApplicationViewer::qt_metacall(QMetaObject::Call _c, int _id, void **_a) 63 | { 64 | _id = QDeclarativeView::qt_metacall(_c, _id, _a); 65 | if (_id < 0) 66 | return _id; 67 | return _id; 68 | } 69 | QT_END_MOC_NAMESPACE 70 | --------------------------------------------------------------------------------