Skip to content
This repository has been archived by the owner on Dec 6, 2019. It is now read-only.

Commit

Permalink
Version 0.2.0: Adds a command-line script to find urls
Browse files Browse the repository at this point in the history
  • Loading branch information
automationator committed Aug 30, 2018
1 parent fd1782a commit 64b3b72
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 2 deletions.
File renamed without changes.
20 changes: 20 additions & 0 deletions bin/urlfinder
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3

import urlfinderlib
import sys

if __name__ == '__main__':
try:
file_path = sys.argv[1]
except:
print('Usage: urlfinder /path/to/file')
sys.exit(1)

try:
with open(file_path, 'rb') as f:
urls = sorted(list(set(urlfinderlib.find_urls(f.read()))))
for url in urls:
print(url)
except:
print('Usage: urlfinder /path/to/file')
sys.exit(1)
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
here = path.abspath(path.dirname(__file__))

# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
with open(path.join(here, 'README'), encoding='utf-8') as f:
long_description = f.read()

setup(
Expand All @@ -23,10 +23,11 @@
# Versions should comply with PEP440. For a discussion on single-sourcing
# the version across setup.py and the project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.1.2',
version='0.2.0',

description='Library to find URLs and check their validity.',
long_description=long_description,
long_description_content_type='text/markdown',

# The project's main homepage.
url='https://github.com/IntegralDefense/urlfinderlib',
Expand Down Expand Up @@ -94,6 +95,8 @@
#'sample': ['package_data.dat'],
},

scripts=['bin/urlfinder'],

# Although 'package_data' is the preferred approach, in some case you may
# need to place data files outside of your packages. See:
# http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa
Expand Down

0 comments on commit 64b3b72

Please sign in to comment.