{ "info": { "author": "Hiroaki Itoh", "author_email": "xwhhsprings@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Console", "Intended Audience :: End Users/Desktop", "License :: OSI Approved :: BSD License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Utilities" ], "description": "pwdpp\n*****\n\"pwdpp\" is a portable pwd (print working directory) written in Python.\n\nRequirements\n============\n* Python 2.7 or later\n* `psutil `_ if you use the official CPython Windows binary.\n\nUsage\n=====\n::\n\n you@yourhost: ~$ pwdpp --help\n\n usage: pwdpp [-h] [-P] [-L] [-s {bs,fs}] [-W]\n \n Print the full filename of the current working directory.\n \n optional arguments:\n -h, --help show this help message and exit\n -P, --physical \n avoid all symlinks (default).\n (if your system can reveal symlinks.)\n \n -L, --logical \n use PWD from environment, even if it\n contains symlinks. \n (if your system can't detect symlinks,\n this option has no effect.)\n \n -s {bs,fs}, --pathsep {bs,fs}\n \n specify path separator.\n (bs: backslash / fs: forward slash.)\n \n -W \n print the Win32 value of the physical\n directory. this is a simple emulation of\n bash's pwd on MSYS(2). Of course, this makes\n no sense on *nix.\n \nYou might have to set `PYTHONIOENCODING` environment variable, like 'PYTHONIOENCODING=utf-8'.\n\nMotivation\n==========\n1. bash's builtin pwd of msys and msys2 has windows specific *-W* option for printing the real windows path.\n2. but bash's builtin pwd of cygwin doesn't have it.\n3. *-W* option is of course windows specific, so we can never use it in \\*nix platform.\n4. Cygwin, msys, and msys2 each maintain their own mount tables, and the absolute path expressions based thereon are different from each other.\n\n * If you are in these boxes, normally you want to follow these manners.\n * But sometimes you need to know the path as Windows native path.\n * If so, the lack of *-W* on cygwin's pwd is the matter.\n\n\nUsing pwdpp as Python module\n============================\n*pwdpp* as a module is very simple, it exposes only two methods and one variable:\n\n::\n\n >>> import os\n >>> import pwdpp\n >>> pwdpp.__all__\n [u'caller_type', u'curdir', u'main']\n >>> pwdpp.caller_type\n (u'win32', u'mingw32', u'C:\\\\MinGW\\\\msys\\\\1.0\\\\bin\\\\sh.exe')\n >>> help(pwdpp.curdir)\n Help on function curdir in module pwdpp:\n \n curdir(physical, winpath=False)\n Return the current directory according to the following rules:\n +---------------+-----------------------------+----------------------+\n | from | python | default |\n +===============+=============================+======================+\n | cmd.exe | official CPython on windows | follow the behavior |\n | | | of windows native. |\n +---------------+-----------------------------+----------------------+\n | msys | official CPython on windows | follow the behavior |\n | (bash, etc.) +-----------------------------+ of MSYS. |\n | | msys CPython? if any, | |\n +---------------+-----------------------------+----------------------+\n | msys2 | official CPython on windows | follow the behavior |\n | (bash, etc.) +-----------------------------+ of MSYS2. |\n | | msys2 CPython | |\n +---------------+-----------------------------+----------------------+\n | cygwin | official CPython on windows | follow the behavior |\n | (bash, etc.) +-----------------------------+ of cygwin. |\n | | cygwin CPython | |\n +---------------+-----------------------------+----------------------+\n | *nix shell | various | follow the behavior |\n | | | of *nix native. |\n +---------------+-----------------------------+----------------------+\n Except but the case following windows native, physical=True\n corresponds to \"pwd -P\", physical=False corresponds to \"pwd -L\".\n \n If winpath=True, this function follow the behavior of windows native,\n even if cygwin. Of course this makes no sense on real *nix.\n \n >>> pwdpp.curdir(True, True)\n u'c:\\\\Users\\\\hhsprings\\\\work'\n >>> pwdpp.curdir(True, False)\n u'/c/Users\\\\hhsprings\\\\work'\n >>> os.chdir(\"c:/MinGW/msys/1.0/bin\") # my msys root\n >>> pwdpp.curdir(True, True)\n u'c:\\\\MinGW\\\\msys\\\\1.0\\\\bin'\n >>> pwdpp.curdir(True, False)\n u'\\\\usr\\\\bin'\n >>> pwdpp.curdir(True, False).replace(u\"\\\\\", u\"/\")\n u'/usr/bin'\n\n`main` is just an entry point to CLI.\n\nHistory\n=======\n\n1.0.6 (2017-8-09)\n~~~~~~~~~~~~~~~~~\n* source code is identical to 1.0.3. (just for uploading to pypi.)\n\n1.0.4 - 1.05 (2017-8-09)\n~~~~~~~~~~~~~~~~~~~~~~~~\n* missing. this is just mistake to upload to pypi.\n\n1.0.3 (2017-8-09)\n~~~~~~~~~~~~~~~~~\n* fix if cwd is msys root.\n\n1.0.2 (2017-8-09)\n~~~~~~~~~~~~~~~~~\n* fix if parent is 'env.exe'.\n* second item of caller_type was broken...\n\n1.0.1 (2017-8-09)\n~~~~~~~~~~~~~~~~~\n* fix unicode problem (python 3.x)\n\n1.0.0 (2017-8-09)\n~~~~~~~~~~~~~~~~~\n* first release\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/hhsprings/pwdpp", "keywords": "pwd", "license": "BSD 3-Clause License", "maintainer": "", "maintainer_email": "", "name": "pwdpp", "package_url": "https://pypi.org/project/pwdpp/", "platform": "", "project_url": "https://pypi.org/project/pwdpp/", "project_urls": { "Homepage": "https://bitbucket.org/hhsprings/pwdpp" }, "release_url": "https://pypi.org/project/pwdpp/1.0.6/", "requires_dist": null, "requires_python": "", "summary": "Portable pwd (print working directory).", "version": "1.0.6" }, "last_serial": 3084165, "releases": { "1.0.6": [ { "comment_text": "", "digests": { "md5": "66323606866696e8f9f05245c85724b8", "sha256": "e76a872e838a0cfa50a03de42e03702fcd4ea927212c5b9e1790fae7e71ed142" }, "downloads": -1, "filename": "pwdpp-1.0.6.tar.gz", "has_sig": false, "md5_digest": "66323606866696e8f9f05245c85724b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7071, "upload_time": "2017-08-09T14:49:16", "url": "https://files.pythonhosted.org/packages/d7/4c/2a3241b9ec3695d1087c0b37cc6a100f0f67022b63c39f698e71d07ea638/pwdpp-1.0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66323606866696e8f9f05245c85724b8", "sha256": "e76a872e838a0cfa50a03de42e03702fcd4ea927212c5b9e1790fae7e71ed142" }, "downloads": -1, "filename": "pwdpp-1.0.6.tar.gz", "has_sig": false, "md5_digest": "66323606866696e8f9f05245c85724b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7071, "upload_time": "2017-08-09T14:49:16", "url": "https://files.pythonhosted.org/packages/d7/4c/2a3241b9ec3695d1087c0b37cc6a100f0f67022b63c39f698e71d07ea638/pwdpp-1.0.6.tar.gz" } ] }