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 |
--------------------------------------------------------------------------------