Skip to content

Commit

Permalink
💚
Browse files Browse the repository at this point in the history
* Added `*.py` extension to all script files for Windows compatibility
  (Fixes #12 and #22)
* Fixed #21, pip-search with no arg issue
* Add sys.implementation to pyOSinfo (fixes #13)
* Bump version v1.0.5
  • Loading branch information
E3V3A committed Jan 23, 2022
1 parent 8da1154 commit 03a4594
Show file tree
Hide file tree
Showing 9 changed files with 45 additions and 11 deletions.
8 changes: 8 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
v1.0.5, 2022-01-23 -- New Release and bug fixes:

* Added `*.py` extension to all script files for Windows compatibility
(Fixes #12 and #22)
* Fixed #21, pip-search with no arg issue
* Add sys.implementation to pyOSinfo (fixes #13)
* Bump version v1.0.5

v1.0.4, 2022-01-22 -- New Release and bug fixes:

* Fixed PR #11 for venv exception handling
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ A simple *Python3* CLI tool to show the installation or modification times of al

| STATUS: | Version | Date | Maintained? |
|:------- |:------- |:---- |:----------- |
| Working | `1.0.4` | 2022-01-22 | YES |
| Working | `1.0.5` | 2022-01-23 | YES |

---

Expand Down
File renamed without changes.
File renamed without changes.
42 changes: 34 additions & 8 deletions pip-search.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
#----------------------------------------------------------------------
# File Name : pip-search.py
# Author : E:V:A
# Last Modified : 2022-01-22
# Version : 1.0.1
# Last Modified : 2022-01-23
# Version : 1.0.2
# License : GPLv3
# URL : https://github.com/E3V3A/pip-date
# Description : Getting a list of pip packages matching a string
Expand Down Expand Up @@ -39,33 +39,58 @@
import requests
from lxml import html

__author__ = "E:V:A (E3V3A)"
__copyright__ = "GPLv3 2022"
__version__ = '1.0.2'

debug = 0
showline = ' '+'-'*60

#TS = '{:%Y%m%d_%H%M%S}'.format(datetime.datetime.now())
TS = '{:%Y%m%d}'.format(datetime.datetime.now())
filename = 'tmp_piplist_{}.txt'.format(TS)

showline = ' '+'-'*60
name_list = []
match_list = []
my_headers = {'user-agent': 'curl/7.55.1','accept': 'application/json', 'content-type': 'application/json', 'referer': 'https://pypi.org/', 'cache-control': 'no-cache', 'connection': 'close'}

#----------------------------------------------------------
# Print Usage
#----------------------------------------------------------
def usage():
print('\n Usage: {} <partial-name> | "<RegEx>"\n'.format( os.path.basename(__file__)) )
print(' Getting a list of pip packages matching a partial name string.')
print(' The string can also be a RegEx for matching unknown packages.')
print(' This script is part of the \'pip-date\' package.')
print(" Please file any bug reports at:")
print(" https://github.com/E3V3A/pip-date/\n")
print(' Version: {}'.format(__version__))
print(' License: {}\n'.format(__copyright__))
sys.exit(2)

#----------------------------------------------------------
# CLI arguments
#----------------------------------------------------------
arg = "pyt"
narg = len(sys.argv) - 1
if narg != 1:
usage()
arg = sys.argv[1] # CLI provided search string (args[0])

rep = r'.*{}.*'.format(arg) # pattern
rec = re.compile(rep, re.I) # compiled

my_headers = {'user-agent': 'curl/7.55.1','accept': 'application/json', 'content-type': 'application/json', 'referer': 'https://pypi.org/', 'cache-control': 'no-cache', 'connection': 'close'}
name_list = []
match_list = []

#----------------------------------------------------------------------
# Utilitiy Functions
#----------------------------------------------------------------------

def print_warn():
print('\n Warning!')
print(' Searching all ~350,000 pip packages can take a very long time!')
print(' This script will first download the 19 MB (HTML) file, and only')
print(' then search the list for the content requested.')
print(' This can take up to 20 seconds.\n')


def save_list(file, data):
print(' Saving package list to file:\n ./{} '.format(file))
if os.path.exists(file):
Expand Down Expand Up @@ -150,6 +175,7 @@ def print_matches(name_list):
#----------------------------------------------------------------------
# Main
#----------------------------------------------------------------------

print_warn()

name_list = load_list(filename)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def readme():

setup(
name = 'pip-date',
version = '1.0.4',
version = '1.0.5',
author = 'E:V:A',
author_email = 'xdae3v3a@gmail.com',
description = 'Show the installation/modification times of all your pip packages and other tools',
Expand All @@ -29,7 +29,7 @@ def readme():
license='LICENSE.txt',
url = 'https://github.com/E3V3A/pip-date/',
packages = find_packages(),
scripts=['pip-date', 'pip-describe', 'pip-search.py', 'pipbyday', 'pyfileinfo', 'pyOSinfo'],
scripts=['pip-date.py', 'pip-describe.py', 'pip-search.py', 'pipbyday.py', 'pyfileinfo.py', 'pyOSinfo.py'],
keywords = 'pip date package management setuptools wheel egg stat os',
install_requires=[
'requests', 'lxml',
Expand Down

0 comments on commit 03a4594

Please sign in to comment.