{ "info": { "author": "Michael Gill", "author_email": "michael.78912.8@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3" ], "description": "####\nTBIP\n####\n\n**********************************************\nTBIP- Tool for Building Installers with Python\n**********************************************\na flexible cross-platform package to create installers using Python\n\n.. contents::\n\nAbout\n-----\n\nTBIP is a package designed to let you build installers with python,\neasily and be very flexible at the same time.\n\nExample\n-------\n.. code-block:: python\n\n import io\n import os\n\n import tbip.installer as install\n from tbip.cli import CLI\n import tbip.uiutils as utils\n\n LICENCE = \"\"\"\n a fake licence.\n \"\"\"\n\n README = \"Howdy. Bye now, this thing does stuff.\"\n\n\n def main():\n installer = install.Installer(\n [\n utils.Readme(io.StringIO(README)),\n # a readme class\n utils.Licence(io.StringIO(LICENCE)),\n # a licence class\n utils.Choice('proceed with installation?'),\n # make sure you want to continue\n ],\n [\n utils.Readme(io.StringIO('you installed it. good work.'))\n # output message after installation\n ],\n # install to home directory/thing\n os.path.join(os.environ.get('HOME')\n or os.environ.get('USERPROFILE'), 'thing'),\n # use the CLI interface\n CLI,\n )\n\n # run the installer\n installer.run()\n\n if __name__ == '__main__':\n main()\n\na very small, but functional example of a script.\n\nUsage\n-----\nokay, say we had that script saved, and ready to use.\nbut what is the point? it's not going to actually install \nanything, because you havent even specified where to install!!\n\nthat's where the command line comes in handy. you should be able to\nrun this with :code:`python -m tbip -d `.\nthis will bundle your data in the installer script, as a zip file encoded\nin base64, to be extracted at runtime and installed from there on.\n\nInstallation\n------------\ninstall from :code:`pip install tbip`. or, clone the repository,\n:code:`git clone https://github.com/michael78912/tbip.git`, and run \n:code:`python3 setup.py install`\n\nAdvanced Usage\n--------------\n\nGetting Priveleges\n^^^^^^^^^^^^^^^^^^\n\nWindows\n\"\"\"\"\"\"\"\n\n:code:`tbip.get_admin()` should restart the program as an administrator.\nif not, the user probably has insufficient rights.\n\nUnix/Linux\n\"\"\"\"\"\"\"\"\"\"\n\n:code:`tbip.get_root()` should replace the current program with gksudo, \nnd run it as root.\n\nif it does not work, install gksudo in the package :code:`gksu`, and try again.\n\n\nItems\n^^^^^\n\n*a note on how items interact with their UI*: the UI object\nyou passed to :code:`Installer` was sent to each of the items you also sent.\nwhen an item's :code:`run` method is called, it is expected to return 1 of 2\nvalues, which is passed to the UI's :\n\n- 0: everything went OK, continue\n- 1: something happened, abort\n\nthere is a wider variety of items in tbip.uiutils that can be used during the installation.\nthey include:\n\n- Readme\n- Licence\n- Caller\n- Choice\n\nReadme\n\"\"\"\"\"\"\ndisplays a readme, and tells the user to press enter to continue.\n\n:code:`Readme(file)` --> tbip.uiutils.Readme object\n\nLicence\n\"\"\"\"\"\"\"\ndisplays a licence, preceded by the header \"LICENCE:\".\naks the user if this is OK and wants to continue.\n\n:code:`Licence(file)` --> tbip.uiutils.Licence object\n\nCaller\n\"\"\"\"\"\"\ncalls an external program, with the arguments specified.\njust a very thin wrapper around :code:`subprocess.call`.\n\n:code:`Caller(args)` --> tbip.uiutils.Caller object\n\nChoice\n\"\"\"\"\"\"\nprompts the user for a string, and acts accordingly.\nif the string enterd is not valid, prompt again.\n\n:code:`Choice(msg=\"continue?\", opts={'y': lambda: 0, 'n': lambda: 1}, ignorecase=True)` --> tbip.uiutils.Choice object\n\nInstallation progress\n^^^^^^^^^^^^^^^^^^^^^\n\nthere are sevreal ways to watch the installation progress\n(all accessed in :code:`tbip.installer.ProgressUtils`)\n\n+--------------------------------+------------------------------------+-----------+\n| Description | name | value |\n+================================+====================================+===========+\n| a progress bar | :code:`ProgressUtils.PROGRESS_BAR` | 0 |\n+--------------------------------+------------------------------------+-----------+\n| percentage | :code:`ProgressUtils.PERCENT` | 1 |\n+--------------------------------+------------------------------------+-----------+\n| displaying each file processed | :code:`ProgressUtils.FILES`- | 2 |\n+--------------------------------+------------------------------------+-----------+\n| do absolutely nothing | :code:`ProgressUtils.NULL` | 3 |\n+--------------------------------+------------------------------------+-----------+\n| at first, display a message | :code:`ProgressUtils.MSG` | 4 |\n+--------------------------------+------------------------------------+-----------+\n\nCommand Line options\n^^^^^^^^^^^^^^^^^^^^\n\ntbip uses PyInstaller_ internally to freeze the output scripts.\n\n.. _PyInstaller: https://www.pyinstaller.org/\n\nMiscellaneous:\n\n-h, --help display help\n-v, --version display version information\n\n-d, --data bundle this data with script in a zip file\n-o output filename of script\n-f, --freeze freeze the installer script\n\nPyInstaller specific:\n\n-u, --upx directory where UPX_ is installed (if at all)\n-w, --windowed use no console window (Windows specific)\n-i, --icon path to icon file (Windows specific)\n\n.. _UPX: https://upx.github.io/\n\nDeriving classes\n^^^^^^^^^^^^^^^^\n\nonly the classes UI and Item should be derived from. find the base classes for:\n\n- UI: :code:`tbip.ui.UI`\n- Item: :code:`tbip.uiutils.baseitem.Item`\n\nUser Interfaces\n\"\"\"\"\"\"\"\"\"\"\"\"\"\"\"\n\nthe CLI (Command Line Interface) is a UI. you can see here:\n\n.. code-block::python\n\n class _CLI(UI):\n \"\"\"class for handling all of the sending of items, and runs them in order.\"\"\"\n\n ProgressBar = ProgressBar\n\n class Percent:\n ...\n\n def __init__(self, outfile=sys.stdout, infile=sys.stdin):\n ...\n\n def echo(self, *args, fcolour=colorama.Fore.WHITE,\n ...\n\n def get_input(self, prompt='', length='*', strip=True):\n ...\n\n @staticmethod\n def getch(echo=True):\n ...\n\n @staticmethod\n def clear():\n ...\n\nall those methods should be overridden in a new class.\n(I actually haven't used :code:`getch` yet, but i might, so it would be good to)\n\nthey all should be self explanitory, but:\n\n:code:`echo` outputs the message to the screen in CLI it is just a wrapper around `print`. \nit should be able to take all of the arguments you see there, and act accordingly.\n\n:code:`get_input` should be able to read one line. the length parameter acts a bit like quantifiers in a regex.\n?: truncate it to one character, or 0\n+: will return if the string is one character or more, if it is null, will prompt again.\n\\*: any length (including 0)\n\n(of course, any integer will work too)\n\n:code:`getch` should read a single character. if echo is true, echo the character too.\n\n:code:`clear` should simply clear the display\n\nItems\n\"\"\"\"\"\n\nItems are easier. here is :code:`Caller`:\n\n.. code-block::python\n\n class Caller(Item):\n \"\"\"calls an external program\"\"\"\n\n def __init__(self, args):\n self.args = args\n\n def run(self):\n subprocess.call(self.args)\n return 0\n\nsimple, short and sweet. of course, this is a minimal example,\nyou can create any item you want to do anything you want!\n\nit must have :code:`run` overridden, because if you didn't, it would do nothing.\n*remember that :code:`run` must always return 1 or 0!*\n\nContributing\n------------\n\nany help is appreciated. if you want to help, please fork_ this repository,\nand create a pull request when you want to. also, please note any bugs,\nand if you have any suggestions, I would be glad to try them! thank you!\n\n.. _fork: https://github.com/Michael78912/tbip/fork\n\nIn the Future\n-------------\n\nI plan on making a GUI User interface. this is probably top of my list on things to\ndo. once again, if you have any suggestions, either make an issue, or email me at\nmichael.78912.8@gmail.com\n\n\n\n\n\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Michael78912/tbip", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "tbip", "package_url": "https://pypi.org/project/tbip/", "platform": "", "project_url": "https://pypi.org/project/tbip/", "project_urls": { "Homepage": "https://github.com/Michael78912/tbip" }, "release_url": "https://pypi.org/project/tbip/0.0.0.4/", "requires_dist": [ "colorama" ], "requires_python": "", "summary": "Build cross-platform installers", "version": "0.0.0.4" }, "last_serial": 4178729, "releases": { "0.0.0.1": [ { "comment_text": "", "digests": { "md5": "146481e3cea2bb3021b4599368687a24", "sha256": "efc9f39e313fdb6e151cc139f88ef6098e6df5f4e23d376a0a21f34d5c2dc6a1" }, "downloads": -1, "filename": "tbip-0.0.0.1-py3.4.egg", "has_sig": false, "md5_digest": "146481e3cea2bb3021b4599368687a24", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 34999, "upload_time": "2018-08-17T00:33:34", "url": "https://files.pythonhosted.org/packages/26/f0/36e03d7b1b048fc677df182dbf28e9cdab156b8c3b97c8ece15fb47a4ad2/tbip-0.0.0.1-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "7410e464ed6fb497fd1cf67e2a2554f0", "sha256": "cf84f1f98fb0784cd2834c4f851c22e9cae2aaabb958751fa8dc3a0464667c8b" }, "downloads": -1, "filename": "tbip-0.0.0.1.tar.gz", "has_sig": false, "md5_digest": "7410e464ed6fb497fd1cf67e2a2554f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16437, "upload_time": "2018-08-17T00:33:36", "url": "https://files.pythonhosted.org/packages/21/b1/417d24f2601618119b8380182b267f1a3459e36a2ce2e60e7df6edad3362/tbip-0.0.0.1.tar.gz" } ], "0.0.0.2": [ { "comment_text": "", "digests": { "md5": "895ead3793950bbc0a3d6b0559c64f76", "sha256": "c86e8a63e8093d4f1374ba45f8b1f1bbac80a6f1d86135f1691aafba5db178d9" }, "downloads": -1, "filename": "tbip-0.0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "895ead3793950bbc0a3d6b0559c64f76", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 18964, "upload_time": "2018-08-16T23:07:09", "url": "https://files.pythonhosted.org/packages/10/f1/b5d84257eb4631f4d2cd075b50a8b736c5860c43cee97c62040745984ab2/tbip-0.0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "bfa51a38f7203de62822060a574c2138", "sha256": "08a415a99bc14e55b0d3d531b0501dc1f47c93fc98c32c37a7da81847c9e12e4" }, "downloads": -1, "filename": "tbip-0.0.0.2.tar.gz", "has_sig": false, "md5_digest": "bfa51a38f7203de62822060a574c2138", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18158, "upload_time": "2018-08-16T23:07:10", "url": "https://files.pythonhosted.org/packages/ea/5f/3a8005ce3a41fa051da7cc49faecade28b8ffd9881d5ff7b9e6ac77d5be3/tbip-0.0.0.2.tar.gz" } ], "0.0.0.3": [ { "comment_text": "", "digests": { "md5": "5937cda9b535142a0442884d7e863e8a", "sha256": "30ed47b5813f14f9388add8991aee0f4db293acbb7c55c091df37d824eb3b912" }, "downloads": -1, "filename": "tbip-0.0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "5937cda9b535142a0442884d7e863e8a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16775, "upload_time": "2018-08-17T01:01:40", "url": "https://files.pythonhosted.org/packages/a8/c0/a55973bf807468f8007962fdb6f8965773fbc25f01cd404ed994011e00a0/tbip-0.0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b66acbb557c75c5f16bafa76ec7231fe", "sha256": "9c6f8f6582cd6bc92f72f15156cc5ea3c159c6e1398e5590cb4a04e0551f4767" }, "downloads": -1, "filename": "tbip-0.0.0.3.tar.gz", "has_sig": false, "md5_digest": "b66acbb557c75c5f16bafa76ec7231fe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16439, "upload_time": "2018-08-17T01:01:42", "url": "https://files.pythonhosted.org/packages/16/5e/c3ba22a22168f047419a33ce23e764e53492d1291638dcfb08e12cbb539e/tbip-0.0.0.3.tar.gz" } ], "0.0.0.4": [ { "comment_text": "", "digests": { "md5": "e191eb71eaeea074a03b70af3670ea7d", "sha256": "c773699990f564f79d4d4b7d6d6f6500727921a3cd7dd4e733a5a7f497fb6d70" }, "downloads": -1, "filename": "tbip-0.0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e191eb71eaeea074a03b70af3670ea7d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16761, "upload_time": "2018-08-17T02:41:18", "url": "https://files.pythonhosted.org/packages/98/32/db1b559d8ade1364a445c9cb37710c1237fd5c056e66702742ad7b92b51a/tbip-0.0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6975e7ddd6495c894eab91ac61e1038f", "sha256": "675ab30b32514b83708adb76ab1771ee071ed2ebd3d687bc6254a438923af0a3" }, "downloads": -1, "filename": "tbip-0.0.0.4.tar.gz", "has_sig": false, "md5_digest": "6975e7ddd6495c894eab91ac61e1038f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16393, "upload_time": "2018-08-17T02:41:20", "url": "https://files.pythonhosted.org/packages/f6/56/8395358bb27be638a64cb3b19cbb0d8093b335384e252553589d5fd79df9/tbip-0.0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e191eb71eaeea074a03b70af3670ea7d", "sha256": "c773699990f564f79d4d4b7d6d6f6500727921a3cd7dd4e733a5a7f497fb6d70" }, "downloads": -1, "filename": "tbip-0.0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "e191eb71eaeea074a03b70af3670ea7d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16761, "upload_time": "2018-08-17T02:41:18", "url": "https://files.pythonhosted.org/packages/98/32/db1b559d8ade1364a445c9cb37710c1237fd5c056e66702742ad7b92b51a/tbip-0.0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "6975e7ddd6495c894eab91ac61e1038f", "sha256": "675ab30b32514b83708adb76ab1771ee071ed2ebd3d687bc6254a438923af0a3" }, "downloads": -1, "filename": "tbip-0.0.0.4.tar.gz", "has_sig": false, "md5_digest": "6975e7ddd6495c894eab91ac61e1038f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16393, "upload_time": "2018-08-17T02:41:20", "url": "https://files.pythonhosted.org/packages/f6/56/8395358bb27be638a64cb3b19cbb0d8093b335384e252553589d5fd79df9/tbip-0.0.0.4.tar.gz" } ] }