├── .DS_Store ├── README.md ├── iOS运行Python.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── tandelin.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── tandelin.xcuserdatad │ ├── xcdebugger │ └── Breakpoints_v2.xcbkptlist │ └── xcschemes │ ├── iOS运行Python.xcscheme │ └── xcschememanagement.plist ├── iOS运行Python ├── .DS_Store ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Info.plist ├── NSString+YXAdd.h ├── NSString+YXAdd.m ├── Pybridge.py ├── Python-3.4.2-iOS-support.b5 │ └── .DS_Store ├── PythonEnvironment.bundle │ └── Python.framework │ │ └── Resources │ │ ├── include │ │ └── python3.4 │ │ │ ├── Python.h │ │ │ ├── pyconfig-arm64.h │ │ │ ├── pyconfig-armv7.h │ │ │ ├── pyconfig-armv7s.h │ │ │ ├── pyconfig-i386.h │ │ │ ├── pyconfig-x86_64.h │ │ │ └── pyconfig.h │ │ └── lib │ │ ├── python3.4 │ │ └── site-packages │ │ │ ├── bs4 │ │ │ ├── __init__.py │ │ │ ├── builder │ │ │ │ ├── __init__.py │ │ │ │ ├── _html5lib.py │ │ │ │ ├── _htmlparser.py │ │ │ │ └── _lxml.py │ │ │ ├── dammit.py │ │ │ ├── diagnose.py │ │ │ ├── element.py │ │ │ ├── testing.py │ │ │ └── tests │ │ │ │ ├── __init__.py │ │ │ │ ├── test_builder_registry.py │ │ │ │ ├── test_docs.py │ │ │ │ ├── test_html5lib.py │ │ │ │ ├── test_htmlparser.py │ │ │ │ ├── test_lxml.py │ │ │ │ ├── test_soup.py │ │ │ │ └── test_tree.py │ │ │ ├── requests │ │ │ ├── __init__.py │ │ │ ├── adapters.py │ │ │ ├── api.py │ │ │ ├── auth.py │ │ │ ├── cacert.pem │ │ │ ├── certs.py │ │ │ ├── compat.py │ │ │ ├── cookies.py │ │ │ ├── exceptions.py │ │ │ ├── hooks.py │ │ │ ├── models.py │ │ │ ├── packages │ │ │ │ ├── README.rst │ │ │ │ ├── __init__.py │ │ │ │ ├── chardet │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── big5freq.py │ │ │ │ │ ├── big5prober.py │ │ │ │ │ ├── chardetect.py │ │ │ │ │ ├── chardistribution.py │ │ │ │ │ ├── charsetgroupprober.py │ │ │ │ │ ├── charsetprober.py │ │ │ │ │ ├── codingstatemachine.py │ │ │ │ │ ├── compat.py │ │ │ │ │ ├── constants.py │ │ │ │ │ ├── cp949prober.py │ │ │ │ │ ├── escprober.py │ │ │ │ │ ├── escsm.py │ │ │ │ │ ├── eucjpprober.py │ │ │ │ │ ├── euckrfreq.py │ │ │ │ │ ├── euckrprober.py │ │ │ │ │ ├── euctwfreq.py │ │ │ │ │ ├── euctwprober.py │ │ │ │ │ ├── gb2312freq.py │ │ │ │ │ ├── gb2312prober.py │ │ │ │ │ ├── hebrewprober.py │ │ │ │ │ ├── jisfreq.py │ │ │ │ │ ├── jpcntx.py │ │ │ │ │ ├── langbulgarianmodel.py │ │ │ │ │ ├── langcyrillicmodel.py │ │ │ │ │ ├── langgreekmodel.py │ │ │ │ │ ├── langhebrewmodel.py │ │ │ │ │ ├── langhungarianmodel.py │ │ │ │ │ ├── langthaimodel.py │ │ │ │ │ ├── latin1prober.py │ │ │ │ │ ├── mbcharsetprober.py │ │ │ │ │ ├── mbcsgroupprober.py │ │ │ │ │ ├── mbcssm.py │ │ │ │ │ ├── sbcharsetprober.py │ │ │ │ │ ├── sbcsgroupprober.py │ │ │ │ │ ├── sjisprober.py │ │ │ │ │ ├── universaldetector.py │ │ │ │ │ └── utf8prober.py │ │ │ │ └── urllib3 │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── _collections.py │ │ │ │ │ ├── connection.py │ │ │ │ │ ├── connectionpool.py │ │ │ │ │ ├── contrib │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── ntlmpool.py │ │ │ │ │ └── pyopenssl.py │ │ │ │ │ ├── exceptions.py │ │ │ │ │ ├── fields.py │ │ │ │ │ ├── filepost.py │ │ │ │ │ ├── packages │ │ │ │ │ ├── __init__.py │ │ │ │ │ ├── ordered_dict.py │ │ │ │ │ ├── six.py │ │ │ │ │ └── ssl_match_hostname │ │ │ │ │ │ ├── __init__.py │ │ │ │ │ │ └── _implementation.py │ │ │ │ │ ├── poolmanager.py │ │ │ │ │ ├── request.py │ │ │ │ │ ├── response.py │ │ │ │ │ └── util.py │ │ │ ├── sessions.py │ │ │ ├── status_codes.py │ │ │ ├── structures.py │ │ │ ├── types.py │ │ │ └── utils.py │ │ │ └── urllib3 │ │ │ ├── __init__.py │ │ │ ├── _collections.py │ │ │ ├── connection.py │ │ │ ├── connectionpool.py │ │ │ ├── contrib │ │ │ ├── __init__.py │ │ │ ├── ntlmpool.py │ │ │ └── pyopenssl.py │ │ │ ├── exceptions.py │ │ │ ├── fields.py │ │ │ ├── filepost.py │ │ │ ├── packages │ │ │ ├── __init__.py │ │ │ ├── ordered_dict.py │ │ │ ├── six.py │ │ │ └── ssl_match_hostname │ │ │ │ ├── __init__.py │ │ │ │ └── _implementation.py │ │ │ ├── poolmanager.py │ │ │ ├── request.py │ │ │ ├── response.py │ │ │ └── util.py │ │ ├── python34.zip │ │ └── python34 │ │ ├── LICENSE.txt │ │ ├── __future__.py │ │ ├── __phello__.foo.py │ │ ├── _bootlocale.py │ │ ├── _collections_abc.py │ │ ├── _compat_pickle.py │ │ ├── _dummy_thread.py │ │ ├── _markupbase.py │ │ ├── _osx_support.py │ │ ├── _pyio.py │ │ ├── _sitebuiltins.py │ │ ├── _strptime.py │ │ ├── _sysconfigdata.py │ │ ├── _threading_local.py │ │ ├── _weakrefset.py │ │ ├── abc.py │ │ ├── aifc.py │ │ ├── antigravity.py │ │ ├── argparse.py │ │ ├── ast.py │ │ ├── asynchat.py │ │ ├── asyncio │ │ ├── __init__.py │ │ ├── base_events.py │ │ ├── base_subprocess.py │ │ ├── constants.py │ │ ├── coroutines.py │ │ ├── events.py │ │ ├── futures.py │ │ ├── locks.py │ │ ├── log.py │ │ ├── proactor_events.py │ │ ├── protocols.py │ │ ├── queues.py │ │ ├── selector_events.py │ │ ├── streams.py │ │ ├── subprocess.py │ │ ├── tasks.py │ │ ├── test_utils.py │ │ ├── transports.py │ │ ├── unix_events.py │ │ ├── windows_events.py │ │ └── windows_utils.py │ │ ├── asyncore.py │ │ ├── base64.py │ │ ├── bdb.py │ │ ├── binhex.py │ │ ├── bisect.py │ │ ├── bz2.py │ │ ├── cProfile.py │ │ ├── calendar.py │ │ ├── cgi.py │ │ ├── cgitb.py │ │ ├── chunk.py │ │ ├── cmd.py │ │ ├── code.py │ │ ├── codecs.py │ │ ├── codeop.py │ │ ├── collections │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── abc.py │ │ ├── colorsys.py │ │ ├── compileall.py │ │ ├── concurrent │ │ ├── __init__.py │ │ └── futures │ │ │ ├── __init__.py │ │ │ ├── _base.py │ │ │ ├── process.py │ │ │ └── thread.py │ │ ├── configparser.py │ │ ├── contextlib.py │ │ ├── copy.py │ │ ├── copyreg.py │ │ ├── crypt.py │ │ ├── csv.py │ │ ├── ctypes │ │ ├── __init__.py │ │ ├── _endian.py │ │ ├── macholib │ │ │ ├── README.ctypes │ │ │ ├── __init__.py │ │ │ ├── dyld.py │ │ │ ├── dylib.py │ │ │ ├── fetch_macholib │ │ │ ├── fetch_macholib.bat │ │ │ └── framework.py │ │ ├── util.py │ │ └── wintypes.py │ │ ├── datetime.py │ │ ├── dbm │ │ ├── __init__.py │ │ ├── dumb.py │ │ ├── gnu.py │ │ └── ndbm.py │ │ ├── decimal.py │ │ ├── difflib.py │ │ ├── dis.py │ │ ├── distutils │ │ ├── README │ │ ├── __init__.py │ │ ├── archive_util.py │ │ ├── bcppcompiler.py │ │ ├── ccompiler.py │ │ ├── cmd.py │ │ ├── command │ │ │ ├── __init__.py │ │ │ ├── bdist.py │ │ │ ├── bdist_dumb.py │ │ │ ├── bdist_msi.py │ │ │ ├── bdist_rpm.py │ │ │ ├── bdist_wininst.py │ │ │ ├── build.py │ │ │ ├── build_clib.py │ │ │ ├── build_ext.py │ │ │ ├── build_py.py │ │ │ ├── build_scripts.py │ │ │ ├── check.py │ │ │ ├── clean.py │ │ │ ├── command_template │ │ │ ├── config.py │ │ │ ├── install.py │ │ │ ├── install_data.py │ │ │ ├── install_egg_info.py │ │ │ ├── install_headers.py │ │ │ ├── install_lib.py │ │ │ ├── install_scripts.py │ │ │ ├── register.py │ │ │ ├── sdist.py │ │ │ ├── upload.py │ │ │ ├── wininst-10.0-amd64.exe │ │ │ ├── wininst-10.0.exe │ │ │ ├── wininst-6.0.exe │ │ │ ├── wininst-7.1.exe │ │ │ ├── wininst-8.0.exe │ │ │ ├── wininst-9.0-amd64.exe │ │ │ └── wininst-9.0.exe │ │ ├── config.py │ │ ├── core.py │ │ ├── cygwinccompiler.py │ │ ├── debug.py │ │ ├── dep_util.py │ │ ├── dir_util.py │ │ ├── dist.py │ │ ├── errors.py │ │ ├── extension.py │ │ ├── fancy_getopt.py │ │ ├── file_util.py │ │ ├── filelist.py │ │ ├── log.py │ │ ├── msvc9compiler.py │ │ ├── msvccompiler.py │ │ ├── spawn.py │ │ ├── sysconfig.py │ │ ├── text_file.py │ │ ├── unixccompiler.py │ │ ├── util.py │ │ ├── version.py │ │ └── versionpredicate.py │ │ ├── doctest.py │ │ ├── dummy_threading.py │ │ ├── email │ │ ├── __init__.py │ │ ├── _encoded_words.py │ │ ├── _header_value_parser.py │ │ ├── _parseaddr.py │ │ ├── _policybase.py │ │ ├── architecture.rst │ │ ├── base64mime.py │ │ ├── charset.py │ │ ├── contentmanager.py │ │ ├── encoders.py │ │ ├── errors.py │ │ ├── feedparser.py │ │ ├── generator.py │ │ ├── header.py │ │ ├── headerregistry.py │ │ ├── iterators.py │ │ ├── message.py │ │ ├── mime │ │ │ ├── __init__.py │ │ │ ├── application.py │ │ │ ├── audio.py │ │ │ ├── base.py │ │ │ ├── image.py │ │ │ ├── message.py │ │ │ ├── multipart.py │ │ │ ├── nonmultipart.py │ │ │ └── text.py │ │ ├── parser.py │ │ ├── policy.py │ │ ├── quoprimime.py │ │ └── utils.py │ │ ├── encodings │ │ ├── __init__.py │ │ ├── aliases.py │ │ ├── ascii.py │ │ ├── base64_codec.py │ │ ├── big5.py │ │ ├── big5hkscs.py │ │ ├── bz2_codec.py │ │ ├── charmap.py │ │ ├── cp037.py │ │ ├── cp1006.py │ │ ├── cp1026.py │ │ ├── cp1125.py │ │ ├── cp1140.py │ │ ├── cp1250.py │ │ ├── cp1251.py │ │ ├── cp1252.py │ │ ├── cp1253.py │ │ ├── cp1254.py │ │ ├── cp1255.py │ │ ├── cp1256.py │ │ ├── cp1257.py │ │ ├── cp1258.py │ │ ├── cp273.py │ │ ├── cp424.py │ │ ├── cp437.py │ │ ├── cp500.py │ │ ├── cp65001.py │ │ ├── cp720.py │ │ ├── cp737.py │ │ ├── cp775.py │ │ ├── cp850.py │ │ ├── cp852.py │ │ ├── cp855.py │ │ ├── cp856.py │ │ ├── cp857.py │ │ ├── cp858.py │ │ ├── cp860.py │ │ ├── cp861.py │ │ ├── cp862.py │ │ ├── cp863.py │ │ ├── cp864.py │ │ ├── cp865.py │ │ ├── cp866.py │ │ ├── cp869.py │ │ ├── cp874.py │ │ ├── cp875.py │ │ ├── cp932.py │ │ ├── cp949.py │ │ ├── cp950.py │ │ ├── euc_jis_2004.py │ │ ├── euc_jisx0213.py │ │ ├── euc_jp.py │ │ ├── euc_kr.py │ │ ├── gb18030.py │ │ ├── gb2312.py │ │ ├── gbk.py │ │ ├── hex_codec.py │ │ ├── hp_roman8.py │ │ ├── hz.py │ │ ├── idna.py │ │ ├── iso2022_jp.py │ │ ├── iso2022_jp_1.py │ │ ├── iso2022_jp_2.py │ │ ├── iso2022_jp_2004.py │ │ ├── iso2022_jp_3.py │ │ ├── iso2022_jp_ext.py │ │ ├── iso2022_kr.py │ │ ├── iso8859_1.py │ │ ├── iso8859_10.py │ │ ├── iso8859_11.py │ │ ├── iso8859_13.py │ │ ├── iso8859_14.py │ │ ├── iso8859_15.py │ │ ├── iso8859_16.py │ │ ├── iso8859_2.py │ │ ├── iso8859_3.py │ │ ├── iso8859_4.py │ │ ├── iso8859_5.py │ │ ├── iso8859_6.py │ │ ├── iso8859_7.py │ │ ├── iso8859_8.py │ │ ├── iso8859_9.py │ │ ├── johab.py │ │ ├── koi8_r.py │ │ ├── koi8_u.py │ │ ├── latin_1.py │ │ ├── mac_arabic.py │ │ ├── mac_centeuro.py │ │ ├── mac_croatian.py │ │ ├── mac_cyrillic.py │ │ ├── mac_farsi.py │ │ ├── mac_greek.py │ │ ├── mac_iceland.py │ │ ├── mac_latin2.py │ │ ├── mac_roman.py │ │ ├── mac_romanian.py │ │ ├── mac_turkish.py │ │ ├── mbcs.py │ │ ├── palmos.py │ │ ├── ptcp154.py │ │ ├── punycode.py │ │ ├── quopri_codec.py │ │ ├── raw_unicode_escape.py │ │ ├── rot_13.py │ │ ├── shift_jis.py │ │ ├── shift_jis_2004.py │ │ ├── shift_jisx0213.py │ │ ├── tis_620.py │ │ ├── undefined.py │ │ ├── unicode_escape.py │ │ ├── unicode_internal.py │ │ ├── utf_16.py │ │ ├── utf_16_be.py │ │ ├── utf_16_le.py │ │ ├── utf_32.py │ │ ├── utf_32_be.py │ │ ├── utf_32_le.py │ │ ├── utf_7.py │ │ ├── utf_8.py │ │ ├── utf_8_sig.py │ │ ├── uu_codec.py │ │ └── zlib_codec.py │ │ ├── enum.py │ │ ├── filecmp.py │ │ ├── fileinput.py │ │ ├── fnmatch.py │ │ ├── formatter.py │ │ ├── fractions.py │ │ ├── ftplib.py │ │ ├── functools.py │ │ ├── genericpath.py │ │ ├── getopt.py │ │ ├── getpass.py │ │ ├── gettext.py │ │ ├── glob.py │ │ ├── gzip.py │ │ ├── hashlib.py │ │ ├── heapq.py │ │ ├── hmac.py │ │ ├── html │ │ ├── __init__.py │ │ ├── entities.py │ │ └── parser.py │ │ ├── http │ │ ├── __init__.py │ │ ├── client.py │ │ ├── cookiejar.py │ │ ├── cookies.py │ │ └── server.py │ │ ├── imaplib.py │ │ ├── imghdr.py │ │ ├── imp.py │ │ ├── importlib │ │ ├── __init__.py │ │ ├── _bootstrap.py │ │ ├── abc.py │ │ ├── machinery.py │ │ └── util.py │ │ ├── inspect.py │ │ ├── io.py │ │ ├── ipaddress.py │ │ ├── json │ │ ├── __init__.py │ │ ├── decoder.py │ │ ├── encoder.py │ │ ├── scanner.py │ │ └── tool.py │ │ ├── keyword.py │ │ ├── linecache.py │ │ ├── locale.py │ │ ├── logging │ │ ├── __init__.py │ │ ├── config.py │ │ └── handlers.py │ │ ├── lzma.py │ │ ├── macpath.py │ │ ├── macurl2path.py │ │ ├── mailbox.py │ │ ├── mailcap.py │ │ ├── mimetypes.py │ │ ├── modulefinder.py │ │ ├── multiprocessing │ │ ├── __init__.py │ │ ├── connection.py │ │ ├── context.py │ │ ├── dummy │ │ │ ├── __init__.py │ │ │ └── connection.py │ │ ├── forkserver.py │ │ ├── heap.py │ │ ├── managers.py │ │ ├── pool.py │ │ ├── popen_fork.py │ │ ├── popen_forkserver.py │ │ ├── popen_spawn_posix.py │ │ ├── popen_spawn_win32.py │ │ ├── process.py │ │ ├── queues.py │ │ ├── reduction.py │ │ ├── resource_sharer.py │ │ ├── semaphore_tracker.py │ │ ├── sharedctypes.py │ │ ├── spawn.py │ │ ├── synchronize.py │ │ └── util.py │ │ ├── netrc.py │ │ ├── nntplib.py │ │ ├── ntpath.py │ │ ├── nturl2path.py │ │ ├── numbers.py │ │ ├── opcode.py │ │ ├── operator.py │ │ ├── optparse.py │ │ ├── os.py │ │ ├── pathlib.py │ │ ├── pdb.py │ │ ├── pickle.py │ │ ├── pickletools.py │ │ ├── pipes.py │ │ ├── pkgutil.py │ │ ├── plat-ios │ │ ├── IN.py │ │ └── regen │ │ ├── platform.py │ │ ├── plistlib.py │ │ ├── poplib.py │ │ ├── posixpath.py │ │ ├── pprint.py │ │ ├── profile.py │ │ ├── pstats.py │ │ ├── pty.py │ │ ├── py_compile.py │ │ ├── pyclbr.py │ │ ├── pydoc.py │ │ ├── pydoc_data │ │ ├── __init__.py │ │ ├── _pydoc.css │ │ └── topics.py │ │ ├── queue.py │ │ ├── quopri.py │ │ ├── random.py │ │ ├── re.py │ │ ├── reprlib.py │ │ ├── rlcompleter.py │ │ ├── runpy.py │ │ ├── sched.py │ │ ├── selectors.py │ │ ├── shelve.py │ │ ├── shlex.py │ │ ├── shutil.py │ │ ├── site.py │ │ ├── smtpd.py │ │ ├── smtplib.py │ │ ├── sndhdr.py │ │ ├── socket.py │ │ ├── socketserver.py │ │ ├── sqlite3 │ │ ├── __init__.py │ │ ├── dbapi2.py │ │ └── dump.py │ │ ├── sre_compile.py │ │ ├── sre_constants.py │ │ ├── sre_parse.py │ │ ├── ssl.py │ │ ├── stat.py │ │ ├── statistics.py │ │ ├── string.py │ │ ├── stringprep.py │ │ ├── struct.py │ │ ├── subprocess.py │ │ ├── sunau.py │ │ ├── symbol.py │ │ ├── symtable.py │ │ ├── sysconfig.py │ │ ├── tabnanny.py │ │ ├── tarfile.py │ │ ├── telnetlib.py │ │ ├── tempfile.py │ │ ├── textwrap.py │ │ ├── this.py │ │ ├── threading.py │ │ ├── timeit.py │ │ ├── token.py │ │ ├── tokenize.py │ │ ├── trace.py │ │ ├── traceback.py │ │ ├── tracemalloc.py │ │ ├── tty.py │ │ ├── turtle.py │ │ ├── types.py │ │ ├── urllib │ │ ├── __init__.py │ │ ├── error.py │ │ ├── parse.py │ │ ├── request.py │ │ ├── response.py │ │ └── robotparser.py │ │ ├── uu.py │ │ ├── uuid.py │ │ ├── venv │ │ ├── __init__.py │ │ ├── __main__.py │ │ └── scripts │ │ │ └── posix │ │ │ ├── activate │ │ │ ├── activate.csh │ │ │ └── activate.fish │ │ ├── warnings.py │ │ ├── wave.py │ │ ├── weakref.py │ │ ├── webbrowser.py │ │ ├── xdrlib.py │ │ ├── xml │ │ ├── __init__.py │ │ ├── dom │ │ │ ├── NodeFilter.py │ │ │ ├── __init__.py │ │ │ ├── domreg.py │ │ │ ├── expatbuilder.py │ │ │ ├── minicompat.py │ │ │ ├── minidom.py │ │ │ ├── pulldom.py │ │ │ └── xmlbuilder.py │ │ ├── etree │ │ │ ├── ElementInclude.py │ │ │ ├── ElementPath.py │ │ │ ├── ElementTree.py │ │ │ ├── __init__.py │ │ │ └── cElementTree.py │ │ ├── parsers │ │ │ ├── __init__.py │ │ │ └── expat.py │ │ └── sax │ │ │ ├── __init__.py │ │ │ ├── _exceptions.py │ │ │ ├── expatreader.py │ │ │ ├── handler.py │ │ │ ├── saxutils.py │ │ │ └── xmlreader.py │ │ ├── xmlrpc │ │ ├── __init__.py │ │ ├── client.py │ │ └── server.py │ │ └── zipfile.py ├── ViewController.h ├── ViewController.m ├── YXPyModuleManager.h ├── YXPyModuleManager.m ├── YXPythonExecute.h ├── YXPythonExecute.m ├── YXPythonInterpreter.h ├── YXPythonInterpreter.m ├── YXPythonTestViewController.h ├── YXPythonTestViewController.m ├── YXPythonTestViewController.xib ├── icbc.py ├── main.m └── yj.py ├── iOS运行PythonTests ├── Info.plist └── iOS__PythonTests.m └── iOS运行PythonUITests ├── Info.plist └── iOS__PythonUITests.m /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/.DS_Store -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # YJPythonInterpreterDemo 2 | iOS 运行Python解释器Demo,使用解释看http://www.jianshu.com/p/80b5be51fb1d 3 | -------------------------------------------------------------------------------- /iOS运行Python.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /iOS运行Python.xcodeproj/project.xcworkspace/xcuserdata/tandelin.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python.xcodeproj/project.xcworkspace/xcuserdata/tandelin.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /iOS运行Python.xcodeproj/xcuserdata/tandelin.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 8 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /iOS运行Python.xcodeproj/xcuserdata/tandelin.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | iOS运行Python.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9A0652AE1F579BC30008D4EE 16 | 17 | primary 18 | 19 | 20 | 9A0652C71F579BC30008D4EE 21 | 22 | primary 23 | 24 | 25 | 9A0652D21F579BC30008D4EE 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS运行Python/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/.DS_Store -------------------------------------------------------------------------------- /iOS运行Python/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/8/31. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /iOS运行Python/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/8/31. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /iOS运行Python/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } -------------------------------------------------------------------------------- /iOS运行Python/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /iOS运行Python/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | NSAppTransportSecurity 45 | 46 | NSAllowsArbitraryLoads 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /iOS运行Python/NSString+YXAdd.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+YXAdd.h 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/9/11. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (YXAdd) 12 | +(const char *)yx_stringToChar:(NSString *)string; 13 | +(NSString *)yx_charToString:(const char *)cString; 14 | @end 15 | -------------------------------------------------------------------------------- /iOS运行Python/NSString+YXAdd.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+YXAdd.m 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/9/11. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import "NSString+YXAdd.h" 10 | 11 | @implementation NSString (YXAdd) 12 | +(const char *)yx_stringToChar:(NSString *)string 13 | { 14 | return [string UTF8String]; 15 | } 16 | 17 | +(NSString *)yx_charToString:(const char *)cString 18 | { 19 | return [NSString stringWithUTF8String:cString]; 20 | } 21 | @end 22 | -------------------------------------------------------------------------------- /iOS运行Python/Pybridge.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | ''' 3 | Created on 2016年12月4日 4 | 5 | @author: cary.zhu 6 | ''' 7 | 8 | import json 9 | import importlib 10 | import traceback 11 | import time 12 | import importlib.util 13 | 14 | def fuckTest(): 15 | print('this is fuck test') 16 | 17 | class SpiderRouter(object): 18 | ''' 19 | params:{ 20 | type:类型(bank、e-commers、telecommunications) 21 | name:例如:abc 22 | class:例如:Bank 23 | } 24 | ''' 25 | 26 | def init(self, jsonParams): 27 | res = None 28 | print (str(jsonParams)) 29 | print('fuck') 30 | for a in range(10): 31 | print(a) 32 | time.sleep(1) 33 | 34 | try: 35 | 36 | print('start paras data') 37 | values = json.loads(jsonParams) 38 | m1 = importlib.import_module(values.get('type') + '.' + values.get('name')) 39 | self.aclass = getattr(m1, values.get('class')) 40 | function = values.get('method') 41 | res = self.aclass.init(self.aclass); 42 | status = 'true' 43 | print('end paras data') 44 | except KeyError: 45 | print('error') 46 | status = 'false' 47 | res = None 48 | traceback.print_exc() 49 | return json.dumps({ 50 | 'status': status, 51 | 'result': res 52 | }) 53 | 54 | ''' 55 | jsonParams:json格式参数 56 | ''' 57 | def execute(self, jsonParams): 58 | print('execute ') 59 | try: 60 | 61 | res = self.aclass.doCapture(self.aclass, jsonParams); 62 | status = 'true' 63 | except KeyError: 64 | status = 'false' 65 | res = None 66 | 67 | return json.dumps({ 68 | 'status': status, 69 | 'result': res, 70 | }) 71 | 72 | def test(self,jsonParams): 73 | print('this function is test') 74 | -------------------------------------------------------------------------------- /iOS运行Python/Python-3.4.2-iOS-support.b5/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/Python-3.4.2-iOS-support.b5/.DS_Store -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/include/python3.4/pyconfig.h: -------------------------------------------------------------------------------- 1 | #ifdef __arm__ 2 | #include "pyconfig-armv7.h" 3 | #endif 4 | 5 | #ifdef __arm64__ 6 | #include "pyconfig-arm64.h" 7 | #endif 8 | 9 | #ifdef __i386__ 10 | #include "pyconfig-i386.h" 11 | #endif 12 | 13 | #ifdef __x86_64__ 14 | #include "pyconfig-x86_64.h" 15 | #endif -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/bs4/tests/__init__.py: -------------------------------------------------------------------------------- 1 | "The beautifulsoup tests." 2 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/bs4/tests/test_docs.py: -------------------------------------------------------------------------------- 1 | "Test harness for doctests." 2 | 3 | # pylint: disable-msg=E0611,W0142 4 | 5 | __metaclass__ = type 6 | __all__ = [ 7 | 'additional_tests', 8 | ] 9 | 10 | import atexit 11 | import doctest 12 | import os 13 | #from pkg_resources import ( 14 | # resource_filename, resource_exists, resource_listdir, cleanup_resources) 15 | import unittest 16 | 17 | DOCTEST_FLAGS = ( 18 | doctest.ELLIPSIS | 19 | doctest.NORMALIZE_WHITESPACE | 20 | doctest.REPORT_NDIFF) 21 | 22 | 23 | # def additional_tests(): 24 | # "Run the doc tests (README.txt and docs/*, if any exist)" 25 | # doctest_files = [ 26 | # os.path.abspath(resource_filename('bs4', 'README.txt'))] 27 | # if resource_exists('bs4', 'docs'): 28 | # for name in resource_listdir('bs4', 'docs'): 29 | # if name.endswith('.txt'): 30 | # doctest_files.append( 31 | # os.path.abspath( 32 | # resource_filename('bs4', 'docs/%s' % name))) 33 | # kwargs = dict(module_relative=False, optionflags=DOCTEST_FLAGS) 34 | # atexit.register(cleanup_resources) 35 | # return unittest.TestSuite(( 36 | # doctest.DocFileSuite(*doctest_files, **kwargs))) 37 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/bs4/tests/test_htmlparser.py: -------------------------------------------------------------------------------- 1 | """Tests to ensure that the html.parser tree builder generates good 2 | trees.""" 3 | 4 | from pdb import set_trace 5 | import pickle 6 | from bs4.testing import SoupTest, HTMLTreeBuilderSmokeTest 7 | from bs4.builder import HTMLParserTreeBuilder 8 | 9 | class HTMLParserTreeBuilderSmokeTest(SoupTest, HTMLTreeBuilderSmokeTest): 10 | 11 | @property 12 | def default_builder(self): 13 | return HTMLParserTreeBuilder() 14 | 15 | def test_namespaced_system_doctype(self): 16 | # html.parser can't handle namespaced doctypes, so skip this one. 17 | pass 18 | 19 | def test_namespaced_public_doctype(self): 20 | # html.parser can't handle namespaced doctypes, so skip this one. 21 | pass 22 | 23 | def test_builder_is_pickled(self): 24 | """Unlike most tree builders, HTMLParserTreeBuilder and will 25 | be restored after pickling. 26 | """ 27 | tree = self.soup("foo") 28 | dumped = pickle.dumps(tree, 2) 29 | loaded = pickle.loads(dumped) 30 | self.assertTrue(isinstance(loaded.builder, type(tree.builder))) 31 | 32 | 33 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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__ = '2.1.0' 46 | __build__ = 0x020100 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 .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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/certs.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # -*- coding: utf-8 -*- 3 | 4 | """ 5 | certs.py 6 | ~~~~~~~~ 7 | 8 | This module returns the preferred default CA certificate bundle. 9 | 10 | If you are packaging Requests, e.g., for a Linux distribution or a managed 11 | environment, you can change the definition of where() to return a separately 12 | packaged CA bundle. 13 | """ 14 | 15 | import os.path 16 | 17 | 18 | def where(): 19 | """Return the preferred certificate bundle.""" 20 | # vendored bundle inside Requests 21 | return os.path.join(os.path.dirname(__file__), 'cacert.pem') 22 | 23 | if __name__ == '__main__': 24 | print(where()) 25 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/exceptions.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.exceptions 5 | ~~~~~~~~~~~~~~~~~~~ 6 | 7 | This module contains the set of Requests' exceptions. 8 | 9 | """ 10 | 11 | 12 | class RequestException(IOError): 13 | """There was an ambiguous exception that occurred while handling your 14 | request.""" 15 | 16 | 17 | class HTTPError(RequestException): 18 | """An HTTP error occurred.""" 19 | 20 | def __init__(self, *args, **kwargs): 21 | """ Initializes HTTPError with optional `response` object. """ 22 | self.response = kwargs.pop('response', None) 23 | super(HTTPError, self).__init__(*args, **kwargs) 24 | 25 | 26 | class ConnectionError(RequestException): 27 | """A Connection error occurred.""" 28 | 29 | 30 | class ProxyError(ConnectionError): 31 | """A proxy error occurred.""" 32 | 33 | 34 | class SSLError(ConnectionError): 35 | """An SSL error occurred.""" 36 | 37 | 38 | class Timeout(RequestException): 39 | """The request timed out.""" 40 | 41 | 42 | class URLRequired(RequestException): 43 | """A valid URL is required to make a request.""" 44 | 45 | 46 | class TooManyRedirects(RequestException): 47 | """Too many redirects.""" 48 | 49 | 50 | class MissingSchema(RequestException, ValueError): 51 | """The URL schema (e.g. http or https) is missing.""" 52 | 53 | 54 | class InvalidSchema(RequestException, ValueError): 55 | """See defaults.py for valid schemas.""" 56 | 57 | 58 | class InvalidURL(RequestException, ValueError): 59 | """ The URL provided was somehow invalid. """ 60 | 61 | 62 | class ChunkedEncodingError(RequestException): 63 | """The server declared chunked encoding but sent an invalid chunk.""" 64 | 65 | 66 | class ContentDecodingError(RequestException): 67 | """Failed to decode response content""" 68 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/hooks.py: -------------------------------------------------------------------------------- 1 | # -*- coding: utf-8 -*- 2 | 3 | """ 4 | requests.hooks 5 | ~~~~~~~~~~~~~~ 6 | 7 | This module provides the capabilities for the Requests hooks system. 8 | 9 | Available hooks: 10 | 11 | ``response``: 12 | The response generated from a Request. 13 | 14 | """ 15 | 16 | 17 | HOOKS = ['response'] 18 | 19 | 20 | def default_hooks(): 21 | hooks = {} 22 | for event in HOOKS: 23 | hooks[event] = [] 24 | return hooks 25 | 26 | # TODO: response is the only one 27 | 28 | 29 | def dispatch_hook(key, hooks, hook_data, **kwargs): 30 | """Dispatches a hook dictionary on a given piece of data.""" 31 | 32 | hooks = hooks or dict() 33 | 34 | if key in hooks: 35 | hooks = hooks.get(key) 36 | 37 | if hasattr(hooks, '__call__'): 38 | hooks = [hooks] 39 | 40 | for hook in hooks: 41 | _hook_data = hook(hook_data, **kwargs) 42 | if _hook_data is not None: 43 | hook_data = _hook_data 44 | 45 | return hook_data 46 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/README.rst: -------------------------------------------------------------------------------- 1 | If you are planning to submit a pull request to requests with any changes in 2 | this library do not go any further. These are independent libraries which we 3 | vendor into requests. Any changes necessary to these libraries must be made in 4 | them and submitted as separate pull requests to those libraries. 5 | 6 | urllib3 pull requests go here: https://github.com/shazow/urllib3 7 | 8 | chardet pull requests go here: https://github.com/chardet/chardet 9 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import urllib3 4 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/chardet/__init__.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # This library is free software; you can redistribute it and/or 3 | # modify it under the terms of the GNU Lesser General Public 4 | # License as published by the Free Software Foundation; either 5 | # version 2.1 of the License, or (at your option) any later version. 6 | # 7 | # This library is distributed in the hope that it will be useful, 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 10 | # Lesser General Public License for more details. 11 | # 12 | # You should have received a copy of the GNU Lesser General Public 13 | # License along with this library; if not, write to the Free Software 14 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 15 | # 02110-1301 USA 16 | ######################### END LICENSE BLOCK ######################### 17 | 18 | __version__ = "2.2.1" 19 | from sys import version_info 20 | 21 | 22 | def detect(aBuf): 23 | if ((version_info < (3, 0) and isinstance(aBuf, unicode)) or 24 | (version_info >= (3, 0) and not isinstance(aBuf, bytes))): 25 | raise ValueError('Expected a bytes object, not a unicode object') 26 | 27 | from . import universaldetector 28 | u = universaldetector.UniversalDetector() 29 | u.reset() 30 | u.feed(aBuf) 31 | u.close() 32 | return u.result 33 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/chardet/chardetect.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | """ 3 | Script which takes one or more file paths and reports on their detected 4 | encodings 5 | 6 | Example:: 7 | 8 | % chardetect somefile someotherfile 9 | somefile: windows-1252 with confidence 0.5 10 | someotherfile: ascii with confidence 1.0 11 | 12 | If no paths are provided, it takes its input from stdin. 13 | 14 | """ 15 | from io import open 16 | from sys import argv, stdin 17 | 18 | from chardet.universaldetector import UniversalDetector 19 | 20 | 21 | def description_of(file, name='stdin'): 22 | """Return a string describing the probable encoding of a file.""" 23 | u = UniversalDetector() 24 | for line in file: 25 | u.feed(line) 26 | u.close() 27 | result = u.result 28 | if result['encoding']: 29 | return '%s: %s with confidence %s' % (name, 30 | result['encoding'], 31 | result['confidence']) 32 | else: 33 | return '%s: no result' % name 34 | 35 | 36 | def main(): 37 | if len(argv) <= 1: 38 | print(description_of(stdin)) 39 | else: 40 | for path in argv[1:]: 41 | with open(path, 'rb') as f: 42 | print(description_of(f, path)) 43 | 44 | 45 | if __name__ == '__main__': 46 | main() 47 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/chardet/compat.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # Contributor(s): 3 | # Ian Cordasco - port to Python 4 | # 5 | # This library is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU Lesser General Public 7 | # License as published by the Free Software Foundation; either 8 | # version 2.1 of the License, or (at your option) any later version. 9 | # 10 | # This library 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 GNU 13 | # Lesser General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU Lesser General Public 16 | # License along with this library; if not, write to the Free Software 17 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 18 | # 02110-1301 USA 19 | ######################### END LICENSE BLOCK ######################### 20 | 21 | import sys 22 | 23 | 24 | if sys.version_info < (3, 0): 25 | base_str = (str, unicode) 26 | else: 27 | base_str = (bytes, str) 28 | 29 | 30 | def wrap_ord(a): 31 | if sys.version_info < (3, 0) and isinstance(a, base_str): 32 | return ord(a) 33 | else: 34 | return a 35 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/chardet/constants.py: -------------------------------------------------------------------------------- 1 | ######################## BEGIN LICENSE BLOCK ######################## 2 | # The Original Code is Mozilla Universal charset detector code. 3 | # 4 | # The Initial Developer of the Original Code is 5 | # Netscape Communications Corporation. 6 | # Portions created by the Initial Developer are Copyright (C) 2001 7 | # the Initial Developer. All Rights Reserved. 8 | # 9 | # Contributor(s): 10 | # Mark Pilgrim - port to Python 11 | # Shy Shalom - original C code 12 | # 13 | # This library is free software; you can redistribute it and/or 14 | # modify it under the terms of the GNU Lesser General Public 15 | # License as published by the Free Software Foundation; either 16 | # version 2.1 of the License, or (at your option) any later version. 17 | # 18 | # This library is distributed in the hope that it will be useful, 19 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 | # Lesser General Public License for more details. 22 | # 23 | # You should have received a copy of the GNU Lesser General Public 24 | # License along with this library; if not, write to the Free Software 25 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 26 | # 02110-1301 USA 27 | ######################### END LICENSE BLOCK ######################### 28 | 29 | _debug = 0 30 | 31 | eDetecting = 0 32 | eFoundIt = 1 33 | eNotMe = 2 34 | 35 | eStart = 0 36 | eError = 1 37 | eItsMe = 2 38 | 39 | SHORTCUT_THRESHOLD = 0.95 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/requests/packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3.2+ 3 | from ssl import CertificateError, match_hostname 4 | except ImportError: 5 | try: 6 | # Backport of the function from a pypi module 7 | from backports.ssl_match_hostname import CertificateError, match_hostname 8 | except ImportError: 9 | # Our vendored copy 10 | from _implementation import CertificateError, match_hostname 11 | 12 | # Not needed, but documenting what we provide. 13 | __all__ = ('CertificateError', 'match_hostname') 14 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-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 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/urllib3/contrib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/urllib3/contrib/__init__.py -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/urllib3/packages/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | from . import ssl_match_hostname 4 | 5 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python3.4/site-packages/urllib3/packages/ssl_match_hostname/__init__.py: -------------------------------------------------------------------------------- 1 | try: 2 | # Python 3.2+ 3 | from ssl import CertificateError, match_hostname 4 | except ImportError: 5 | try: 6 | # Backport of the function from a pypi module 7 | from backports.ssl_match_hostname import CertificateError, match_hostname 8 | except ImportError: 9 | # Our vendored copy 10 | from _implementation import CertificateError, match_hostname 11 | 12 | # Not needed, but documenting what we provide. 13 | __all__ = ('CertificateError', 'match_hostname') 14 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34.zip -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/__phello__.foo.py: -------------------------------------------------------------------------------- 1 | # This file exists as a helper for the test.test_frozen module. 2 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/_bootlocale.py: -------------------------------------------------------------------------------- 1 | """A minimal subset of the locale module used at interpreter startup 2 | (imported by the _io module), in order to reduce startup time. 3 | 4 | Don't import directly from third-party code; use the `locale` module instead! 5 | """ 6 | 7 | import sys 8 | import _locale 9 | 10 | if sys.platform.startswith("win"): 11 | def getpreferredencoding(do_setlocale=True): 12 | return _locale._getdefaultlocale()[1] 13 | else: 14 | try: 15 | _locale.CODESET 16 | except AttributeError: 17 | def getpreferredencoding(do_setlocale=True): 18 | # This path for legacy systems needs the more complex 19 | # getdefaultlocale() function, import the full locale module. 20 | import locale 21 | return locale.getpreferredencoding(do_setlocale) 22 | else: 23 | def getpreferredencoding(do_setlocale=True): 24 | assert not do_setlocale 25 | result = _locale.nl_langinfo(_locale.CODESET) 26 | if not result and sys.platform == 'darwin': 27 | # nl_langinfo can return an empty string 28 | # when the setting has an invalid value. 29 | # Default to UTF-8 in that case because 30 | # UTF-8 is the default charset on OSX and 31 | # returning nothing will crash the 32 | # interpreter. 33 | result = 'UTF-8' 34 | return result 35 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/antigravity.py: -------------------------------------------------------------------------------- 1 | 2 | import webbrowser 3 | import hashlib 4 | 5 | webbrowser.open("http://xkcd.com/353/") 6 | 7 | def geohash(latitude, longitude, datedow): 8 | '''Compute geohash() using the Munroe algorithm. 9 | 10 | >>> geohash(37.421542, -122.085589, b'2005-05-26-10458.68') 11 | 37.857713 -122.544543 12 | 13 | ''' 14 | # http://xkcd.com/426/ 15 | h = hashlib.md5(datedow).hexdigest() 16 | p, q = [('%f' % float.fromhex('0.' + x)) for x in (h[:16], h[16:32])] 17 | print('%d%s %d%s' % (latitude, p[1:], longitude, q[1:])) 18 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/asyncio/__init__.py: -------------------------------------------------------------------------------- 1 | """The asyncio package, tracking PEP 3156.""" 2 | 3 | import sys 4 | 5 | # The selectors module is in the stdlib in Python 3.4 but not in 3.3. 6 | # Do this first, so the other submodules can use "from . import selectors". 7 | # Prefer asyncio/selectors.py over the stdlib one, as ours may be newer. 8 | try: 9 | from . import selectors 10 | except ImportError: 11 | import selectors # Will also be exported. 12 | 13 | if sys.platform == 'win32': 14 | # Similar thing for _overlapped. 15 | try: 16 | from . import _overlapped 17 | except ImportError: 18 | import _overlapped # Will also be exported. 19 | 20 | # This relies on each of the submodules having an __all__ variable. 21 | from .coroutines import * 22 | from .events import * 23 | from .futures import * 24 | from .locks import * 25 | from .protocols import * 26 | from .queues import * 27 | from .streams import * 28 | from .subprocess import * 29 | from .tasks import * 30 | from .transports import * 31 | 32 | __all__ = (coroutines.__all__ + 33 | events.__all__ + 34 | futures.__all__ + 35 | locks.__all__ + 36 | protocols.__all__ + 37 | queues.__all__ + 38 | streams.__all__ + 39 | subprocess.__all__ + 40 | tasks.__all__ + 41 | transports.__all__) 42 | 43 | if sys.platform == 'win32': # pragma: no cover 44 | from .windows_events import * 45 | __all__ += windows_events.__all__ 46 | else: 47 | from .unix_events import * # pragma: no cover 48 | __all__ += unix_events.__all__ 49 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/asyncio/constants.py: -------------------------------------------------------------------------------- 1 | """Constants.""" 2 | 3 | # After the connection is lost, log warnings after this many write()s. 4 | LOG_THRESHOLD_FOR_CONNLOST_WRITES = 5 5 | 6 | # Seconds to wait before retrying accept(). 7 | ACCEPT_RETRY_DELAY = 1 8 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/asyncio/log.py: -------------------------------------------------------------------------------- 1 | """Logging configuration.""" 2 | 3 | import logging 4 | 5 | 6 | # Name the logger after the package. 7 | logger = logging.getLogger(__package__) 8 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/collections/__main__.py: -------------------------------------------------------------------------------- 1 | ################################################################################ 2 | ### Simple tests 3 | ################################################################################ 4 | 5 | # verify that instances can be pickled 6 | from collections import namedtuple 7 | from pickle import loads, dumps 8 | Point = namedtuple('Point', 'x, y', True) 9 | p = Point(x=10, y=20) 10 | assert p == loads(dumps(p)) 11 | 12 | # test and demonstrate ability to override methods 13 | class Point(namedtuple('Point', 'x y')): 14 | __slots__ = () 15 | @property 16 | def hypot(self): 17 | return (self.x ** 2 + self.y ** 2) ** 0.5 18 | def __str__(self): 19 | return 'Point: x=%6.3f y=%6.3f hypot=%6.3f' % (self.x, self.y, self.hypot) 20 | 21 | for p in Point(3, 4), Point(14, 5/7.): 22 | print (p) 23 | 24 | class Point(namedtuple('Point', 'x y')): 25 | 'Point class with optimized _make() and _replace() without error-checking' 26 | __slots__ = () 27 | _make = classmethod(tuple.__new__) 28 | def _replace(self, _map=map, **kwds): 29 | return self._make(_map(kwds.get, ('x', 'y'), self)) 30 | 31 | print(Point(11, 22)._replace(x=100)) 32 | 33 | Point3D = namedtuple('Point3D', Point._fields + ('z',)) 34 | print(Point3D.__doc__) 35 | 36 | import doctest, collections 37 | TestResults = namedtuple('TestResults', 'failed attempted') 38 | print(TestResults(*doctest.testmod(collections))) 39 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/collections/abc.py: -------------------------------------------------------------------------------- 1 | from _collections_abc import * 2 | from _collections_abc import __all__ 3 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/concurrent/__init__.py: -------------------------------------------------------------------------------- 1 | # This directory is a Python package. 2 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/concurrent/futures/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright 2009 Brian Quinlan. All Rights Reserved. 2 | # Licensed to PSF under a Contributor Agreement. 3 | 4 | """Execute computations asynchronously using threads or processes.""" 5 | 6 | __author__ = 'Brian Quinlan (brian@sweetapp.com)' 7 | 8 | from concurrent.futures._base import (FIRST_COMPLETED, 9 | FIRST_EXCEPTION, 10 | ALL_COMPLETED, 11 | CancelledError, 12 | TimeoutError, 13 | Future, 14 | Executor, 15 | wait, 16 | as_completed) 17 | from concurrent.futures.process import ProcessPoolExecutor 18 | from concurrent.futures.thread import ThreadPoolExecutor 19 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/crypt.py: -------------------------------------------------------------------------------- 1 | """Wrapper to the POSIX crypt library call and associated functionality.""" 2 | 3 | import _crypt 4 | import string as _string 5 | from random import SystemRandom as _SystemRandom 6 | from collections import namedtuple as _namedtuple 7 | 8 | 9 | _saltchars = _string.ascii_letters + _string.digits + './' 10 | _sr = _SystemRandom() 11 | 12 | 13 | class _Method(_namedtuple('_Method', 'name ident salt_chars total_size')): 14 | 15 | """Class representing a salt method per the Modular Crypt Format or the 16 | legacy 2-character crypt method.""" 17 | 18 | def __repr__(self): 19 | return ''.format(self.name) 20 | 21 | 22 | def mksalt(method=None): 23 | """Generate a salt for the specified method. 24 | 25 | If not specified, the strongest available method will be used. 26 | 27 | """ 28 | if method is None: 29 | method = methods[0] 30 | s = '${}$'.format(method.ident) if method.ident else '' 31 | s += ''.join(_sr.choice(_saltchars) for char in range(method.salt_chars)) 32 | return s 33 | 34 | 35 | def crypt(word, salt=None): 36 | """Return a string representing the one-way hash of a password, with a salt 37 | prepended. 38 | 39 | If ``salt`` is not specified or is ``None``, the strongest 40 | available method will be selected and a salt generated. Otherwise, 41 | ``salt`` may be one of the ``crypt.METHOD_*`` values, or a string as 42 | returned by ``crypt.mksalt()``. 43 | 44 | """ 45 | if salt is None or isinstance(salt, _Method): 46 | salt = mksalt(salt) 47 | return _crypt.crypt(word, salt) 48 | 49 | 50 | # available salting/crypto methods 51 | METHOD_CRYPT = _Method('CRYPT', None, 2, 13) 52 | METHOD_MD5 = _Method('MD5', '1', 8, 34) 53 | METHOD_SHA256 = _Method('SHA256', '5', 16, 63) 54 | METHOD_SHA512 = _Method('SHA512', '6', 16, 106) 55 | 56 | methods = [] 57 | for _method in (METHOD_SHA512, METHOD_SHA256, METHOD_MD5): 58 | _result = crypt('', _method) 59 | if _result and len(_result) == _method.total_size: 60 | methods.append(_method) 61 | methods.append(METHOD_CRYPT) 62 | del _result, _method 63 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/ctypes/_endian.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from ctypes import * 3 | 4 | _array_type = type(Array) 5 | 6 | def _other_endian(typ): 7 | """Return the type with the 'other' byte order. Simple types like 8 | c_int and so on already have __ctype_be__ and __ctype_le__ 9 | attributes which contain the types, for more complicated types 10 | arrays and structures are supported. 11 | """ 12 | # check _OTHER_ENDIAN attribute (present if typ is primitive type) 13 | if hasattr(typ, _OTHER_ENDIAN): 14 | return getattr(typ, _OTHER_ENDIAN) 15 | # if typ is array 16 | if isinstance(typ, _array_type): 17 | return _other_endian(typ._type_) * typ._length_ 18 | # if typ is structure 19 | if issubclass(typ, Structure): 20 | return typ 21 | raise TypeError("This type does not support other endian: %s" % typ) 22 | 23 | class _swapped_meta(type(Structure)): 24 | def __setattr__(self, attrname, value): 25 | if attrname == "_fields_": 26 | fields = [] 27 | for desc in value: 28 | name = desc[0] 29 | typ = desc[1] 30 | rest = desc[2:] 31 | fields.append((name, _other_endian(typ)) + rest) 32 | value = fields 33 | super().__setattr__(attrname, value) 34 | 35 | ################################################################ 36 | 37 | # Note: The Structure metaclass checks for the *presence* (not the 38 | # value!) of a _swapped_bytes_ attribute to determine the bit order in 39 | # structures containing bit fields. 40 | 41 | if sys.byteorder == "little": 42 | _OTHER_ENDIAN = "__ctype_be__" 43 | 44 | LittleEndianStructure = Structure 45 | 46 | class BigEndianStructure(Structure, metaclass=_swapped_meta): 47 | """Structure with big endian byte order""" 48 | _swappedbytes_ = None 49 | 50 | elif sys.byteorder == "big": 51 | _OTHER_ENDIAN = "__ctype_le__" 52 | 53 | BigEndianStructure = Structure 54 | class LittleEndianStructure(Structure, metaclass=_swapped_meta): 55 | """Structure with little endian byte order""" 56 | _swappedbytes_ = None 57 | 58 | else: 59 | raise RuntimeError("Invalid byteorder") 60 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/ctypes/macholib/README.ctypes: -------------------------------------------------------------------------------- 1 | Files in this directory from from Bob Ippolito's py2app. 2 | 3 | License: Any components of the py2app suite may be distributed under 4 | the MIT or PSF open source licenses. 5 | 6 | This is version 1.0, SVN revision 789, from 2006/01/25. 7 | The main repository is http://svn.red-bean.com/bob/macholib/trunk/macholib/ -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/ctypes/macholib/__init__.py: -------------------------------------------------------------------------------- 1 | """ 2 | Enough Mach-O to make your head spin. 3 | 4 | See the relevant header files in /usr/include/mach-o 5 | 6 | And also Apple's documentation. 7 | """ 8 | 9 | __version__ = '1.0' 10 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/ctypes/macholib/dylib.py: -------------------------------------------------------------------------------- 1 | """ 2 | Generic dylib path manipulation 3 | """ 4 | 5 | import re 6 | 7 | __all__ = ['dylib_info'] 8 | 9 | DYLIB_RE = re.compile(r"""(?x) 10 | (?P^.*)(?:^|/) 11 | (?P 12 | (?P\w+?) 13 | (?:\.(?P[^._]+))? 14 | (?:_(?P[^._]+))? 15 | \.dylib$ 16 | ) 17 | """) 18 | 19 | def dylib_info(filename): 20 | """ 21 | A dylib name can take one of the following four forms: 22 | Location/Name.SomeVersion_Suffix.dylib 23 | Location/Name.SomeVersion.dylib 24 | Location/Name_Suffix.dylib 25 | Location/Name.dylib 26 | 27 | returns None if not found or a mapping equivalent to: 28 | dict( 29 | location='Location', 30 | name='Name.SomeVersion_Suffix.dylib', 31 | shortname='Name', 32 | version='SomeVersion', 33 | suffix='Suffix', 34 | ) 35 | 36 | Note that SomeVersion and Suffix are optional and may be None 37 | if not present. 38 | """ 39 | is_dylib = DYLIB_RE.match(filename) 40 | if not is_dylib: 41 | return None 42 | return is_dylib.groupdict() 43 | 44 | 45 | def test_dylib_info(): 46 | def d(location=None, name=None, shortname=None, version=None, suffix=None): 47 | return dict( 48 | location=location, 49 | name=name, 50 | shortname=shortname, 51 | version=version, 52 | suffix=suffix 53 | ) 54 | assert dylib_info('completely/invalid') is None 55 | assert dylib_info('completely/invalide_debug') is None 56 | assert dylib_info('P/Foo.dylib') == d('P', 'Foo.dylib', 'Foo') 57 | assert dylib_info('P/Foo_debug.dylib') == d('P', 'Foo_debug.dylib', 'Foo', suffix='debug') 58 | assert dylib_info('P/Foo.A.dylib') == d('P', 'Foo.A.dylib', 'Foo', 'A') 59 | assert dylib_info('P/Foo_debug.A.dylib') == d('P', 'Foo_debug.A.dylib', 'Foo_debug', 'A') 60 | assert dylib_info('P/Foo.A_debug.dylib') == d('P', 'Foo.A_debug.dylib', 'Foo', 'A', 'debug') 61 | 62 | if __name__ == '__main__': 63 | test_dylib_info() 64 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/ctypes/macholib/fetch_macholib: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . 3 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/ctypes/macholib/fetch_macholib.bat: -------------------------------------------------------------------------------- 1 | svn export --force http://svn.red-bean.com/bob/macholib/trunk/macholib/ . 2 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/ctypes/macholib/framework.py: -------------------------------------------------------------------------------- 1 | """ 2 | Generic framework path manipulation 3 | """ 4 | 5 | import re 6 | 7 | __all__ = ['framework_info'] 8 | 9 | STRICT_FRAMEWORK_RE = re.compile(r"""(?x) 10 | (?P^.*)(?:^|/) 11 | (?P 12 | (?P\w+).framework/ 13 | (?:Versions/(?P[^/]+)/)? 14 | (?P=shortname) 15 | (?:_(?P[^_]+))? 16 | )$ 17 | """) 18 | 19 | def framework_info(filename): 20 | """ 21 | A framework name can take one of the following four forms: 22 | Location/Name.framework/Versions/SomeVersion/Name_Suffix 23 | Location/Name.framework/Versions/SomeVersion/Name 24 | Location/Name.framework/Name_Suffix 25 | Location/Name.framework/Name 26 | 27 | returns None if not found, or a mapping equivalent to: 28 | dict( 29 | location='Location', 30 | name='Name.framework/Versions/SomeVersion/Name_Suffix', 31 | shortname='Name', 32 | version='SomeVersion', 33 | suffix='Suffix', 34 | ) 35 | 36 | Note that SomeVersion and Suffix are optional and may be None 37 | if not present 38 | """ 39 | is_framework = STRICT_FRAMEWORK_RE.match(filename) 40 | if not is_framework: 41 | return None 42 | return is_framework.groupdict() 43 | 44 | def test_framework_info(): 45 | def d(location=None, name=None, shortname=None, version=None, suffix=None): 46 | return dict( 47 | location=location, 48 | name=name, 49 | shortname=shortname, 50 | version=version, 51 | suffix=suffix 52 | ) 53 | assert framework_info('completely/invalid') is None 54 | assert framework_info('completely/invalid/_debug') is None 55 | assert framework_info('P/F.framework') is None 56 | assert framework_info('P/F.framework/_debug') is None 57 | assert framework_info('P/F.framework/F') == d('P', 'F.framework/F', 'F') 58 | assert framework_info('P/F.framework/F_debug') == d('P', 'F.framework/F_debug', 'F', suffix='debug') 59 | assert framework_info('P/F.framework/Versions') is None 60 | assert framework_info('P/F.framework/Versions/A') is None 61 | assert framework_info('P/F.framework/Versions/A/F') == d('P', 'F.framework/Versions/A/F', 'F', 'A') 62 | assert framework_info('P/F.framework/Versions/A/F_debug') == d('P', 'F.framework/Versions/A/F_debug', 'F', 'A', 'debug') 63 | 64 | if __name__ == '__main__': 65 | test_framework_info() 66 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/dbm/gnu.py: -------------------------------------------------------------------------------- 1 | """Provide the _gdbm module as a dbm submodule.""" 2 | 3 | from _gdbm import * 4 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/dbm/ndbm.py: -------------------------------------------------------------------------------- 1 | """Provide the _dbm module as a dbm submodule.""" 2 | 3 | from _dbm import * 4 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/README: -------------------------------------------------------------------------------- 1 | This directory contains the Distutils package. 2 | 3 | There's a full documentation available at: 4 | 5 | http://docs.python.org/distutils/ 6 | 7 | The Distutils-SIG web page is also a good starting point: 8 | 9 | http://www.python.org/sigs/distutils-sig/ 10 | 11 | WARNING : Distutils must remain compatible with 2.3 12 | 13 | $Id$ 14 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/__init__.py: -------------------------------------------------------------------------------- 1 | """distutils 2 | 3 | The main package for the Python Module Distribution Utilities. Normally 4 | used from a setup script as 5 | 6 | from distutils.core import setup 7 | 8 | setup (...) 9 | """ 10 | 11 | # Distutils version 12 | # 13 | # Updated automatically by the Python release process. 14 | # 15 | #--start constants-- 16 | __version__ = "3.4.2" 17 | #--end constants-- 18 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/__init__.py: -------------------------------------------------------------------------------- 1 | """distutils.command 2 | 3 | Package containing implementation of all the standard Distutils 4 | commands.""" 5 | 6 | __all__ = ['build', 7 | 'build_py', 8 | 'build_ext', 9 | 'build_clib', 10 | 'build_scripts', 11 | 'clean', 12 | 'install', 13 | 'install_lib', 14 | 'install_headers', 15 | 'install_scripts', 16 | 'install_data', 17 | 'sdist', 18 | 'register', 19 | 'bdist', 20 | 'bdist_dumb', 21 | 'bdist_rpm', 22 | 'bdist_wininst', 23 | 'check', 24 | 'upload', 25 | # These two are reserved for future use: 26 | #'bdist_sdux', 27 | #'bdist_pkgtool', 28 | # Note: 29 | # bdist_packager is not included because it only provides 30 | # an abstract base class 31 | ] 32 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/command_template: -------------------------------------------------------------------------------- 1 | """distutils.command.x 2 | 3 | Implements the Distutils 'x' command. 4 | """ 5 | 6 | # created 2000/mm/dd, John Doe 7 | 8 | __revision__ = "$Id$" 9 | 10 | from distutils.core import Command 11 | 12 | 13 | class x(Command): 14 | 15 | # Brief (40-50 characters) description of the command 16 | description = "" 17 | 18 | # List of option tuples: long name, short name (None if no short 19 | # name), and help string. 20 | user_options = [('', '', 21 | ""), 22 | ] 23 | 24 | def initialize_options(self): 25 | self. = None 26 | self. = None 27 | self. = None 28 | 29 | def finalize_options(self): 30 | if self.x is None: 31 | self.x = 32 | 33 | def run(self): 34 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/install_headers.py: -------------------------------------------------------------------------------- 1 | """distutils.command.install_headers 2 | 3 | Implements the Distutils 'install_headers' command, to install C/C++ header 4 | files to the Python include directory.""" 5 | 6 | from distutils.core import Command 7 | 8 | 9 | # XXX force is never used 10 | class install_headers(Command): 11 | 12 | description = "install C/C++ header files" 13 | 14 | user_options = [('install-dir=', 'd', 15 | "directory to install header files to"), 16 | ('force', 'f', 17 | "force installation (overwrite existing files)"), 18 | ] 19 | 20 | boolean_options = ['force'] 21 | 22 | def initialize_options(self): 23 | self.install_dir = None 24 | self.force = 0 25 | self.outfiles = [] 26 | 27 | def finalize_options(self): 28 | self.set_undefined_options('install', 29 | ('install_headers', 'install_dir'), 30 | ('force', 'force')) 31 | 32 | 33 | def run(self): 34 | headers = self.distribution.headers 35 | if not headers: 36 | return 37 | 38 | self.mkpath(self.install_dir) 39 | for header in headers: 40 | (out, _) = self.copy_file(header, self.install_dir) 41 | self.outfiles.append(out) 42 | 43 | def get_inputs(self): 44 | return self.distribution.headers or [] 45 | 46 | def get_outputs(self): 47 | return self.outfiles 48 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/install_scripts.py: -------------------------------------------------------------------------------- 1 | """distutils.command.install_scripts 2 | 3 | Implements the Distutils 'install_scripts' command, for installing 4 | Python scripts.""" 5 | 6 | # contributed by Bastian Kleineidam 7 | 8 | import os 9 | from distutils.core import Command 10 | from distutils import log 11 | from stat import ST_MODE 12 | 13 | 14 | class install_scripts(Command): 15 | 16 | description = "install scripts (Python or otherwise)" 17 | 18 | user_options = [ 19 | ('install-dir=', 'd', "directory to install scripts to"), 20 | ('build-dir=','b', "build directory (where to install from)"), 21 | ('force', 'f', "force installation (overwrite existing files)"), 22 | ('skip-build', None, "skip the build steps"), 23 | ] 24 | 25 | boolean_options = ['force', 'skip-build'] 26 | 27 | def initialize_options(self): 28 | self.install_dir = None 29 | self.force = 0 30 | self.build_dir = None 31 | self.skip_build = None 32 | 33 | def finalize_options(self): 34 | self.set_undefined_options('build', ('build_scripts', 'build_dir')) 35 | self.set_undefined_options('install', 36 | ('install_scripts', 'install_dir'), 37 | ('force', 'force'), 38 | ('skip_build', 'skip_build'), 39 | ) 40 | 41 | def run(self): 42 | if not self.skip_build: 43 | self.run_command('build_scripts') 44 | self.outfiles = self.copy_tree(self.build_dir, self.install_dir) 45 | if os.name == 'posix': 46 | # Set the executable bits (owner, group, and world) on 47 | # all the scripts we just installed. 48 | for file in self.get_outputs(): 49 | if self.dry_run: 50 | log.info("changing mode of %s", file) 51 | else: 52 | mode = ((os.stat(file)[ST_MODE]) | 0o555) & 0o7777 53 | log.info("changing mode of %s to %o", file, mode) 54 | os.chmod(file, mode) 55 | 56 | def get_inputs(self): 57 | return self.distribution.scripts or [] 58 | 59 | def get_outputs(self): 60 | return self.outfiles or [] 61 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-10.0-amd64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-10.0-amd64.exe -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-10.0.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-10.0.exe -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-6.0.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-6.0.exe -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-7.1.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-7.1.exe -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-8.0.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-8.0.exe -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-9.0-amd64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-9.0-amd64.exe -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-9.0.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/command/wininst-9.0.exe -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/debug.py: -------------------------------------------------------------------------------- 1 | import os 2 | 3 | # If DISTUTILS_DEBUG is anything other than the empty string, we run in 4 | # debug mode. 5 | DEBUG = os.environ.get('DISTUTILS_DEBUG') 6 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/distutils/log.py: -------------------------------------------------------------------------------- 1 | """A simple log mechanism styled after PEP 282.""" 2 | 3 | # The class here is styled after PEP 282 so that it could later be 4 | # replaced with a standard Python logging implementation. 5 | 6 | DEBUG = 1 7 | INFO = 2 8 | WARN = 3 9 | ERROR = 4 10 | FATAL = 5 11 | 12 | import sys 13 | 14 | class Log: 15 | 16 | def __init__(self, threshold=WARN): 17 | self.threshold = threshold 18 | 19 | def _log(self, level, msg, args): 20 | if level not in (DEBUG, INFO, WARN, ERROR, FATAL): 21 | raise ValueError('%s wrong log level' % str(level)) 22 | 23 | if level >= self.threshold: 24 | if args: 25 | msg = msg % args 26 | if level in (WARN, ERROR, FATAL): 27 | stream = sys.stderr 28 | else: 29 | stream = sys.stdout 30 | if stream.errors == 'strict': 31 | # emulate backslashreplace error handler 32 | encoding = stream.encoding 33 | msg = msg.encode(encoding, "backslashreplace").decode(encoding) 34 | stream.write('%s\n' % msg) 35 | stream.flush() 36 | 37 | def log(self, level, msg, *args): 38 | self._log(level, msg, args) 39 | 40 | def debug(self, msg, *args): 41 | self._log(DEBUG, msg, args) 42 | 43 | def info(self, msg, *args): 44 | self._log(INFO, msg, args) 45 | 46 | def warn(self, msg, *args): 47 | self._log(WARN, msg, args) 48 | 49 | def error(self, msg, *args): 50 | self._log(ERROR, msg, args) 51 | 52 | def fatal(self, msg, *args): 53 | self._log(FATAL, msg, args) 54 | 55 | _global_log = Log() 56 | log = _global_log.log 57 | debug = _global_log.debug 58 | info = _global_log.info 59 | warn = _global_log.warn 60 | error = _global_log.error 61 | fatal = _global_log.fatal 62 | 63 | def set_threshold(level): 64 | # return the old threshold for use from tests 65 | old = _global_log.threshold 66 | _global_log.threshold = level 67 | return old 68 | 69 | def set_verbosity(v): 70 | if v <= 0: 71 | set_threshold(WARN) 72 | elif v == 1: 73 | set_threshold(INFO) 74 | elif v >= 2: 75 | set_threshold(DEBUG) 76 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/__init__.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2007 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """A package for parsing, handling, and generating email messages.""" 6 | 7 | __version__ = '5.1.0' 8 | 9 | __all__ = [ 10 | 'base64mime', 11 | 'charset', 12 | 'encoders', 13 | 'errors', 14 | 'feedparser', 15 | 'generator', 16 | 'header', 17 | 'iterators', 18 | 'message', 19 | 'message_from_file', 20 | 'message_from_binary_file', 21 | 'message_from_string', 22 | 'message_from_bytes', 23 | 'mime', 24 | 'parser', 25 | 'quoprimime', 26 | 'utils', 27 | ] 28 | 29 | 30 | 31 | # Some convenience routines. Don't import Parser and Message as side-effects 32 | # of importing email since those cascadingly import most of the rest of the 33 | # email package. 34 | def message_from_string(s, *args, **kws): 35 | """Parse a string into a Message object model. 36 | 37 | Optional _class and strict are passed to the Parser constructor. 38 | """ 39 | from email.parser import Parser 40 | return Parser(*args, **kws).parsestr(s) 41 | 42 | def message_from_bytes(s, *args, **kws): 43 | """Parse a bytes string into a Message object model. 44 | 45 | Optional _class and strict are passed to the Parser constructor. 46 | """ 47 | from email.parser import BytesParser 48 | return BytesParser(*args, **kws).parsebytes(s) 49 | 50 | def message_from_file(fp, *args, **kws): 51 | """Read a file and parse its contents into a Message object model. 52 | 53 | Optional _class and strict are passed to the Parser constructor. 54 | """ 55 | from email.parser import Parser 56 | return Parser(*args, **kws).parse(fp) 57 | 58 | def message_from_binary_file(fp, *args, **kws): 59 | """Read a binary file and parse its contents into a Message object model. 60 | 61 | Optional _class and strict are passed to the Parser constructor. 62 | """ 63 | from email.parser import BytesParser 64 | return BytesParser(*args, **kws).parse(fp) 65 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/encoders.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Encodings and related functions.""" 6 | 7 | __all__ = [ 8 | 'encode_7or8bit', 9 | 'encode_base64', 10 | 'encode_noop', 11 | 'encode_quopri', 12 | ] 13 | 14 | 15 | from base64 import encodebytes as _bencode 16 | from quopri import encodestring as _encodestring 17 | 18 | 19 | 20 | def _qencode(s): 21 | enc = _encodestring(s, quotetabs=True) 22 | # Must encode spaces, which quopri.encodestring() doesn't do 23 | return enc.replace(b' ', b'=20') 24 | 25 | 26 | def encode_base64(msg): 27 | """Encode the message's payload in Base64. 28 | 29 | Also, add an appropriate Content-Transfer-Encoding header. 30 | """ 31 | orig = msg.get_payload(decode=True) 32 | encdata = str(_bencode(orig), 'ascii') 33 | msg.set_payload(encdata) 34 | msg['Content-Transfer-Encoding'] = 'base64' 35 | 36 | 37 | 38 | def encode_quopri(msg): 39 | """Encode the message's payload in quoted-printable. 40 | 41 | Also, add an appropriate Content-Transfer-Encoding header. 42 | """ 43 | orig = msg.get_payload(decode=True) 44 | encdata = _qencode(orig) 45 | msg.set_payload(encdata) 46 | msg['Content-Transfer-Encoding'] = 'quoted-printable' 47 | 48 | 49 | 50 | def encode_7or8bit(msg): 51 | """Set the Content-Transfer-Encoding header to 7bit or 8bit.""" 52 | orig = msg.get_payload(decode=True) 53 | if orig is None: 54 | # There's no payload. For backwards compatibility we use 7bit 55 | msg['Content-Transfer-Encoding'] = '7bit' 56 | return 57 | # We play a trick to make this go fast. If decoding from ASCII succeeds, 58 | # we know the data must be 7bit, otherwise treat it as 8bit. 59 | try: 60 | orig.decode('ascii') 61 | except UnicodeError: 62 | msg['Content-Transfer-Encoding'] = '8bit' 63 | else: 64 | msg['Content-Transfer-Encoding'] = '7bit' 65 | 66 | 67 | 68 | def encode_noop(msg): 69 | """Do nothing.""" 70 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/iterators.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Various types of useful iterators and generators.""" 6 | 7 | __all__ = [ 8 | 'body_line_iterator', 9 | 'typed_subpart_iterator', 10 | 'walk', 11 | # Do not include _structure() since it's part of the debugging API. 12 | ] 13 | 14 | import sys 15 | from io import StringIO 16 | 17 | 18 | 19 | # This function will become a method of the Message class 20 | def walk(self): 21 | """Walk over the message tree, yielding each subpart. 22 | 23 | The walk is performed in depth-first order. This method is a 24 | generator. 25 | """ 26 | yield self 27 | if self.is_multipart(): 28 | for subpart in self.get_payload(): 29 | yield from subpart.walk() 30 | 31 | 32 | 33 | # These two functions are imported into the Iterators.py interface module. 34 | def body_line_iterator(msg, decode=False): 35 | """Iterate over the parts, returning string payloads line-by-line. 36 | 37 | Optional decode (default False) is passed through to .get_payload(). 38 | """ 39 | for subpart in msg.walk(): 40 | payload = subpart.get_payload(decode=decode) 41 | if isinstance(payload, str): 42 | yield from StringIO(payload) 43 | 44 | 45 | def typed_subpart_iterator(msg, maintype='text', subtype=None): 46 | """Iterate over the subparts with a given MIME type. 47 | 48 | Use `maintype' as the main MIME type to match against; this defaults to 49 | "text". Optional `subtype' is the MIME subtype to match against; if 50 | omitted, only the main type is matched. 51 | """ 52 | for subpart in msg.walk(): 53 | if subpart.get_content_maintype() == maintype: 54 | if subtype is None or subpart.get_content_subtype() == subtype: 55 | yield subpart 56 | 57 | 58 | 59 | def _structure(msg, fp=None, level=0, include_default=False): 60 | """A handy debugging aid""" 61 | if fp is None: 62 | fp = sys.stdout 63 | tab = ' ' * (level * 4) 64 | print(tab + msg.get_content_type(), end='', file=fp) 65 | if include_default: 66 | print(' [%s]' % msg.get_default_type(), file=fp) 67 | else: 68 | print(file=fp) 69 | if msg.is_multipart(): 70 | for subpart in msg.get_payload(): 71 | _structure(subpart, fp, level+1, include_default) 72 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/__init__.py -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/application.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Keith Dart 3 | # Contact: email-sig@python.org 4 | 5 | """Class representing application/* type MIME documents.""" 6 | 7 | __all__ = ["MIMEApplication"] 8 | 9 | from email import encoders 10 | from email.mime.nonmultipart import MIMENonMultipart 11 | 12 | 13 | class MIMEApplication(MIMENonMultipart): 14 | """Class for generating application/* MIME documents.""" 15 | 16 | def __init__(self, _data, _subtype='octet-stream', 17 | _encoder=encoders.encode_base64, **_params): 18 | """Create an application/* type MIME document. 19 | 20 | _data is a string containing the raw application data. 21 | 22 | _subtype is the MIME content type subtype, defaulting to 23 | 'octet-stream'. 24 | 25 | _encoder is a function which will perform the actual encoding for 26 | transport of the application data, defaulting to base64 encoding. 27 | 28 | Any additional keyword arguments are passed to the base class 29 | constructor, which turns them into parameters on the Content-Type 30 | header. 31 | """ 32 | if _subtype is None: 33 | raise TypeError('Invalid application MIME subtype') 34 | MIMENonMultipart.__init__(self, 'application', _subtype, **_params) 35 | self.set_payload(_data) 36 | _encoder(self) 37 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/base.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Base class for MIME specializations.""" 6 | 7 | __all__ = ['MIMEBase'] 8 | 9 | from email import message 10 | 11 | 12 | 13 | class MIMEBase(message.Message): 14 | """Base class for MIME specializations.""" 15 | 16 | def __init__(self, _maintype, _subtype, **_params): 17 | """This constructor adds a Content-Type: and a MIME-Version: header. 18 | 19 | The Content-Type: header is taken from the _maintype and _subtype 20 | arguments. Additional parameters for this header are taken from the 21 | keyword arguments. 22 | """ 23 | message.Message.__init__(self) 24 | ctype = '%s/%s' % (_maintype, _subtype) 25 | self.add_header('Content-Type', ctype, **_params) 26 | self['MIME-Version'] = '1.0' 27 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/image.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Class representing image/* type MIME documents.""" 6 | 7 | __all__ = ['MIMEImage'] 8 | 9 | import imghdr 10 | 11 | from email import encoders 12 | from email.mime.nonmultipart import MIMENonMultipart 13 | 14 | 15 | 16 | class MIMEImage(MIMENonMultipart): 17 | """Class for generating image/* type MIME documents.""" 18 | 19 | def __init__(self, _imagedata, _subtype=None, 20 | _encoder=encoders.encode_base64, **_params): 21 | """Create an image/* type MIME document. 22 | 23 | _imagedata is a string containing the raw image data. If this data 24 | can be decoded by the standard Python `imghdr' module, then the 25 | subtype will be automatically included in the Content-Type header. 26 | Otherwise, you can specify the specific image subtype via the _subtype 27 | parameter. 28 | 29 | _encoder is a function which will perform the actual encoding for 30 | transport of the image data. It takes one argument, which is this 31 | Image instance. It should use get_payload() and set_payload() to 32 | change the payload to the encoded form. It should also add any 33 | Content-Transfer-Encoding or other headers to the message as 34 | necessary. The default encoding is Base64. 35 | 36 | Any additional keyword arguments are passed to the base class 37 | constructor, which turns them into parameters on the Content-Type 38 | header. 39 | """ 40 | if _subtype is None: 41 | _subtype = imghdr.what(None, _imagedata) 42 | if _subtype is None: 43 | raise TypeError('Could not guess image MIME subtype') 44 | MIMENonMultipart.__init__(self, 'image', _subtype, **_params) 45 | self.set_payload(_imagedata) 46 | _encoder(self) 47 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/message.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Class representing message/* MIME documents.""" 6 | 7 | __all__ = ['MIMEMessage'] 8 | 9 | from email import message 10 | from email.mime.nonmultipart import MIMENonMultipart 11 | 12 | 13 | 14 | class MIMEMessage(MIMENonMultipart): 15 | """Class representing message/* MIME documents.""" 16 | 17 | def __init__(self, _msg, _subtype='rfc822'): 18 | """Create a message/* type MIME document. 19 | 20 | _msg is a message object and must be an instance of Message, or a 21 | derived class of Message, otherwise a TypeError is raised. 22 | 23 | Optional _subtype defines the subtype of the contained message. The 24 | default is "rfc822" (this is defined by the MIME standard, even though 25 | the term "rfc822" is technically outdated by RFC 2822). 26 | """ 27 | MIMENonMultipart.__init__(self, 'message', _subtype) 28 | if not isinstance(_msg, message.Message): 29 | raise TypeError('Argument is not an instance of Message') 30 | # It's convenient to use this base class method. We need to do it 31 | # this way or we'll get an exception 32 | message.Message.attach(self, _msg) 33 | # And be sure our default type is set correctly 34 | self.set_default_type('message/rfc822') 35 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/multipart.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2002-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Base class for MIME multipart/* type messages.""" 6 | 7 | __all__ = ['MIMEMultipart'] 8 | 9 | from email.mime.base import MIMEBase 10 | 11 | 12 | 13 | class MIMEMultipart(MIMEBase): 14 | """Base class for MIME multipart/* type messages.""" 15 | 16 | def __init__(self, _subtype='mixed', boundary=None, _subparts=None, 17 | **_params): 18 | """Creates a multipart/* type message. 19 | 20 | By default, creates a multipart/mixed message, with proper 21 | Content-Type and MIME-Version headers. 22 | 23 | _subtype is the subtype of the multipart content type, defaulting to 24 | `mixed'. 25 | 26 | boundary is the multipart boundary string. By default it is 27 | calculated as needed. 28 | 29 | _subparts is a sequence of initial subparts for the payload. It 30 | must be an iterable object, such as a list. You can always 31 | attach new subparts to the message by using the attach() method. 32 | 33 | Additional parameters for the Content-Type header are taken from the 34 | keyword arguments (or passed into the _params argument). 35 | """ 36 | MIMEBase.__init__(self, 'multipart', _subtype, **_params) 37 | 38 | # Initialise _payload to an empty list as the Message superclass's 39 | # implementation of is_multipart assumes that _payload is a list for 40 | # multipart messages. 41 | self._payload = [] 42 | 43 | if _subparts: 44 | for p in _subparts: 45 | self.attach(p) 46 | if boundary: 47 | self.set_boundary(boundary) 48 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/nonmultipart.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2002-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Base class for MIME type messages that are not multipart.""" 6 | 7 | __all__ = ['MIMENonMultipart'] 8 | 9 | from email import errors 10 | from email.mime.base import MIMEBase 11 | 12 | 13 | 14 | class MIMENonMultipart(MIMEBase): 15 | """Base class for MIME multipart/* type messages.""" 16 | 17 | def attach(self, payload): 18 | # The public API prohibits attaching multiple subparts to MIMEBase 19 | # derived subtypes since none of them are, by definition, of content 20 | # type multipart/* 21 | raise errors.MultipartConversionError( 22 | 'Cannot attach additional subparts to non-multipart/*') 23 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/email/mime/text.py: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2001-2006 Python Software Foundation 2 | # Author: Barry Warsaw 3 | # Contact: email-sig@python.org 4 | 5 | """Class representing text/* type MIME documents.""" 6 | 7 | __all__ = ['MIMEText'] 8 | 9 | from email.mime.nonmultipart import MIMENonMultipart 10 | 11 | 12 | 13 | class MIMEText(MIMENonMultipart): 14 | """Class for generating text/* type MIME documents.""" 15 | 16 | def __init__(self, _text, _subtype='plain', _charset=None): 17 | """Create a text/* type MIME document. 18 | 19 | _text is the string for this message object. 20 | 21 | _subtype is the MIME sub content type, defaulting to "plain". 22 | 23 | _charset is the character set parameter added to the Content-Type 24 | header. This defaults to "us-ascii". Note that as a side-effect, the 25 | Content-Transfer-Encoding header will also be set. 26 | """ 27 | 28 | # If no _charset was specified, check to see if there are non-ascii 29 | # characters present. If not, use 'us-ascii', otherwise use utf-8. 30 | # XXX: This can be removed once #7304 is fixed. 31 | if _charset is None: 32 | try: 33 | _text.encode('us-ascii') 34 | _charset = 'us-ascii' 35 | except UnicodeEncodeError: 36 | _charset = 'utf-8' 37 | 38 | MIMENonMultipart.__init__(self, 'text', _subtype, 39 | **{'charset': _charset}) 40 | 41 | self.set_payload(_text, _charset) 42 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/ascii.py: -------------------------------------------------------------------------------- 1 | """ Python 'ascii' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.ascii_encode 18 | decode = codecs.ascii_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.ascii_encode(input, self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.IncrementalDecoder): 25 | def decode(self, input, final=False): 26 | return codecs.ascii_decode(input, self.errors)[0] 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | pass 33 | 34 | class StreamConverter(StreamWriter,StreamReader): 35 | 36 | encode = codecs.ascii_decode 37 | decode = codecs.ascii_encode 38 | 39 | ### encodings module API 40 | 41 | def getregentry(): 42 | return codecs.CodecInfo( 43 | name='ascii', 44 | encode=Codec.encode, 45 | decode=Codec.decode, 46 | incrementalencoder=IncrementalEncoder, 47 | incrementaldecoder=IncrementalDecoder, 48 | streamwriter=StreamWriter, 49 | streamreader=StreamReader, 50 | ) 51 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/base64_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'base64_codec' Codec - base64 content transfer encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | 5 | Written by Marc-Andre Lemburg (mal@lemburg.com). 6 | """ 7 | 8 | import codecs 9 | import base64 10 | 11 | ### Codec APIs 12 | 13 | def base64_encode(input, errors='strict'): 14 | assert errors == 'strict' 15 | return (base64.encodebytes(input), len(input)) 16 | 17 | def base64_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | return (base64.decodebytes(input), len(input)) 20 | 21 | class Codec(codecs.Codec): 22 | def encode(self, input, errors='strict'): 23 | return base64_encode(input, errors) 24 | def decode(self, input, errors='strict'): 25 | return base64_decode(input, errors) 26 | 27 | class IncrementalEncoder(codecs.IncrementalEncoder): 28 | def encode(self, input, final=False): 29 | assert self.errors == 'strict' 30 | return base64.encodebytes(input) 31 | 32 | class IncrementalDecoder(codecs.IncrementalDecoder): 33 | def decode(self, input, final=False): 34 | assert self.errors == 'strict' 35 | return base64.decodebytes(input) 36 | 37 | class StreamWriter(Codec, codecs.StreamWriter): 38 | charbuffertype = bytes 39 | 40 | class StreamReader(Codec, codecs.StreamReader): 41 | charbuffertype = bytes 42 | 43 | ### encodings module API 44 | 45 | def getregentry(): 46 | return codecs.CodecInfo( 47 | name='base64', 48 | encode=base64_encode, 49 | decode=base64_decode, 50 | incrementalencoder=IncrementalEncoder, 51 | incrementaldecoder=IncrementalDecoder, 52 | streamwriter=StreamWriter, 53 | streamreader=StreamReader, 54 | _is_text_encoding=False, 55 | ) 56 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/big5.py: -------------------------------------------------------------------------------- 1 | # 2 | # big5.py: Python Unicode Codec for BIG5 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_tw, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_tw.getcodec('big5') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='big5', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/big5hkscs.py: -------------------------------------------------------------------------------- 1 | # 2 | # big5hkscs.py: Python Unicode Codec for BIG5HKSCS 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_hk, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_hk.getcodec('big5hkscs') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='big5hkscs', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/bz2_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'bz2_codec' Codec - bz2 compression encoding. 2 | 3 | This codec de/encodes from bytes to bytes and is therefore usable with 4 | bytes.transform() and bytes.untransform(). 5 | 6 | Adapted by Raymond Hettinger from zlib_codec.py which was written 7 | by Marc-Andre Lemburg (mal@lemburg.com). 8 | """ 9 | 10 | import codecs 11 | import bz2 # this codec needs the optional bz2 module ! 12 | 13 | ### Codec APIs 14 | 15 | def bz2_encode(input, errors='strict'): 16 | assert errors == 'strict' 17 | return (bz2.compress(input), len(input)) 18 | 19 | def bz2_decode(input, errors='strict'): 20 | assert errors == 'strict' 21 | return (bz2.decompress(input), len(input)) 22 | 23 | class Codec(codecs.Codec): 24 | def encode(self, input, errors='strict'): 25 | return bz2_encode(input, errors) 26 | def decode(self, input, errors='strict'): 27 | return bz2_decode(input, errors) 28 | 29 | class IncrementalEncoder(codecs.IncrementalEncoder): 30 | def __init__(self, errors='strict'): 31 | assert errors == 'strict' 32 | self.errors = errors 33 | self.compressobj = bz2.BZ2Compressor() 34 | 35 | def encode(self, input, final=False): 36 | if final: 37 | c = self.compressobj.compress(input) 38 | return c + self.compressobj.flush() 39 | else: 40 | return self.compressobj.compress(input) 41 | 42 | def reset(self): 43 | self.compressobj = bz2.BZ2Compressor() 44 | 45 | class IncrementalDecoder(codecs.IncrementalDecoder): 46 | def __init__(self, errors='strict'): 47 | assert errors == 'strict' 48 | self.errors = errors 49 | self.decompressobj = bz2.BZ2Decompressor() 50 | 51 | def decode(self, input, final=False): 52 | try: 53 | return self.decompressobj.decompress(input) 54 | except EOFError: 55 | return '' 56 | 57 | def reset(self): 58 | self.decompressobj = bz2.BZ2Decompressor() 59 | 60 | class StreamWriter(Codec, codecs.StreamWriter): 61 | charbuffertype = bytes 62 | 63 | class StreamReader(Codec, codecs.StreamReader): 64 | charbuffertype = bytes 65 | 66 | ### encodings module API 67 | 68 | def getregentry(): 69 | return codecs.CodecInfo( 70 | name="bz2", 71 | encode=bz2_encode, 72 | decode=bz2_decode, 73 | incrementalencoder=IncrementalEncoder, 74 | incrementaldecoder=IncrementalDecoder, 75 | streamwriter=StreamWriter, 76 | streamreader=StreamReader, 77 | _is_text_encoding=False, 78 | ) 79 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/charmap.py: -------------------------------------------------------------------------------- 1 | """ Generic Python Character Mapping Codec. 2 | 3 | Use this codec directly rather than through the automatic 4 | conversion mechanisms supplied by unicode() and .encode(). 5 | 6 | 7 | Written by Marc-Andre Lemburg (mal@lemburg.com). 8 | 9 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 10 | 11 | """#" 12 | 13 | import codecs 14 | 15 | ### Codec APIs 16 | 17 | class Codec(codecs.Codec): 18 | 19 | # Note: Binding these as C functions will result in the class not 20 | # converting them to methods. This is intended. 21 | encode = codecs.charmap_encode 22 | decode = codecs.charmap_decode 23 | 24 | class IncrementalEncoder(codecs.IncrementalEncoder): 25 | def __init__(self, errors='strict', mapping=None): 26 | codecs.IncrementalEncoder.__init__(self, errors) 27 | self.mapping = mapping 28 | 29 | def encode(self, input, final=False): 30 | return codecs.charmap_encode(input, self.errors, self.mapping)[0] 31 | 32 | class IncrementalDecoder(codecs.IncrementalDecoder): 33 | def __init__(self, errors='strict', mapping=None): 34 | codecs.IncrementalDecoder.__init__(self, errors) 35 | self.mapping = mapping 36 | 37 | def decode(self, input, final=False): 38 | return codecs.charmap_decode(input, self.errors, self.mapping)[0] 39 | 40 | class StreamWriter(Codec,codecs.StreamWriter): 41 | 42 | def __init__(self,stream,errors='strict',mapping=None): 43 | codecs.StreamWriter.__init__(self,stream,errors) 44 | self.mapping = mapping 45 | 46 | def encode(self,input,errors='strict'): 47 | return Codec.encode(input,errors,self.mapping) 48 | 49 | class StreamReader(Codec,codecs.StreamReader): 50 | 51 | def __init__(self,stream,errors='strict',mapping=None): 52 | codecs.StreamReader.__init__(self,stream,errors) 53 | self.mapping = mapping 54 | 55 | def decode(self,input,errors='strict'): 56 | return Codec.decode(input,errors,self.mapping) 57 | 58 | ### encodings module API 59 | 60 | def getregentry(): 61 | return codecs.CodecInfo( 62 | name='charmap', 63 | encode=Codec.encode, 64 | decode=Codec.decode, 65 | incrementalencoder=IncrementalEncoder, 66 | incrementaldecoder=IncrementalDecoder, 67 | streamwriter=StreamWriter, 68 | streamreader=StreamReader, 69 | ) 70 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/cp65001.py: -------------------------------------------------------------------------------- 1 | """ 2 | Code page 65001: Windows UTF-8 (CP_UTF8). 3 | """ 4 | 5 | import codecs 6 | import functools 7 | 8 | if not hasattr(codecs, 'code_page_encode'): 9 | raise LookupError("cp65001 encoding is only available on Windows") 10 | 11 | ### Codec APIs 12 | 13 | encode = functools.partial(codecs.code_page_encode, 65001) 14 | decode = functools.partial(codecs.code_page_decode, 65001) 15 | 16 | class IncrementalEncoder(codecs.IncrementalEncoder): 17 | def encode(self, input, final=False): 18 | return encode(input, self.errors)[0] 19 | 20 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 21 | _buffer_decode = decode 22 | 23 | class StreamWriter(codecs.StreamWriter): 24 | encode = encode 25 | 26 | class StreamReader(codecs.StreamReader): 27 | decode = decode 28 | 29 | ### encodings module API 30 | 31 | def getregentry(): 32 | return codecs.CodecInfo( 33 | name='cp65001', 34 | encode=encode, 35 | decode=decode, 36 | incrementalencoder=IncrementalEncoder, 37 | incrementaldecoder=IncrementalDecoder, 38 | streamreader=StreamReader, 39 | streamwriter=StreamWriter, 40 | ) 41 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/cp932.py: -------------------------------------------------------------------------------- 1 | # 2 | # cp932.py: Python Unicode Codec for CP932 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('cp932') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='cp932', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/cp949.py: -------------------------------------------------------------------------------- 1 | # 2 | # cp949.py: Python Unicode Codec for CP949 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_kr, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_kr.getcodec('cp949') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='cp949', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/cp950.py: -------------------------------------------------------------------------------- 1 | # 2 | # cp950.py: Python Unicode Codec for CP950 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_tw, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_tw.getcodec('cp950') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='cp950', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/euc_jis_2004.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_jis_2004.py: Python Unicode Codec for EUC_JIS_2004 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('euc_jis_2004') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_jis_2004', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/euc_jisx0213.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_jisx0213.py: Python Unicode Codec for EUC_JISX0213 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('euc_jisx0213') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_jisx0213', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/euc_jp.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_jp.py: Python Unicode Codec for EUC_JP 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('euc_jp') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_jp', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/euc_kr.py: -------------------------------------------------------------------------------- 1 | # 2 | # euc_kr.py: Python Unicode Codec for EUC_KR 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_kr, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_kr.getcodec('euc_kr') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='euc_kr', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/gb18030.py: -------------------------------------------------------------------------------- 1 | # 2 | # gb18030.py: Python Unicode Codec for GB18030 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('gb18030') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='gb18030', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/gb2312.py: -------------------------------------------------------------------------------- 1 | # 2 | # gb2312.py: Python Unicode Codec for GB2312 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('gb2312') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='gb2312', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/gbk.py: -------------------------------------------------------------------------------- 1 | # 2 | # gbk.py: Python Unicode Codec for GBK 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('gbk') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='gbk', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/hex_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'hex_codec' Codec - 2-digit hex content transfer encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | 5 | Written by Marc-Andre Lemburg (mal@lemburg.com). 6 | """ 7 | 8 | import codecs 9 | import binascii 10 | 11 | ### Codec APIs 12 | 13 | def hex_encode(input, errors='strict'): 14 | assert errors == 'strict' 15 | return (binascii.b2a_hex(input), len(input)) 16 | 17 | def hex_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | return (binascii.a2b_hex(input), len(input)) 20 | 21 | class Codec(codecs.Codec): 22 | def encode(self, input, errors='strict'): 23 | return hex_encode(input, errors) 24 | def decode(self, input, errors='strict'): 25 | return hex_decode(input, errors) 26 | 27 | class IncrementalEncoder(codecs.IncrementalEncoder): 28 | def encode(self, input, final=False): 29 | assert self.errors == 'strict' 30 | return binascii.b2a_hex(input) 31 | 32 | class IncrementalDecoder(codecs.IncrementalDecoder): 33 | def decode(self, input, final=False): 34 | assert self.errors == 'strict' 35 | return binascii.a2b_hex(input) 36 | 37 | class StreamWriter(Codec, codecs.StreamWriter): 38 | charbuffertype = bytes 39 | 40 | class StreamReader(Codec, codecs.StreamReader): 41 | charbuffertype = bytes 42 | 43 | ### encodings module API 44 | 45 | def getregentry(): 46 | return codecs.CodecInfo( 47 | name='hex', 48 | encode=hex_encode, 49 | decode=hex_decode, 50 | incrementalencoder=IncrementalEncoder, 51 | incrementaldecoder=IncrementalDecoder, 52 | streamwriter=StreamWriter, 53 | streamreader=StreamReader, 54 | _is_text_encoding=False, 55 | ) 56 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/hz.py: -------------------------------------------------------------------------------- 1 | # 2 | # hz.py: Python Unicode Codec for HZ 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_cn, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_cn.getcodec('hz') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='hz', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/iso2022_jp.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp.py: Python Unicode Codec for ISO2022_JP 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/iso2022_jp_1.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_1.py: Python Unicode Codec for ISO2022_JP_1 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_1') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_1', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/iso2022_jp_2.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_2.py: Python Unicode Codec for ISO2022_JP_2 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_2') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_2', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/iso2022_jp_2004.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_2004.py: Python Unicode Codec for ISO2022_JP_2004 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_2004') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_2004', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/iso2022_jp_3.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_3.py: Python Unicode Codec for ISO2022_JP_3 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_3') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_3', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/iso2022_jp_ext.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_jp_ext.py: Python Unicode Codec for ISO2022_JP_EXT 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_jp_ext') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_jp_ext', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/iso2022_kr.py: -------------------------------------------------------------------------------- 1 | # 2 | # iso2022_kr.py: Python Unicode Codec for ISO2022_KR 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_iso2022, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_iso2022.getcodec('iso2022_kr') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='iso2022_kr', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/johab.py: -------------------------------------------------------------------------------- 1 | # 2 | # johab.py: Python Unicode Codec for JOHAB 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_kr, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_kr.getcodec('johab') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='johab', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/latin_1.py: -------------------------------------------------------------------------------- 1 | """ Python 'latin-1' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.latin_1_encode 18 | decode = codecs.latin_1_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.latin_1_encode(input,self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.IncrementalDecoder): 25 | def decode(self, input, final=False): 26 | return codecs.latin_1_decode(input,self.errors)[0] 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | pass 33 | 34 | class StreamConverter(StreamWriter,StreamReader): 35 | 36 | encode = codecs.latin_1_decode 37 | decode = codecs.latin_1_encode 38 | 39 | ### encodings module API 40 | 41 | def getregentry(): 42 | return codecs.CodecInfo( 43 | name='iso8859-1', 44 | encode=Codec.encode, 45 | decode=Codec.decode, 46 | incrementalencoder=IncrementalEncoder, 47 | incrementaldecoder=IncrementalDecoder, 48 | streamreader=StreamReader, 49 | streamwriter=StreamWriter, 50 | ) 51 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/mbcs.py: -------------------------------------------------------------------------------- 1 | """ Python 'mbcs' Codec for Windows 2 | 3 | 4 | Cloned by Mark Hammond (mhammond@skippinet.com.au) from ascii.py, 5 | which was written by Marc-Andre Lemburg (mal@lemburg.com). 6 | 7 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 8 | 9 | """ 10 | # Import them explicitly to cause an ImportError 11 | # on non-Windows systems 12 | from codecs import mbcs_encode, mbcs_decode 13 | # for IncrementalDecoder, IncrementalEncoder, ... 14 | import codecs 15 | 16 | ### Codec APIs 17 | 18 | encode = mbcs_encode 19 | 20 | def decode(input, errors='strict'): 21 | return mbcs_decode(input, errors, True) 22 | 23 | class IncrementalEncoder(codecs.IncrementalEncoder): 24 | def encode(self, input, final=False): 25 | return mbcs_encode(input, self.errors)[0] 26 | 27 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 28 | _buffer_decode = mbcs_decode 29 | 30 | class StreamWriter(codecs.StreamWriter): 31 | encode = mbcs_encode 32 | 33 | class StreamReader(codecs.StreamReader): 34 | decode = mbcs_decode 35 | 36 | ### encodings module API 37 | 38 | def getregentry(): 39 | return codecs.CodecInfo( 40 | name='mbcs', 41 | encode=encode, 42 | decode=decode, 43 | incrementalencoder=IncrementalEncoder, 44 | incrementaldecoder=IncrementalDecoder, 45 | streamreader=StreamReader, 46 | streamwriter=StreamWriter, 47 | ) 48 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/quopri_codec.py: -------------------------------------------------------------------------------- 1 | """Codec for quoted-printable encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | """ 5 | 6 | import codecs 7 | import quopri 8 | from io import BytesIO 9 | 10 | def quopri_encode(input, errors='strict'): 11 | assert errors == 'strict' 12 | f = BytesIO(input) 13 | g = BytesIO() 14 | quopri.encode(f, g, 1) 15 | return (g.getvalue(), len(input)) 16 | 17 | def quopri_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | f = BytesIO(input) 20 | g = BytesIO() 21 | quopri.decode(f, g) 22 | return (g.getvalue(), len(input)) 23 | 24 | class Codec(codecs.Codec): 25 | def encode(self, input, errors='strict'): 26 | return quopri_encode(input, errors) 27 | def decode(self, input, errors='strict'): 28 | return quopri_decode(input, errors) 29 | 30 | class IncrementalEncoder(codecs.IncrementalEncoder): 31 | def encode(self, input, final=False): 32 | return quopri_encode(input, self.errors)[0] 33 | 34 | class IncrementalDecoder(codecs.IncrementalDecoder): 35 | def decode(self, input, final=False): 36 | return quopri_decode(input, self.errors)[0] 37 | 38 | class StreamWriter(Codec, codecs.StreamWriter): 39 | charbuffertype = bytes 40 | 41 | class StreamReader(Codec, codecs.StreamReader): 42 | charbuffertype = bytes 43 | 44 | # encodings module API 45 | 46 | def getregentry(): 47 | return codecs.CodecInfo( 48 | name='quopri', 49 | encode=quopri_encode, 50 | decode=quopri_decode, 51 | incrementalencoder=IncrementalEncoder, 52 | incrementaldecoder=IncrementalDecoder, 53 | streamwriter=StreamWriter, 54 | streamreader=StreamReader, 55 | _is_text_encoding=False, 56 | ) 57 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/raw_unicode_escape.py: -------------------------------------------------------------------------------- 1 | """ Python 'raw-unicode-escape' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.raw_unicode_escape_encode 18 | decode = codecs.raw_unicode_escape_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.raw_unicode_escape_encode(input, self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.IncrementalDecoder): 25 | def decode(self, input, final=False): 26 | return codecs.raw_unicode_escape_decode(input, self.errors)[0] 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | pass 33 | 34 | ### encodings module API 35 | 36 | def getregentry(): 37 | return codecs.CodecInfo( 38 | name='raw-unicode-escape', 39 | encode=Codec.encode, 40 | decode=Codec.decode, 41 | incrementalencoder=IncrementalEncoder, 42 | incrementaldecoder=IncrementalDecoder, 43 | streamwriter=StreamWriter, 44 | streamreader=StreamReader, 45 | ) 46 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/shift_jis.py: -------------------------------------------------------------------------------- 1 | # 2 | # shift_jis.py: Python Unicode Codec for SHIFT_JIS 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('shift_jis') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='shift_jis', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/shift_jis_2004.py: -------------------------------------------------------------------------------- 1 | # 2 | # shift_jis_2004.py: Python Unicode Codec for SHIFT_JIS_2004 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('shift_jis_2004') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='shift_jis_2004', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/shift_jisx0213.py: -------------------------------------------------------------------------------- 1 | # 2 | # shift_jisx0213.py: Python Unicode Codec for SHIFT_JISX0213 3 | # 4 | # Written by Hye-Shik Chang 5 | # 6 | 7 | import _codecs_jp, codecs 8 | import _multibytecodec as mbc 9 | 10 | codec = _codecs_jp.getcodec('shift_jisx0213') 11 | 12 | class Codec(codecs.Codec): 13 | encode = codec.encode 14 | decode = codec.decode 15 | 16 | class IncrementalEncoder(mbc.MultibyteIncrementalEncoder, 17 | codecs.IncrementalEncoder): 18 | codec = codec 19 | 20 | class IncrementalDecoder(mbc.MultibyteIncrementalDecoder, 21 | codecs.IncrementalDecoder): 22 | codec = codec 23 | 24 | class StreamReader(Codec, mbc.MultibyteStreamReader, codecs.StreamReader): 25 | codec = codec 26 | 27 | class StreamWriter(Codec, mbc.MultibyteStreamWriter, codecs.StreamWriter): 28 | codec = codec 29 | 30 | def getregentry(): 31 | return codecs.CodecInfo( 32 | name='shift_jisx0213', 33 | encode=Codec().encode, 34 | decode=Codec().decode, 35 | incrementalencoder=IncrementalEncoder, 36 | incrementaldecoder=IncrementalDecoder, 37 | streamreader=StreamReader, 38 | streamwriter=StreamWriter, 39 | ) 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/undefined.py: -------------------------------------------------------------------------------- 1 | """ Python 'undefined' Codec 2 | 3 | This codec will always raise a ValueError exception when being 4 | used. It is intended for use by the site.py file to switch off 5 | automatic string to Unicode coercion. 6 | 7 | Written by Marc-Andre Lemburg (mal@lemburg.com). 8 | 9 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 10 | 11 | """ 12 | import codecs 13 | 14 | ### Codec APIs 15 | 16 | class Codec(codecs.Codec): 17 | 18 | def encode(self,input,errors='strict'): 19 | raise UnicodeError("undefined encoding") 20 | 21 | def decode(self,input,errors='strict'): 22 | raise UnicodeError("undefined encoding") 23 | 24 | class IncrementalEncoder(codecs.IncrementalEncoder): 25 | def encode(self, input, final=False): 26 | raise UnicodeError("undefined encoding") 27 | 28 | class IncrementalDecoder(codecs.IncrementalDecoder): 29 | def decode(self, input, final=False): 30 | raise UnicodeError("undefined encoding") 31 | 32 | class StreamWriter(Codec,codecs.StreamWriter): 33 | pass 34 | 35 | class StreamReader(Codec,codecs.StreamReader): 36 | pass 37 | 38 | ### encodings module API 39 | 40 | def getregentry(): 41 | return codecs.CodecInfo( 42 | name='undefined', 43 | encode=Codec().encode, 44 | decode=Codec().decode, 45 | incrementalencoder=IncrementalEncoder, 46 | incrementaldecoder=IncrementalDecoder, 47 | streamwriter=StreamWriter, 48 | streamreader=StreamReader, 49 | ) 50 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/unicode_escape.py: -------------------------------------------------------------------------------- 1 | """ Python 'unicode-escape' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.unicode_escape_encode 18 | decode = codecs.unicode_escape_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.unicode_escape_encode(input, self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.IncrementalDecoder): 25 | def decode(self, input, final=False): 26 | return codecs.unicode_escape_decode(input, self.errors)[0] 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | pass 33 | 34 | ### encodings module API 35 | 36 | def getregentry(): 37 | return codecs.CodecInfo( 38 | name='unicode-escape', 39 | encode=Codec.encode, 40 | decode=Codec.decode, 41 | incrementalencoder=IncrementalEncoder, 42 | incrementaldecoder=IncrementalDecoder, 43 | streamwriter=StreamWriter, 44 | streamreader=StreamReader, 45 | ) 46 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/unicode_internal.py: -------------------------------------------------------------------------------- 1 | """ Python 'unicode-internal' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | class Codec(codecs.Codec): 14 | 15 | # Note: Binding these as C functions will result in the class not 16 | # converting them to methods. This is intended. 17 | encode = codecs.unicode_internal_encode 18 | decode = codecs.unicode_internal_decode 19 | 20 | class IncrementalEncoder(codecs.IncrementalEncoder): 21 | def encode(self, input, final=False): 22 | return codecs.unicode_internal_encode(input, self.errors)[0] 23 | 24 | class IncrementalDecoder(codecs.IncrementalDecoder): 25 | def decode(self, input, final=False): 26 | return codecs.unicode_internal_decode(input, self.errors)[0] 27 | 28 | class StreamWriter(Codec,codecs.StreamWriter): 29 | pass 30 | 31 | class StreamReader(Codec,codecs.StreamReader): 32 | pass 33 | 34 | ### encodings module API 35 | 36 | def getregentry(): 37 | return codecs.CodecInfo( 38 | name='unicode-internal', 39 | encode=Codec.encode, 40 | decode=Codec.decode, 41 | incrementalencoder=IncrementalEncoder, 42 | incrementaldecoder=IncrementalDecoder, 43 | streamwriter=StreamWriter, 44 | streamreader=StreamReader, 45 | ) 46 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/utf_16_be.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-16-be' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | encode = codecs.utf_16_be_encode 14 | 15 | def decode(input, errors='strict'): 16 | return codecs.utf_16_be_decode(input, errors, True) 17 | 18 | class IncrementalEncoder(codecs.IncrementalEncoder): 19 | def encode(self, input, final=False): 20 | return codecs.utf_16_be_encode(input, self.errors)[0] 21 | 22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 23 | _buffer_decode = codecs.utf_16_be_decode 24 | 25 | class StreamWriter(codecs.StreamWriter): 26 | encode = codecs.utf_16_be_encode 27 | 28 | class StreamReader(codecs.StreamReader): 29 | decode = codecs.utf_16_be_decode 30 | 31 | ### encodings module API 32 | 33 | def getregentry(): 34 | return codecs.CodecInfo( 35 | name='utf-16-be', 36 | encode=encode, 37 | decode=decode, 38 | incrementalencoder=IncrementalEncoder, 39 | incrementaldecoder=IncrementalDecoder, 40 | streamreader=StreamReader, 41 | streamwriter=StreamWriter, 42 | ) 43 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/utf_16_le.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-16-le' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | encode = codecs.utf_16_le_encode 14 | 15 | def decode(input, errors='strict'): 16 | return codecs.utf_16_le_decode(input, errors, True) 17 | 18 | class IncrementalEncoder(codecs.IncrementalEncoder): 19 | def encode(self, input, final=False): 20 | return codecs.utf_16_le_encode(input, self.errors)[0] 21 | 22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 23 | _buffer_decode = codecs.utf_16_le_decode 24 | 25 | class StreamWriter(codecs.StreamWriter): 26 | encode = codecs.utf_16_le_encode 27 | 28 | class StreamReader(codecs.StreamReader): 29 | decode = codecs.utf_16_le_decode 30 | 31 | ### encodings module API 32 | 33 | def getregentry(): 34 | return codecs.CodecInfo( 35 | name='utf-16-le', 36 | encode=encode, 37 | decode=decode, 38 | incrementalencoder=IncrementalEncoder, 39 | incrementaldecoder=IncrementalDecoder, 40 | streamreader=StreamReader, 41 | streamwriter=StreamWriter, 42 | ) 43 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/utf_32_be.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python 'utf-32-be' Codec 3 | """ 4 | import codecs 5 | 6 | ### Codec APIs 7 | 8 | encode = codecs.utf_32_be_encode 9 | 10 | def decode(input, errors='strict'): 11 | return codecs.utf_32_be_decode(input, errors, True) 12 | 13 | class IncrementalEncoder(codecs.IncrementalEncoder): 14 | def encode(self, input, final=False): 15 | return codecs.utf_32_be_encode(input, self.errors)[0] 16 | 17 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 18 | _buffer_decode = codecs.utf_32_be_decode 19 | 20 | class StreamWriter(codecs.StreamWriter): 21 | encode = codecs.utf_32_be_encode 22 | 23 | class StreamReader(codecs.StreamReader): 24 | decode = codecs.utf_32_be_decode 25 | 26 | ### encodings module API 27 | 28 | def getregentry(): 29 | return codecs.CodecInfo( 30 | name='utf-32-be', 31 | encode=encode, 32 | decode=decode, 33 | incrementalencoder=IncrementalEncoder, 34 | incrementaldecoder=IncrementalDecoder, 35 | streamreader=StreamReader, 36 | streamwriter=StreamWriter, 37 | ) 38 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/utf_32_le.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python 'utf-32-le' Codec 3 | """ 4 | import codecs 5 | 6 | ### Codec APIs 7 | 8 | encode = codecs.utf_32_le_encode 9 | 10 | def decode(input, errors='strict'): 11 | return codecs.utf_32_le_decode(input, errors, True) 12 | 13 | class IncrementalEncoder(codecs.IncrementalEncoder): 14 | def encode(self, input, final=False): 15 | return codecs.utf_32_le_encode(input, self.errors)[0] 16 | 17 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 18 | _buffer_decode = codecs.utf_32_le_decode 19 | 20 | class StreamWriter(codecs.StreamWriter): 21 | encode = codecs.utf_32_le_encode 22 | 23 | class StreamReader(codecs.StreamReader): 24 | decode = codecs.utf_32_le_decode 25 | 26 | ### encodings module API 27 | 28 | def getregentry(): 29 | return codecs.CodecInfo( 30 | name='utf-32-le', 31 | encode=encode, 32 | decode=decode, 33 | incrementalencoder=IncrementalEncoder, 34 | incrementaldecoder=IncrementalDecoder, 35 | streamreader=StreamReader, 36 | streamwriter=StreamWriter, 37 | ) 38 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/utf_7.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-7' Codec 2 | 3 | Written by Brian Quinlan (brian@sweetapp.com). 4 | """ 5 | import codecs 6 | 7 | ### Codec APIs 8 | 9 | encode = codecs.utf_7_encode 10 | 11 | def decode(input, errors='strict'): 12 | return codecs.utf_7_decode(input, errors, True) 13 | 14 | class IncrementalEncoder(codecs.IncrementalEncoder): 15 | def encode(self, input, final=False): 16 | return codecs.utf_7_encode(input, self.errors)[0] 17 | 18 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 19 | _buffer_decode = codecs.utf_7_decode 20 | 21 | class StreamWriter(codecs.StreamWriter): 22 | encode = codecs.utf_7_encode 23 | 24 | class StreamReader(codecs.StreamReader): 25 | decode = codecs.utf_7_decode 26 | 27 | ### encodings module API 28 | 29 | def getregentry(): 30 | return codecs.CodecInfo( 31 | name='utf-7', 32 | encode=encode, 33 | decode=decode, 34 | incrementalencoder=IncrementalEncoder, 35 | incrementaldecoder=IncrementalDecoder, 36 | streamreader=StreamReader, 37 | streamwriter=StreamWriter, 38 | ) 39 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/utf_8.py: -------------------------------------------------------------------------------- 1 | """ Python 'utf-8' Codec 2 | 3 | 4 | Written by Marc-Andre Lemburg (mal@lemburg.com). 5 | 6 | (c) Copyright CNRI, All Rights Reserved. NO WARRANTY. 7 | 8 | """ 9 | import codecs 10 | 11 | ### Codec APIs 12 | 13 | encode = codecs.utf_8_encode 14 | 15 | def decode(input, errors='strict'): 16 | return codecs.utf_8_decode(input, errors, True) 17 | 18 | class IncrementalEncoder(codecs.IncrementalEncoder): 19 | def encode(self, input, final=False): 20 | return codecs.utf_8_encode(input, self.errors)[0] 21 | 22 | class IncrementalDecoder(codecs.BufferedIncrementalDecoder): 23 | _buffer_decode = codecs.utf_8_decode 24 | 25 | class StreamWriter(codecs.StreamWriter): 26 | encode = codecs.utf_8_encode 27 | 28 | class StreamReader(codecs.StreamReader): 29 | decode = codecs.utf_8_decode 30 | 31 | ### encodings module API 32 | 33 | def getregentry(): 34 | return codecs.CodecInfo( 35 | name='utf-8', 36 | encode=encode, 37 | decode=decode, 38 | incrementalencoder=IncrementalEncoder, 39 | incrementaldecoder=IncrementalDecoder, 40 | streamreader=StreamReader, 41 | streamwriter=StreamWriter, 42 | ) 43 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/encodings/zlib_codec.py: -------------------------------------------------------------------------------- 1 | """Python 'zlib_codec' Codec - zlib compression encoding. 2 | 3 | This codec de/encodes from bytes to bytes. 4 | 5 | Written by Marc-Andre Lemburg (mal@lemburg.com). 6 | """ 7 | 8 | import codecs 9 | import zlib # this codec needs the optional zlib module ! 10 | 11 | ### Codec APIs 12 | 13 | def zlib_encode(input, errors='strict'): 14 | assert errors == 'strict' 15 | return (zlib.compress(input), len(input)) 16 | 17 | def zlib_decode(input, errors='strict'): 18 | assert errors == 'strict' 19 | return (zlib.decompress(input), len(input)) 20 | 21 | class Codec(codecs.Codec): 22 | def encode(self, input, errors='strict'): 23 | return zlib_encode(input, errors) 24 | def decode(self, input, errors='strict'): 25 | return zlib_decode(input, errors) 26 | 27 | class IncrementalEncoder(codecs.IncrementalEncoder): 28 | def __init__(self, errors='strict'): 29 | assert errors == 'strict' 30 | self.errors = errors 31 | self.compressobj = zlib.compressobj() 32 | 33 | def encode(self, input, final=False): 34 | if final: 35 | c = self.compressobj.compress(input) 36 | return c + self.compressobj.flush() 37 | else: 38 | return self.compressobj.compress(input) 39 | 40 | def reset(self): 41 | self.compressobj = zlib.compressobj() 42 | 43 | class IncrementalDecoder(codecs.IncrementalDecoder): 44 | def __init__(self, errors='strict'): 45 | assert errors == 'strict' 46 | self.errors = errors 47 | self.decompressobj = zlib.decompressobj() 48 | 49 | def decode(self, input, final=False): 50 | if final: 51 | c = self.decompressobj.decompress(input) 52 | return c + self.decompressobj.flush() 53 | else: 54 | return self.decompressobj.decompress(input) 55 | 56 | def reset(self): 57 | self.decompressobj = zlib.decompressobj() 58 | 59 | class StreamWriter(Codec, codecs.StreamWriter): 60 | charbuffertype = bytes 61 | 62 | class StreamReader(Codec, codecs.StreamReader): 63 | charbuffertype = bytes 64 | 65 | ### encodings module API 66 | 67 | def getregentry(): 68 | return codecs.CodecInfo( 69 | name='zlib', 70 | encode=zlib_encode, 71 | decode=zlib_decode, 72 | incrementalencoder=IncrementalEncoder, 73 | incrementaldecoder=IncrementalDecoder, 74 | streamreader=StreamReader, 75 | streamwriter=StreamWriter, 76 | _is_text_encoding=False, 77 | ) 78 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/http/__init__.py: -------------------------------------------------------------------------------- 1 | # This directory is a Python package. 2 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/importlib/machinery.py: -------------------------------------------------------------------------------- 1 | """The machinery of importlib: finders, loaders, hooks, etc.""" 2 | 3 | import _imp 4 | 5 | from ._bootstrap import (SOURCE_SUFFIXES, DEBUG_BYTECODE_SUFFIXES, 6 | OPTIMIZED_BYTECODE_SUFFIXES, BYTECODE_SUFFIXES, 7 | EXTENSION_SUFFIXES) 8 | from ._bootstrap import ModuleSpec 9 | from ._bootstrap import BuiltinImporter 10 | from ._bootstrap import FrozenImporter 11 | from ._bootstrap import WindowsRegistryFinder 12 | from ._bootstrap import PathFinder 13 | from ._bootstrap import FileFinder 14 | from ._bootstrap import SourceFileLoader 15 | from ._bootstrap import SourcelessFileLoader 16 | from ._bootstrap import ExtensionFileLoader 17 | 18 | 19 | def all_suffixes(): 20 | """Returns a list of all recognized module suffixes for this process""" 21 | return SOURCE_SUFFIXES + BYTECODE_SUFFIXES + EXTENSION_SUFFIXES 22 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/json/tool.py: -------------------------------------------------------------------------------- 1 | r"""Command-line tool to validate and pretty-print JSON 2 | 3 | Usage:: 4 | 5 | $ echo '{"json":"obj"}' | python -m json.tool 6 | { 7 | "json": "obj" 8 | } 9 | $ echo '{ 1.2:3.4}' | python -m json.tool 10 | Expecting property name enclosed in double quotes: line 1 column 3 (char 2) 11 | 12 | """ 13 | import sys 14 | import json 15 | 16 | def main(): 17 | if len(sys.argv) == 1: 18 | infile = sys.stdin 19 | outfile = sys.stdout 20 | elif len(sys.argv) == 2: 21 | infile = open(sys.argv[1], 'r') 22 | outfile = sys.stdout 23 | elif len(sys.argv) == 3: 24 | infile = open(sys.argv[1], 'r') 25 | outfile = open(sys.argv[2], 'w') 26 | else: 27 | raise SystemExit(sys.argv[0] + " [infile [outfile]]") 28 | with infile: 29 | try: 30 | obj = json.load(infile) 31 | except ValueError as e: 32 | raise SystemExit(e) 33 | with outfile: 34 | json.dump(obj, outfile, sort_keys=True, indent=4) 35 | outfile.write('\n') 36 | 37 | 38 | if __name__ == '__main__': 39 | main() 40 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/keyword.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | """Keywords (from "graminit.c") 4 | 5 | This file is automatically generated; please don't muck it up! 6 | 7 | To update the symbols in this file, 'cd' to the top directory of 8 | the python source tree after building the interpreter and run: 9 | 10 | ./python Lib/keyword.py 11 | """ 12 | 13 | __all__ = ["iskeyword", "kwlist"] 14 | 15 | kwlist = [ 16 | #--start keywords-- 17 | 'False', 18 | 'None', 19 | 'True', 20 | 'and', 21 | 'as', 22 | 'assert', 23 | 'break', 24 | 'class', 25 | 'continue', 26 | 'def', 27 | 'del', 28 | 'elif', 29 | 'else', 30 | 'except', 31 | 'finally', 32 | 'for', 33 | 'from', 34 | 'global', 35 | 'if', 36 | 'import', 37 | 'in', 38 | 'is', 39 | 'lambda', 40 | 'nonlocal', 41 | 'not', 42 | 'or', 43 | 'pass', 44 | 'raise', 45 | 'return', 46 | 'try', 47 | 'while', 48 | 'with', 49 | 'yield', 50 | #--end keywords-- 51 | ] 52 | 53 | iskeyword = frozenset(kwlist).__contains__ 54 | 55 | def main(): 56 | import sys, re 57 | 58 | args = sys.argv[1:] 59 | iptfile = args and args[0] or "Python/graminit.c" 60 | if len(args) > 1: optfile = args[1] 61 | else: optfile = "Lib/keyword.py" 62 | 63 | # load the output skeleton from the target, taking care to preserve its 64 | # newline convention. 65 | with open(optfile, newline='') as fp: 66 | format = fp.readlines() 67 | nl = format[0][len(format[0].strip()):] if format else '\n' 68 | 69 | # scan the source file for keywords 70 | with open(iptfile) as fp: 71 | strprog = re.compile('"([^"]+)"') 72 | lines = [] 73 | for line in fp: 74 | if '{1, "' in line: 75 | match = strprog.search(line) 76 | if match: 77 | lines.append(" '" + match.group(1) + "'," + nl) 78 | lines.sort() 79 | 80 | # insert the lines of keywords into the skeleton 81 | try: 82 | start = format.index("#--start keywords--" + nl) + 1 83 | end = format.index("#--end keywords--" + nl) 84 | format[start:end] = lines 85 | except ValueError: 86 | sys.stderr.write("target does not contain format markers\n") 87 | sys.exit(1) 88 | 89 | # write the output file 90 | with open(optfile, 'w', newline='') as fp: 91 | fp.writelines(format) 92 | 93 | if __name__ == "__main__": 94 | main() 95 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/multiprocessing/__init__.py: -------------------------------------------------------------------------------- 1 | # 2 | # Package analogous to 'threading.py' but using processes 3 | # 4 | # multiprocessing/__init__.py 5 | # 6 | # This package is intended to duplicate the functionality (and much of 7 | # the API) of threading.py but uses processes instead of threads. A 8 | # subpackage 'multiprocessing.dummy' has the same API but is a simple 9 | # wrapper for 'threading'. 10 | # 11 | # Copyright (c) 2006-2008, R Oudkerk 12 | # Licensed to PSF under a Contributor Agreement. 13 | # 14 | 15 | import sys 16 | from . import context 17 | 18 | # 19 | # Copy stuff from default context 20 | # 21 | 22 | globals().update((name, getattr(context._default_context, name)) 23 | for name in context._default_context.__all__) 24 | __all__ = context._default_context.__all__ 25 | 26 | # 27 | # XXX These should not really be documented or public. 28 | # 29 | 30 | SUBDEBUG = 5 31 | SUBWARNING = 25 32 | 33 | # 34 | # Alias for main module -- will be reset by bootstrapping child processes 35 | # 36 | 37 | if '__main__' in sys.modules: 38 | sys.modules['__mp_main__'] = sys.modules['__main__'] 39 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/multiprocessing/dummy/connection.py: -------------------------------------------------------------------------------- 1 | # 2 | # Analogue of `multiprocessing.connection` which uses queues instead of sockets 3 | # 4 | # multiprocessing/dummy/connection.py 5 | # 6 | # Copyright (c) 2006-2008, R Oudkerk 7 | # Licensed to PSF under a Contributor Agreement. 8 | # 9 | 10 | __all__ = [ 'Client', 'Listener', 'Pipe' ] 11 | 12 | from queue import Queue 13 | 14 | 15 | families = [None] 16 | 17 | 18 | class Listener(object): 19 | 20 | def __init__(self, address=None, family=None, backlog=1): 21 | self._backlog_queue = Queue(backlog) 22 | 23 | def accept(self): 24 | return Connection(*self._backlog_queue.get()) 25 | 26 | def close(self): 27 | self._backlog_queue = None 28 | 29 | address = property(lambda self: self._backlog_queue) 30 | 31 | def __enter__(self): 32 | return self 33 | 34 | def __exit__(self, exc_type, exc_value, exc_tb): 35 | self.close() 36 | 37 | 38 | def Client(address): 39 | _in, _out = Queue(), Queue() 40 | address.put((_out, _in)) 41 | return Connection(_in, _out) 42 | 43 | 44 | def Pipe(duplex=True): 45 | a, b = Queue(), Queue() 46 | return Connection(a, b), Connection(b, a) 47 | 48 | 49 | class Connection(object): 50 | 51 | def __init__(self, _in, _out): 52 | self._out = _out 53 | self._in = _in 54 | self.send = self.send_bytes = _out.put 55 | self.recv = self.recv_bytes = _in.get 56 | 57 | def poll(self, timeout=0.0): 58 | if self._in.qsize() > 0: 59 | return True 60 | if timeout <= 0.0: 61 | return False 62 | self._in.not_empty.acquire() 63 | self._in.not_empty.wait(timeout) 64 | self._in.not_empty.release() 65 | return self._in.qsize() > 0 66 | 67 | def close(self): 68 | pass 69 | 70 | def __enter__(self): 71 | return self 72 | 73 | def __exit__(self, exc_type, exc_value, exc_tb): 74 | self.close() 75 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/multiprocessing/popen_forkserver.py: -------------------------------------------------------------------------------- 1 | import io 2 | import os 3 | 4 | from . import reduction 5 | if not reduction.HAVE_SEND_HANDLE: 6 | raise ImportError('No support for sending fds between processes') 7 | from . import context 8 | from . import forkserver 9 | from . import popen_fork 10 | from . import spawn 11 | from . import util 12 | 13 | 14 | __all__ = ['Popen'] 15 | 16 | # 17 | # Wrapper for an fd used while launching a process 18 | # 19 | 20 | class _DupFd(object): 21 | def __init__(self, ind): 22 | self.ind = ind 23 | def detach(self): 24 | return forkserver.get_inherited_fds()[self.ind] 25 | 26 | # 27 | # Start child process using a server process 28 | # 29 | 30 | class Popen(popen_fork.Popen): 31 | method = 'forkserver' 32 | DupFd = _DupFd 33 | 34 | def __init__(self, process_obj): 35 | self._fds = [] 36 | super().__init__(process_obj) 37 | 38 | def duplicate_for_child(self, fd): 39 | self._fds.append(fd) 40 | return len(self._fds) - 1 41 | 42 | def _launch(self, process_obj): 43 | prep_data = spawn.get_preparation_data(process_obj._name) 44 | buf = io.BytesIO() 45 | context.set_spawning_popen(self) 46 | try: 47 | reduction.dump(prep_data, buf) 48 | reduction.dump(process_obj, buf) 49 | finally: 50 | context.set_spawning_popen(None) 51 | 52 | self.sentinel, w = forkserver.connect_to_new_process(self._fds) 53 | util.Finalize(self, os.close, (self.sentinel,)) 54 | with open(w, 'wb', closefd=True) as f: 55 | f.write(buf.getbuffer()) 56 | self.pid = forkserver.read_unsigned(self.sentinel) 57 | 58 | def poll(self, flag=os.WNOHANG): 59 | if self.returncode is None: 60 | from multiprocessing.connection import wait 61 | timeout = 0 if flag == os.WNOHANG else None 62 | if not wait([self.sentinel], timeout): 63 | return None 64 | try: 65 | self.returncode = forkserver.read_unsigned(self.sentinel) 66 | except (OSError, EOFError): 67 | # The process ended abnormally perhaps because of a signal 68 | self.returncode = 255 69 | return self.returncode 70 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/multiprocessing/popen_spawn_posix.py: -------------------------------------------------------------------------------- 1 | import io 2 | import os 3 | 4 | from . import context 5 | from . import popen_fork 6 | from . import reduction 7 | from . import spawn 8 | from . import util 9 | 10 | __all__ = ['Popen'] 11 | 12 | 13 | # 14 | # Wrapper for an fd used while launching a process 15 | # 16 | 17 | class _DupFd(object): 18 | def __init__(self, fd): 19 | self.fd = fd 20 | def detach(self): 21 | return self.fd 22 | 23 | # 24 | # Start child process using a fresh interpreter 25 | # 26 | 27 | class Popen(popen_fork.Popen): 28 | method = 'spawn' 29 | DupFd = _DupFd 30 | 31 | def __init__(self, process_obj): 32 | self._fds = [] 33 | super().__init__(process_obj) 34 | 35 | def duplicate_for_child(self, fd): 36 | self._fds.append(fd) 37 | return fd 38 | 39 | def _launch(self, process_obj): 40 | from . import semaphore_tracker 41 | tracker_fd = semaphore_tracker.getfd() 42 | self._fds.append(tracker_fd) 43 | prep_data = spawn.get_preparation_data(process_obj._name) 44 | fp = io.BytesIO() 45 | context.set_spawning_popen(self) 46 | try: 47 | reduction.dump(prep_data, fp) 48 | reduction.dump(process_obj, fp) 49 | finally: 50 | context.set_spawning_popen(None) 51 | 52 | parent_r = child_w = child_r = parent_w = None 53 | try: 54 | parent_r, child_w = os.pipe() 55 | child_r, parent_w = os.pipe() 56 | cmd = spawn.get_command_line(tracker_fd=tracker_fd, 57 | pipe_handle=child_r) 58 | self._fds.extend([child_r, child_w]) 59 | self.pid = util.spawnv_passfds(spawn.get_executable(), 60 | cmd, self._fds) 61 | self.sentinel = parent_r 62 | with open(parent_w, 'wb', closefd=False) as f: 63 | f.write(fp.getbuffer()) 64 | finally: 65 | if parent_r is not None: 66 | util.Finalize(self, os.close, (parent_r,)) 67 | for fd in (child_r, child_w, parent_w): 68 | if fd is not None: 69 | os.close(fd) 70 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/nturl2path.py: -------------------------------------------------------------------------------- 1 | """Convert a NT pathname to a file URL and vice versa.""" 2 | 3 | def url2pathname(url): 4 | """OS-specific conversion from a relative URL of the 'file' scheme 5 | to a file system path; not recommended for general use.""" 6 | # e.g. 7 | # ///C|/foo/bar/spam.foo 8 | # becomes 9 | # C:\foo\bar\spam.foo 10 | import string, urllib.parse 11 | # Windows itself uses ":" even in URLs. 12 | url = url.replace(':', '|') 13 | if not '|' in url: 14 | # No drive specifier, just convert slashes 15 | if url[:4] == '////': 16 | # path is something like ////host/path/on/remote/host 17 | # convert this to \\host\path\on\remote\host 18 | # (notice halving of slashes at the start of the path) 19 | url = url[2:] 20 | components = url.split('/') 21 | # make sure not to convert quoted slashes :-) 22 | return urllib.parse.unquote('\\'.join(components)) 23 | comp = url.split('|') 24 | if len(comp) != 2 or comp[0][-1] not in string.ascii_letters: 25 | error = 'Bad URL: ' + url 26 | raise OSError(error) 27 | drive = comp[0][-1].upper() 28 | components = comp[1].split('/') 29 | path = drive + ':' 30 | for comp in components: 31 | if comp: 32 | path = path + '\\' + urllib.parse.unquote(comp) 33 | # Issue #11474 - handing url such as |c/| 34 | if path.endswith(':') and url.endswith('/'): 35 | path += '\\' 36 | return path 37 | 38 | def pathname2url(p): 39 | """OS-specific conversion from a file system path to a relative URL 40 | of the 'file' scheme; not recommended for general use.""" 41 | # e.g. 42 | # C:\foo\bar\spam.foo 43 | # becomes 44 | # ///C|/foo/bar/spam.foo 45 | import urllib.parse 46 | if not ':' in p: 47 | # No drive specifier, just convert slashes and quote the name 48 | if p[:2] == '\\\\': 49 | # path is something like \\host\path\on\remote\host 50 | # convert this to ////host/path/on/remote/host 51 | # (notice doubling of slashes at the start of the path) 52 | p = '\\\\' + p 53 | components = p.split('\\') 54 | return urllib.parse.quote('/'.join(components)) 55 | comp = p.split(':') 56 | if len(comp) != 2 or len(comp[0]) > 1: 57 | error = 'Bad path: ' + p 58 | raise OSError(error) 59 | 60 | drive = urllib.parse.quote(comp[0].upper()) 61 | components = comp[1].split('\\') 62 | path = '///' + drive + ':' 63 | for comp in components: 64 | if comp: 65 | path = path + '/' + urllib.parse.quote(comp) 66 | return path 67 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/plat-ios/regen: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | set -v 3 | include=`xcrun --sdk iphoneos --show-sdk-path`/usr/include python$EXE ../../Tools/scripts/h2py.py -i '(u_long)' `xcrun --sdk iphoneos --show-sdk-path`/usr/include/netinet/in.h 4 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/pydoc_data/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/pydoc_data/__init__.py -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/pydoc_data/_pydoc.css: -------------------------------------------------------------------------------- 1 | /* 2 | CSS file for pydoc. 3 | 4 | Contents of this file are subject to change without notice. 5 | 6 | */ 7 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/sqlite3/__init__.py: -------------------------------------------------------------------------------- 1 | # pysqlite2/__init__.py: the pysqlite2 package. 2 | # 3 | # Copyright (C) 2005 Gerhard Häring 4 | # 5 | # This file is part of pysqlite. 6 | # 7 | # This software is provided 'as-is', without any express or implied 8 | # warranty. In no event will the authors be held liable for any damages 9 | # arising from the use of this software. 10 | # 11 | # Permission is granted to anyone to use this software for any purpose, 12 | # including commercial applications, and to alter it and redistribute it 13 | # freely, subject to the following restrictions: 14 | # 15 | # 1. The origin of this software must not be misrepresented; you must not 16 | # claim that you wrote the original software. If you use this software 17 | # in a product, an acknowledgment in the product documentation would be 18 | # appreciated but is not required. 19 | # 2. Altered source versions must be plainly marked as such, and must not be 20 | # misrepresented as being the original software. 21 | # 3. This notice may not be removed or altered from any source distribution. 22 | 23 | from sqlite3.dbapi2 import * 24 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/struct.py: -------------------------------------------------------------------------------- 1 | __all__ = [ 2 | # Functions 3 | 'calcsize', 'pack', 'pack_into', 'unpack', 'unpack_from', 4 | 'iter_unpack', 5 | 6 | # Classes 7 | 'Struct', 8 | 9 | # Exceptions 10 | 'error' 11 | ] 12 | 13 | from _struct import * 14 | from _struct import _clearcache 15 | from _struct import __doc__ 16 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/symbol.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python3 2 | 3 | """Non-terminal symbols of Python grammar (from "graminit.h").""" 4 | 5 | # This file is automatically generated; please don't muck it up! 6 | # 7 | # To update the symbols in this file, 'cd' to the top directory of 8 | # the python source tree after building the interpreter and run: 9 | # 10 | # ./python Lib/symbol.py 11 | 12 | #--start constants-- 13 | single_input = 256 14 | file_input = 257 15 | eval_input = 258 16 | decorator = 259 17 | decorators = 260 18 | decorated = 261 19 | funcdef = 262 20 | parameters = 263 21 | typedargslist = 264 22 | tfpdef = 265 23 | varargslist = 266 24 | vfpdef = 267 25 | stmt = 268 26 | simple_stmt = 269 27 | small_stmt = 270 28 | expr_stmt = 271 29 | testlist_star_expr = 272 30 | augassign = 273 31 | del_stmt = 274 32 | pass_stmt = 275 33 | flow_stmt = 276 34 | break_stmt = 277 35 | continue_stmt = 278 36 | return_stmt = 279 37 | yield_stmt = 280 38 | raise_stmt = 281 39 | import_stmt = 282 40 | import_name = 283 41 | import_from = 284 42 | import_as_name = 285 43 | dotted_as_name = 286 44 | import_as_names = 287 45 | dotted_as_names = 288 46 | dotted_name = 289 47 | global_stmt = 290 48 | nonlocal_stmt = 291 49 | assert_stmt = 292 50 | compound_stmt = 293 51 | if_stmt = 294 52 | while_stmt = 295 53 | for_stmt = 296 54 | try_stmt = 297 55 | with_stmt = 298 56 | with_item = 299 57 | except_clause = 300 58 | suite = 301 59 | test = 302 60 | test_nocond = 303 61 | lambdef = 304 62 | lambdef_nocond = 305 63 | or_test = 306 64 | and_test = 307 65 | not_test = 308 66 | comparison = 309 67 | comp_op = 310 68 | star_expr = 311 69 | expr = 312 70 | xor_expr = 313 71 | and_expr = 314 72 | shift_expr = 315 73 | arith_expr = 316 74 | term = 317 75 | factor = 318 76 | power = 319 77 | atom = 320 78 | testlist_comp = 321 79 | trailer = 322 80 | subscriptlist = 323 81 | subscript = 324 82 | sliceop = 325 83 | exprlist = 326 84 | testlist = 327 85 | dictorsetmaker = 328 86 | classdef = 329 87 | arglist = 330 88 | argument = 331 89 | comp_iter = 332 90 | comp_for = 333 91 | comp_if = 334 92 | encoding_decl = 335 93 | yield_expr = 336 94 | yield_arg = 337 95 | #--end constants-- 96 | 97 | sym_name = {} 98 | for _name, _value in list(globals().items()): 99 | if type(_value) is type(0): 100 | sym_name[_value] = _name 101 | 102 | 103 | def _main(): 104 | import sys 105 | import token 106 | if len(sys.argv) == 1: 107 | sys.argv = sys.argv + ["Include/graminit.h", "Lib/symbol.py"] 108 | token._main() 109 | 110 | if __name__ == "__main__": 111 | _main() 112 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/this.py: -------------------------------------------------------------------------------- 1 | s = """Gur Mra bs Clguba, ol Gvz Crgref 2 | 3 | Ornhgvshy vf orggre guna htyl. 4 | Rkcyvpvg vf orggre guna vzcyvpvg. 5 | Fvzcyr vf orggre guna pbzcyrk. 6 | Pbzcyrk vf orggre guna pbzcyvpngrq. 7 | Syng vf orggre guna arfgrq. 8 | Fcnefr vf orggre guna qrafr. 9 | Ernqnovyvgl pbhagf. 10 | Fcrpvny pnfrf nera'g fcrpvny rabhtu gb oernx gur ehyrf. 11 | Nygubhtu cenpgvpnyvgl orngf chevgl. 12 | Reebef fubhyq arire cnff fvyragyl. 13 | Hayrff rkcyvpvgyl fvyraprq. 14 | Va gur snpr bs nzovthvgl, ershfr gur grzcgngvba gb thrff. 15 | Gurer fubhyq or bar-- naq cersrenoyl bayl bar --boivbhf jnl gb qb vg. 16 | Nygubhtu gung jnl znl abg or boivbhf ng svefg hayrff lbh'er Qhgpu. 17 | Abj vf orggre guna arire. 18 | Nygubhtu arire vf bsgra orggre guna *evtug* abj. 19 | Vs gur vzcyrzragngvba vf uneq gb rkcynva, vg'f n onq vqrn. 20 | Vs gur vzcyrzragngvba vf rnfl gb rkcynva, vg znl or n tbbq vqrn. 21 | Anzrfcnprf ner bar ubaxvat terng vqrn -- yrg'f qb zber bs gubfr!""" 22 | 23 | d = {} 24 | for c in (65, 97): 25 | for i in range(26): 26 | d[chr(i+c)] = chr((i+13) % 26 + c) 27 | 28 | print("".join([d.get(c, c) for c in s])) 29 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/tty.py: -------------------------------------------------------------------------------- 1 | """Terminal utilities.""" 2 | 3 | # Author: Steen Lumholt. 4 | 5 | from termios import * 6 | 7 | __all__ = ["setraw", "setcbreak"] 8 | 9 | # Indexes for termios list. 10 | IFLAG = 0 11 | OFLAG = 1 12 | CFLAG = 2 13 | LFLAG = 3 14 | ISPEED = 4 15 | OSPEED = 5 16 | CC = 6 17 | 18 | def setraw(fd, when=TCSAFLUSH): 19 | """Put terminal into a raw mode.""" 20 | mode = tcgetattr(fd) 21 | mode[IFLAG] = mode[IFLAG] & ~(BRKINT | ICRNL | INPCK | ISTRIP | IXON) 22 | mode[OFLAG] = mode[OFLAG] & ~(OPOST) 23 | mode[CFLAG] = mode[CFLAG] & ~(CSIZE | PARENB) 24 | mode[CFLAG] = mode[CFLAG] | CS8 25 | mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON | IEXTEN | ISIG) 26 | mode[CC][VMIN] = 1 27 | mode[CC][VTIME] = 0 28 | tcsetattr(fd, when, mode) 29 | 30 | def setcbreak(fd, when=TCSAFLUSH): 31 | """Put terminal into a cbreak mode.""" 32 | mode = tcgetattr(fd) 33 | mode[LFLAG] = mode[LFLAG] & ~(ECHO | ICANON) 34 | mode[CC][VMIN] = 1 35 | mode[CC][VTIME] = 0 36 | tcsetattr(fd, when, mode) 37 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/urllib/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/full-of-fire/YJPythonInterpreterDemo/da8722b840d759a8d1042a02b06bd92c14bf0894/iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/urllib/__init__.py -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/urllib/response.py: -------------------------------------------------------------------------------- 1 | """Response classes used by urllib. 2 | 3 | The base class, addbase, defines a minimal file-like interface, 4 | including read() and readline(). The typical response object is an 5 | addinfourl instance, which defines an info() method that returns 6 | headers and a geturl() method that returns the url. 7 | """ 8 | 9 | import tempfile 10 | 11 | __all__ = ['addbase', 'addclosehook', 'addinfo', 'addinfourl'] 12 | 13 | 14 | class addbase(tempfile._TemporaryFileWrapper): 15 | """Base class for addinfo and addclosehook. Is a good idea for garbage collection.""" 16 | 17 | # XXX Add a method to expose the timeout on the underlying socket? 18 | 19 | def __init__(self, fp): 20 | super(addbase, self).__init__(fp, '', delete=False) 21 | # Keep reference around as this was part of the original API. 22 | self.fp = fp 23 | 24 | def __repr__(self): 25 | return '<%s at %r whose fp = %r>' % (self.__class__.__name__, 26 | id(self), self.file) 27 | 28 | def __enter__(self): 29 | if self.fp.closed: 30 | raise ValueError("I/O operation on closed file") 31 | return self 32 | 33 | def __exit__(self, type, value, traceback): 34 | self.close() 35 | 36 | 37 | class addclosehook(addbase): 38 | """Class to add a close hook to an open file.""" 39 | 40 | def __init__(self, fp, closehook, *hookargs): 41 | super(addclosehook, self).__init__(fp) 42 | self.closehook = closehook 43 | self.hookargs = hookargs 44 | 45 | def close(self): 46 | if self.closehook: 47 | self.closehook(*self.hookargs) 48 | self.closehook = None 49 | self.hookargs = None 50 | super(addclosehook, self).close() 51 | 52 | 53 | class addinfo(addbase): 54 | """class to add an info() method to an open file.""" 55 | 56 | def __init__(self, fp, headers): 57 | super(addinfo, self).__init__(fp) 58 | self.headers = headers 59 | 60 | def info(self): 61 | return self.headers 62 | 63 | 64 | class addinfourl(addinfo): 65 | """class to add info() and geturl() methods to an open file.""" 66 | 67 | def __init__(self, fp, headers, url, code=None): 68 | super(addinfourl, self).__init__(fp, headers) 69 | self.url = url 70 | self.code = code 71 | 72 | def getcode(self): 73 | return self.code 74 | 75 | def geturl(self): 76 | return self.url 77 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/venv/__main__.py: -------------------------------------------------------------------------------- 1 | import sys 2 | from . import main 3 | 4 | rc = 1 5 | try: 6 | main() 7 | rc = 0 8 | except Exception as e: 9 | print('Error: %s' % e, file=sys.stderr) 10 | sys.exit(rc) 11 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/venv/scripts/posix/activate: -------------------------------------------------------------------------------- 1 | # This file must be used with "source bin/activate" *from bash* 2 | # you cannot run it directly 3 | 4 | deactivate () { 5 | # reset old environment variables 6 | if [ -n "$_OLD_VIRTUAL_PATH" ] ; then 7 | PATH="$_OLD_VIRTUAL_PATH" 8 | export PATH 9 | unset _OLD_VIRTUAL_PATH 10 | fi 11 | if [ -n "$_OLD_VIRTUAL_PYTHONHOME" ] ; then 12 | PYTHONHOME="$_OLD_VIRTUAL_PYTHONHOME" 13 | export PYTHONHOME 14 | unset _OLD_VIRTUAL_PYTHONHOME 15 | fi 16 | 17 | # This should detect bash and zsh, which have a hash command that must 18 | # be called to get it to forget past commands. Without forgetting 19 | # past commands the $PATH changes we made may not be respected 20 | if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then 21 | hash -r 22 | fi 23 | 24 | if [ -n "$_OLD_VIRTUAL_PS1" ] ; then 25 | PS1="$_OLD_VIRTUAL_PS1" 26 | export PS1 27 | unset _OLD_VIRTUAL_PS1 28 | fi 29 | 30 | unset VIRTUAL_ENV 31 | if [ ! "$1" = "nondestructive" ] ; then 32 | # Self destruct! 33 | unset -f deactivate 34 | fi 35 | } 36 | 37 | # unset irrelavent variables 38 | deactivate nondestructive 39 | 40 | VIRTUAL_ENV="__VENV_DIR__" 41 | export VIRTUAL_ENV 42 | 43 | _OLD_VIRTUAL_PATH="$PATH" 44 | PATH="$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH" 45 | export PATH 46 | 47 | # unset PYTHONHOME if set 48 | # this will fail if PYTHONHOME is set to the empty string (which is bad anyway) 49 | # could use `if (set -u; : $PYTHONHOME) ;` in bash 50 | if [ -n "$PYTHONHOME" ] ; then 51 | _OLD_VIRTUAL_PYTHONHOME="$PYTHONHOME" 52 | unset PYTHONHOME 53 | fi 54 | 55 | if [ -z "$VIRTUAL_ENV_DISABLE_PROMPT" ] ; then 56 | _OLD_VIRTUAL_PS1="$PS1" 57 | if [ "x__VENV_PROMPT__" != x ] ; then 58 | PS1="__VENV_PROMPT__$PS1" 59 | else 60 | if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then 61 | # special case for Aspen magic directories 62 | # see http://www.zetadev.com/software/aspen/ 63 | PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1" 64 | else 65 | PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1" 66 | fi 67 | fi 68 | export PS1 69 | fi 70 | 71 | # This should detect bash and zsh, which have a hash command that must 72 | # be called to get it to forget past commands. Without forgetting 73 | # past commands the $PATH changes we made may not be respected 74 | if [ -n "$BASH" -o -n "$ZSH_VERSION" ] ; then 75 | hash -r 76 | fi 77 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/venv/scripts/posix/activate.csh: -------------------------------------------------------------------------------- 1 | # This file must be used with "source bin/activate.csh" *from csh*. 2 | # You cannot run it directly. 3 | # Created by Davide Di Blasi . 4 | # Ported to Python 3.3 venv by Andrew Svetlov 5 | 6 | alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate' 7 | 8 | # Unset irrelavent variables. 9 | deactivate nondestructive 10 | 11 | setenv VIRTUAL_ENV "__VENV_DIR__" 12 | 13 | set _OLD_VIRTUAL_PATH="$PATH" 14 | setenv PATH "$VIRTUAL_ENV/__VENV_BIN_NAME__:$PATH" 15 | 16 | 17 | set _OLD_VIRTUAL_PROMPT="$prompt" 18 | 19 | if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then 20 | if ("__VENV_NAME__" != "") then 21 | set env_name = "__VENV_NAME__" 22 | else 23 | if (`basename "VIRTUAL_ENV"` == "__") then 24 | # special case for Aspen magic directories 25 | # see http://www.zetadev.com/software/aspen/ 26 | set env_name = `basename \`dirname "$VIRTUAL_ENV"\`` 27 | else 28 | set env_name = `basename "$VIRTUAL_ENV"` 29 | endif 30 | endif 31 | set prompt = "[$env_name] $prompt" 32 | unset env_name 33 | endif 34 | 35 | alias pydoc python -m pydoc 36 | 37 | rehash 38 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/xml/__init__.py: -------------------------------------------------------------------------------- 1 | """Core XML support for Python. 2 | 3 | This package contains four sub-packages: 4 | 5 | dom -- The W3C Document Object Model. This supports DOM Level 1 + 6 | Namespaces. 7 | 8 | parsers -- Python wrappers for XML parsers (currently only supports Expat). 9 | 10 | sax -- The Simple API for XML, developed by XML-Dev, led by David 11 | Megginson and ported to Python by Lars Marius Garshol. This 12 | supports the SAX 2 API. 13 | 14 | etree -- The ElementTree XML library. This is a subset of the full 15 | ElementTree XML release. 16 | 17 | """ 18 | 19 | 20 | __all__ = ["dom", "parsers", "sax", "etree"] 21 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/xml/dom/NodeFilter.py: -------------------------------------------------------------------------------- 1 | # This is the Python mapping for interface NodeFilter from 2 | # DOM2-Traversal-Range. It contains only constants. 3 | 4 | class NodeFilter: 5 | """ 6 | This is the DOM2 NodeFilter interface. It contains only constants. 7 | """ 8 | FILTER_ACCEPT = 1 9 | FILTER_REJECT = 2 10 | FILTER_SKIP = 3 11 | 12 | SHOW_ALL = 0xFFFFFFFF 13 | SHOW_ELEMENT = 0x00000001 14 | SHOW_ATTRIBUTE = 0x00000002 15 | SHOW_TEXT = 0x00000004 16 | SHOW_CDATA_SECTION = 0x00000008 17 | SHOW_ENTITY_REFERENCE = 0x00000010 18 | SHOW_ENTITY = 0x00000020 19 | SHOW_PROCESSING_INSTRUCTION = 0x00000040 20 | SHOW_COMMENT = 0x00000080 21 | SHOW_DOCUMENT = 0x00000100 22 | SHOW_DOCUMENT_TYPE = 0x00000200 23 | SHOW_DOCUMENT_FRAGMENT = 0x00000400 24 | SHOW_NOTATION = 0x00000800 25 | 26 | def acceptNode(self, node): 27 | raise NotImplementedError 28 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/xml/etree/__init__.py: -------------------------------------------------------------------------------- 1 | # $Id: __init__.py 3375 2008-02-13 08:05:08Z fredrik $ 2 | # elementtree package 3 | 4 | # -------------------------------------------------------------------- 5 | # The ElementTree toolkit is 6 | # 7 | # Copyright (c) 1999-2008 by Fredrik Lundh 8 | # 9 | # By obtaining, using, and/or copying this software and/or its 10 | # associated documentation, you agree that you have read, understood, 11 | # and will comply with the following terms and conditions: 12 | # 13 | # Permission to use, copy, modify, and distribute this software and 14 | # its associated documentation for any purpose and without fee is 15 | # hereby granted, provided that the above copyright notice appears in 16 | # all copies, and that both that copyright notice and this permission 17 | # notice appear in supporting documentation, and that the name of 18 | # Secret Labs AB or the author not be used in advertising or publicity 19 | # pertaining to distribution of the software without specific, written 20 | # prior permission. 21 | # 22 | # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD 23 | # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- 24 | # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR 25 | # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 26 | # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 27 | # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 28 | # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 29 | # OF THIS SOFTWARE. 30 | # -------------------------------------------------------------------- 31 | 32 | # Licensed to PSF under a Contributor Agreement. 33 | # See http://www.python.org/psf/license for licensing details. 34 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/xml/etree/cElementTree.py: -------------------------------------------------------------------------------- 1 | # Deprecated alias for xml.etree.ElementTree 2 | 3 | from xml.etree.ElementTree import * 4 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/xml/parsers/__init__.py: -------------------------------------------------------------------------------- 1 | """Python interfaces to XML parsers. 2 | 3 | This package contains one module: 4 | 5 | expat -- Python wrapper for James Clark's Expat parser, with namespace 6 | support. 7 | 8 | """ 9 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/xml/parsers/expat.py: -------------------------------------------------------------------------------- 1 | """Interface to the Expat non-validating XML parser.""" 2 | import sys 3 | 4 | from pyexpat import * 5 | 6 | # provide pyexpat submodules as xml.parsers.expat submodules 7 | sys.modules['xml.parsers.expat.model'] = model 8 | sys.modules['xml.parsers.expat.errors'] = errors 9 | -------------------------------------------------------------------------------- /iOS运行Python/PythonEnvironment.bundle/Python.framework/Resources/lib/python34/xmlrpc/__init__.py: -------------------------------------------------------------------------------- 1 | # This directory is a Python package. 2 | -------------------------------------------------------------------------------- /iOS运行Python/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/8/31. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /iOS运行Python/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/8/31. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | #include 12 | #import "YXPythonTestViewController.h" 13 | @interface ViewController () 14 | 15 | @end 16 | 17 | @implementation ViewController 18 | 19 | - (void)viewDidLoad { 20 | [super viewDidLoad]; 21 | // Do any additional setup after loading the view, typically from a nib. 22 | 23 | 24 | } 25 | - (IBAction)action:(id)sender { 26 | 27 | [self presentViewController:[YXPythonTestViewController new] animated:YES completion:nil]; 28 | } 29 | 30 | +(BOOL)configPythonEnvironment 31 | { 32 | 33 | NSBundle *mainBundle = [NSBundle mainBundle]; 34 | 35 | NSString *bundlePath = [mainBundle pathForResource:@"PythonEnvironment" ofType:@"bundle"]; 36 | 37 | BOOL isExist = [[NSFileManager defaultManager] fileExistsAtPath:bundlePath]; 38 | 39 | if (isExist) { 40 | 41 | NSBundle *bundle = [NSBundle bundleWithPath:bundlePath]; 42 | 43 | NSString *PythonPath = [bundle pathForResource:@"Python" ofType:@"framework"]; 44 | 45 | isExist = [[NSFileManager defaultManager] fileExistsAtPath:PythonPath]; 46 | 47 | if (isExist) { 48 | 49 | NSString *documantPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject; 50 | 51 | NSString *newFrameworkPath = [documantPath stringByAppendingPathComponent:@"Python.framework"]; 52 | 53 | if (![[NSFileManager defaultManager] fileExistsAtPath:newFrameworkPath]) { 54 | NSError * error; 55 | [[NSFileManager defaultManager] copyItemAtPath:PythonPath toPath:newFrameworkPath error:&error]; 56 | if (!error) { 57 | return YES; 58 | } 59 | } 60 | else 61 | { 62 | return YES; 63 | } 64 | } 65 | } 66 | return NO; 67 | 68 | } 69 | 70 | 71 | 72 | - (void)didReceiveMemoryWarning { 73 | [super didReceiveMemoryWarning]; 74 | // Dispose of any resources that can be recreated. 75 | } 76 | 77 | 78 | @end 79 | -------------------------------------------------------------------------------- /iOS运行Python/YXPyModuleManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // YXPyModuleManager.h 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/9/13. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YXPyModuleManager : NSObject 12 | @property(nonatomic,copy,readonly) NSString *moduleName; 13 | @property(nonatomic,copy,readonly) NSURL *pyURL; 14 | 15 | 16 | - (instancetype)initWithMoudleName:(NSString*)moduleName 17 | pyURL:(NSURL*)pyURL; 18 | 19 | - (void)downLoadPyResourceToLoaclModuleComplete:(void(^)(BOOL success))complete; 20 | 21 | + (void)downLoadPyResourceToLoaclModuleWithModuelName:(NSString*)moduleName pyURL:(NSURL*)pyURL complete:(void(^)(BOOL success))complete; 22 | @end 23 | -------------------------------------------------------------------------------- /iOS运行Python/YXPythonExecute.h: -------------------------------------------------------------------------------- 1 | // 2 | // YXPythonExecute.h 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/9/12. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YXPythonExecute : NSObject 12 | @property(nonatomic,copy,readonly) NSString *moduleName; //具体的模块名 13 | @property(nonatomic,copy,readonly) NSString *moduleDirName; //模块的路径名 14 | @property (nonatomic,assign,readonly) BOOL isRuning; 15 | - (instancetype)initWithModuleDirName:(NSString*)moduleDirName moduleName:(NSString*)moduleName; 16 | 17 | - (void)executeWithClass:(NSString*)className methodName:(NSString*)methodName parameter:(NSDictionary*)parameter success:(void(^)(id result))success fail:(void(^)(NSError* error))fail; 18 | @end 19 | -------------------------------------------------------------------------------- /iOS运行Python/YXPythonInterpreter.h: -------------------------------------------------------------------------------- 1 | // 2 | // YXPythonInterpreter.h 3 | // iOS运行Python 4 | // ji 5 | // Created by 谭德林 on 2017/9/1. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | @interface YXPythonInterpreter : NSObject 12 | @property (nonatomic,assign) BOOL running; 13 | - (void)beginTask:(nonnull void (^)())task completion:(nullable void (^)())completion; 14 | - (void)finalize; 15 | @end 16 | -------------------------------------------------------------------------------- /iOS运行Python/YXPythonInterpreter.m: -------------------------------------------------------------------------------- 1 | // 2 | // YXPythonInterpreter.m 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/9/1. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import "YXPythonInterpreter.h" 10 | 11 | @interface YXPythonInterpreter () 12 | 13 | @property (nonatomic,assign) dispatch_queue_t pythonQueue; 14 | @end 15 | 16 | @implementation YXPythonInterpreter 17 | 18 | 19 | - (instancetype)init 20 | { 21 | self = [super init]; 22 | if (self) { 23 | [self initialize]; 24 | } 25 | return self; 26 | } 27 | 28 | - (void)dealloc{ 29 | [self finalize]; 30 | } 31 | 32 | 33 | - (void)initialize 34 | { 35 | [self p_setupHomePath]; 36 | Py_Initialize(); 37 | PyEval_InitThreads(); 38 | if (Py_IsInitialized()) { 39 | NSLog(@"初始化环境成功"); 40 | } 41 | self.running = YES; 42 | 43 | } 44 | 45 | - (void)beginTask:(nonnull void (^)())task completion:(nullable void (^)())completion 46 | { 47 | 48 | dispatch_async(self.pythonQueue, ^{ 49 | 50 | task(); 51 | __weak typeof(self) weakSelf = self; 52 | if (completion){ 53 | dispatch_async(dispatch_get_main_queue(), ^{ 54 | weakSelf.running = NO; 55 | completion(); 56 | }); 57 | } 58 | }); 59 | } 60 | 61 | 62 | - (void)finalize 63 | { 64 | Py_Finalize(); 65 | self.running = NO; 66 | } 67 | 68 | 69 | #pragma mark - private 70 | 71 | - (void)p_setupHomePath { 72 | const char * frameworkPath = [[NSString stringWithFormat:@"%@/Resources",[self p_pythonFrameworkPath]] UTF8String]; 73 | wchar_t *pythonHome = _Py_char2wchar(frameworkPath, NULL); 74 | Py_SetPythonHome(pythonHome); 75 | } 76 | 77 | - (NSString*)p_pythonFrameworkPath{ 78 | NSString *documantPath = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).lastObject; 79 | NSString *newFrameworkPath = [documantPath stringByAppendingPathComponent:@"Python.framework"]; 80 | return newFrameworkPath; 81 | } 82 | 83 | 84 | #pragma mark - lazy 85 | - (dispatch_queue_t)pythonQueue { 86 | if (_pythonQueue== nil) { 87 | _pythonQueue = dispatch_get_global_queue(0, 0); 88 | } 89 | return _pythonQueue; 90 | } 91 | 92 | 93 | @end 94 | -------------------------------------------------------------------------------- /iOS运行Python/YXPythonTestViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // YXPythonTestViewController.h 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/9/11. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface YXPythonTestViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /iOS运行Python/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // iOS运行Python 4 | // 5 | // Created by 谭德林 on 2017/8/31. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /iOS运行Python/yj.py: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | def add(a,b): 5 | print "in python function add" 6 | print "a = " + str(a) 7 | print "b = " + str(b) 8 | print "ret = " + str(a+b) 9 | return 10 | 11 | def foo(a): 12 | 13 | print "in python function foo" 14 | print "a = " + str(a) 15 | print "ret = " + str(a * a) 16 | return 17 | 18 | class guestlist: 19 | def __init__(self): 20 | print "aaaa" 21 | def p(): 22 | print "bbbbb" 23 | def __getitem__(self, id): 24 | return "ccccc" 25 | def update(): 26 | guest = guestlist() 27 | print guest['aa'] 28 | -------------------------------------------------------------------------------- /iOS运行PythonTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS运行PythonTests/iOS__PythonTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // iOS__PythonTests.m 3 | // iOS运行PythonTests 4 | // 5 | // Created by 谭德林 on 2017/8/31. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface iOS__PythonTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation iOS__PythonTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /iOS运行PythonUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /iOS运行PythonUITests/iOS__PythonUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // iOS__PythonUITests.m 3 | // iOS运行PythonUITests 4 | // 5 | // Created by 谭德林 on 2017/8/31. 6 | // Copyright © 2017年 yj. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface iOS__PythonUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation iOS__PythonUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------