pip_tkinter package¶
Subpackages¶
Submodules¶
pip_tkinter.config module¶
-
pip_tkinter.config.
find_bit_of_python
()[source]¶ Find whether system is running in 32 bit or 64 bit mode
-
pip_tkinter.config.
get_build_platform
()[source]¶ Get OS of the device Returns ‘Linux’, ‘Windows’ or ‘Darwin’
-
pip_tkinter.config.
get_python_distributions_in_linux
()[source]¶ Return path of Python executables in Linux Related information : PEP 3149 and PEP 3147 For example, Python3.4 may have multiple entries in /usr/bin :
- python3.4
- python3.4m
- python3.4d
- python3.4b
- python3
Although it is not clear whether they are symlinked, all of them used the same executable when they were tried to be executed
-
pip_tkinter.config.
get_python_distributions_in_macos
()[source]¶ Return path of Python executables in Mac OS Common install locations in python :
- /usr/bin/
- /usr/local/bin/
- /opt/local/bin (Homebrew installation)
-
pip_tkinter.config.
get_python_distributions_in_windows
()[source]¶ Return path of Python executables in Windows. Install locations can be found from windows registry. Possible registry keys :
- HKEY_CURRENT_USERSoftwarePython<Company><Tag><InstallPath>
- HKEY_LOCAL_MACHINESoftwarePython<Company><Tag><InstallPath>
- HKEY_LOCAL_MACHINEWow6432NodePython<Company><Tag><InstallPath>
pip_tkinter.install_page module¶
-
class
pip_tkinter.install_page.
InstallFromAlternateRepo
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
-
class
pip_tkinter.install_page.
InstallFromLocalArchive
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
-
abort_installation
()[source]¶ Stop pip installation : Currently not sure to provide option for aborting installation in between
Create back and next buttons
Navigate to previous frame
-
-
class
pip_tkinter.install_page.
InstallFromPyPI
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
-
abort_installation
()[source]¶ Stop pip installation : Currently not sure to provide option for aborting installation in between
-
create_multitem_treeview
()[source]¶ Create multitem treeview to show search results with headers : 1. Python Module 2. Installed version 3. Available versions
List of buttons : 1. navigate_back 2. navigate_next 3. search_button
Create back and next buttons
Navigate to previous frame
-
-
class
pip_tkinter.install_page.
InstallFromPythonlibs
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
-
abort_installation
()[source]¶ Stop pip installation : Currently not sure to provide option for aborting installation in between
Create back and next buttons, Also creates option menu for selecting compatibility tag
-
create_multitem_treeview
()[source]¶ Create multitem treeview to show search results with headers : 1. Python Module 2. Installed Version 3. Available Version
List of buttons : 1. navigate_back 2. navigate_next 3. search_button
Navigate to previous frame
-
sync_pythonlibs_packages
()[source]¶ Sync the json file for PythonLibs at : https://raw.githubusercontent.com/upendra-k14/pythonlibs_modules/master/pythonlibs.json
-
-
class
pip_tkinter.install_page.
InstallFromRequirements
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
-
abort_installation
()[source]¶ Stop pip installation : Currently not sure to provide option for aborting installation in between
Create ‘back’ and ‘next’ buttons
Navigate to previous frame
-
-
class
pip_tkinter.install_page.
InstallPage
(root, controller=None)[source]¶ Bases:
tkinter.ttk.Frame
Manage search and install. Implements GUI for
- Search and Install from PyPI
- Install from local archive
- Install from requirements file
- Install from PythonLibs
- Install from alternate repository
Create side navigation bar for providing user with options for selecting different ways of installation
-
manage_frames
()[source]¶ Manage multiple frames. Creates dictionary of multiple frames to be used for showing user different GUI frames for different ways of installation.
pip_tkinter.manage_installed_modules_page module¶
-
class
pip_tkinter.manage_installed_modules_page.
FreezeRequirementsPage
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
Page for providing options for ‘pip freeze’. User can generate requirement file and save it to desired location
Create nav and control buttons
-
create_multitem_treeview
()[source]¶ Create multitem treeview to show search results with headers : 1. Python Module 2. Installed version
Navigate to previous frame
-
class
pip_tkinter.manage_installed_modules_page.
ManageInstalledPage
(root, controller=None)[source]¶ Bases:
tkinter.ttk.Frame
Manage already installed packages. Implements GUI for
- Updating package
- Uninstalling package
-
create_process_log_frame
()[source]¶ Method to create last logging frame to keep the user updated with process. Logs real time output of pip process to tkinter text widget
Parameters: self.task_frame – a tkinter frame to enclose contents
Create side navigation bar for providing user with options for selecting different ways of installation
-
manage_frames
()[source]¶ Manage multiple frames. Creates dictionary of multiple frames to be used for showing user different GUI frames for different ways of installation.
-
class
pip_tkinter.manage_installed_modules_page.
UninstallPackage
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
-
abort_process
()[source]¶ Stop pip process : Currently not sure to provide option for aborting process in between
Create back and next buttons
-
create_multitem_treeview
()[source]¶ Create multitem treeview to show search results with headers : 1. Python Module 2. Installed version 3. Available versions
Navigate to previous frame
-
-
class
pip_tkinter.manage_installed_modules_page.
UpdatePackage
(parent, controller)[source]¶ Bases:
tkinter.ttk.Frame
-
abort_process
()[source]¶ Stop pip process : Currently not sure to provide option for aborting process in between
Create back and next buttons
-
create_multitem_treeview
()[source]¶ Create multitem treeview to show search results with headers : 1. Python Module 2. Installed version 3. Available versions
Navigate to previous frame
-
pip_tkinter.pip_extensions module¶
-
class
pip_tkinter.pip_extensions.
GUIListCommand
(*args, **kw)[source]¶ Bases:
pip.commands.list.ListCommand
Extending the pip ListCommand to show list of packages :
- For uninstall : retrieves list of installed packages with their versions
- For update : retrieved list of installed packages which are outdated
-
class
pip_tkinter.pip_extensions.
GUISearchCommand
(*args, **kw)[source]¶ Bases:
pip.commands.search.SearchCommand
Inherited the class : pip.commands.search.SearchCommand to override run method
Advantage of inheriting the class is that we can have better control of pip. For example, currently pip search gives output for latest version. But, we can retrieve output for all available versions.
Another advantage is that search can now be done with less time lag as compared to pip.main().
-
get_search_results
()[source]¶ This code is taken from pip.commands.search.print_results(). It is modified to return results in dictionary format instead of printing results For all the search results obtained, we can check if a package is already installed or not. If installed then the version of installed package is found and stored.
-
pip_tkinter.utils module¶
-
class
pip_tkinter.utils.
MultiItemsList
(parent, headers_list=None)[source]¶ Bases:
object
Class for creating Treeview to show list of packages : provides options for selecting items and specifying number of headers for the treeview
-
create_treeview
()[source]¶ Create a multi items list consisting of a frame, horizontal and vertical scroll bar and Treeview
-
headers_list
= None¶ headers_list: list of headers or fields in treeview
-
items_list
= None¶ self.items_list: list of items for treeview
-
parent
= None¶ parent: parent frame for treeview
-
populate_rows
(items_list=None)[source]¶ Populate treeview with list of items
Parameters: items_list – list of items by which treeview is populated
-
scroll_tree
= None¶ self.scroll_tree: tkinter treeview variable
-
-
class
pip_tkinter.utils.
Redirect
(stdfile, new_target)[source]¶ Bases:
object
Context manager for temporarily redirecting stdout/err. Simplified and generalize from contextlib.redirect_stdout. (DEPRECATED)
-
class
pip_tkinter.utils.
RunpipSubprocess
(argstring, output_queue)[source]¶ Bases:
object
Run pip with argument string containing command and options. Uses subprocess module for executing pip commands. Logs real time output in output queue.
In output queue a tuple object is sent consisting of two elements:
Output code : For identification of purpose of message
Code Purpose 0 Start marker for logging output to tkinter text widget 1 Output message 2 Error message 3 End marker for logging output to tkinter text widget
Message : a string variable containing the string collected from stdout and stderr streams
-
pip_tkinter.utils.
downloadfile
(url, update_queue)[source]¶ A utility function to download file in small chunks and also to return download percentage
Code Purpose 0 Start marker for logging output 1 Output message 2 End marker for logging output 3 Error message
-
pip_tkinter.utils.
pip_install_from_PyPI
(package_args=None, install_queue=None)[source]¶ Wrapper for installing pip package from PyPI
-
pip_tkinter.utils.
pip_install_from_alternate_repo
(package_args)[source]¶ Wrapper for installing pip package from Pythonlibs
-
pip_tkinter.utils.
pip_install_from_local_archive
(package_args, install_queue=None)[source]¶ Wrapper for installing pip package from local Archive
-
pip_tkinter.utils.
pip_install_from_pythonlibs
(package_url, install_queue=None)[source]¶ Install from pythonlibs packages in two steps :
- Download file
- Use pip install to install file
-
pip_tkinter.utils.
pip_install_from_requirements
(package_args, install_queue=None)[source]¶ Wrapper for installing pip package from requirements file
-
pip_tkinter.utils.
pip_search_command
(package_name=None, thread_queue=None)[source]¶ Uses subprocess to retrieve results of ‘pip search’
-
pip_tkinter.utils.
pythonlibs_search_command
(package_name=None, thread_queue=None)[source]¶ Search for packages in Pythonlibs packages record Convention for results tuple :
Each element of tuple consists of following elements in order: 1. package name 2. version 3. summary 4. home page 5. last updated 6. This element consists of distribution specific information. For more details continue below :
For each package in json format there are different possible distributions depending on compatibility tags like : py2, py3, cp27, cp34 and system architecture. Therefore sixth element is list of available distributions with following elements in order :
- compatibility_tag
- package_size
- architecture
For example :
``` “ViTables”: [
- {
- “last_updated”: “Dec 25, 2014”, “compatibility_tag”: “py2-none”, “summary”: “ViTables , a GUI for browsing and editing files in PyTables and HDF5 formats.”, “package_size”: “329 KB”, “home_page”: “http://vitables.org/”, “version”: “2.1”, “url”: “http://www.lfd.uci.edu/~gohlke/pythonlibs/6kbpejrn/ViTables-2.1-py2-none-any.whl”, “architecture”: “any”
}, {
“last_updated”: “Dec 25, 2014”, “compatibility_tag”: “py3-none”, “summary”: “ViTables , a GUI for browsing and editing files in PyTables and HDF5 formats.”, “package_size”: “328 KB”, “home_page”: “http://vitables.org/”, “version”: “2.1”, “url”: “http://www.lfd.uci.edu/~gohlke/pythonlibs/6kbpejrn/ViTables-2.1-py3-none-any.whl”, “architecture”: “any”}
-
pip_tkinter.utils.
runpip
(argstring)[source]¶ Run pip with argument string containing command and options.(DEPRECATED and replaced with runpip_using_subprocess method)
Parameters: argstring – is quoted version of what would follow ‘pip’ on command line.
-
pip_tkinter.utils.
runpip_using_subprocess
(argstring)[source]¶ Run pip with argument string containing command and options. Uses subprocess module for executing pip commands. Returns output and error once execution of process terminates
Parameters: argstring – is quoted version of what would follow ‘pip’ on command line.
pip_tkinter.welcome_page module¶
-
class
pip_tkinter.welcome_page.
WelcomePage
(root, controller)[source]¶ Bases:
tkinter.ttk.Frame
Ask user about what to do : 1. Install 2. Uninstall or Update
-
create_welcome_page
()[source]¶ Add content to welcome page and radio buttons for selecting among two tasks :
- Search and Install Package
- Manage already installed packages
Navigate to next frame in response to event generated by the next button
-