Skip to content

Commit

Permalink
Fixed issue with 'other' output file.
Browse files Browse the repository at this point in the history
  • Loading branch information
brevityinmotion committed May 17, 2022
1 parent 4b6af8d commit 324292d
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 3 deletions.
57 changes: 57 additions & 0 deletions build/prod-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

NEWENVIRONMENT='virtualenv'

cd $HOME/environment/
mkdir $NEWENVIRONMENT
cd $NEWENVIRONMENT
virtualenv v-env
source ./v-env/bin/activate

# Install packages
#pip install pandas
#pip install tldextract
#pip install argparse
#pip install regex
#pip install networkx
#pip install bokeh
#pip install scipy
#python3 -m pip install --index-url https://test.pypi.org/simple/ --no-deps goodfaith-brevityinmotion-0.0.1

#python3 -m pip install -i https://test.pypi.org/simple/ goodfaith

#python3 -m pip install $HOME/environment/goodfaith/dist/goodfaith-1.0.3.tar.gz
python3 -m pip install goodfaith

mkdir goodfaith
cd goodfaith
cp -r $HOME/environment/goodfaith/* .

deactivate

chmod 777 -R $HOME/environment/virtualenv/
# source $HOME/environment/$NEWENVIRONMENT/v-env/bin/activate
# chmod -R 777 $HOME/environment/


# ./__main__.py -s $HOME/environment/virtualenv/samples/scope.json -i $HOME/environment/virtualenv/samples/brevityinmotion-urls-max.txt -o $HOME/environment/virtualenv/output

# python3 -m pip install --upgrade build


# python3 -m pip install --upgrade twine

# python3 -m twine upload --repository testpypi dist/*

# To build project:
# Run the following from root of project:
# python3 -m build
# Then cd into the build folder and run:
# sh testinstall.sh
# Run the following to enable the virtual environment
# source $HOME/environment/virtualenv/v-env/bin/activate
# Can begin to run the test cases
# goodfaith -s $HOME/environment/virtualenv/goodfaith/samples/scope.json -i $HOME/environment/virtualenv/goodfaith/samples/brevityinmotion-urls-max.txt -o $HOME/environment/virtualenv/output -v
# python3 __main__.py -s $HOME/environment/virtualenv/goodfaith/samples/scope.json -i $HOME/environment/virtualenv/goodfaith/samples/brevityinmotion-urls-max.txt -o $HOME/environment/virtualenv/output -v

# python3 -m twine upload dist/* --verbose
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = goodfaith
version = 1.0.3
version = 1.0.4
author = Ryan Elkins
author_email = [email protected]
description = hack with 'goodfaith'
Expand Down
5 changes: 3 additions & 2 deletions src/goodfaith/core/scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ def boundaryGuard(dfAllURLs, outputDir, programScope, quietMode, debugMode, outp

# Create DataFrames containing sorted URLs
dfURLsIn = dfAllURLs[(dfAllURLs['scope'] == 'in') | (dfAllURLs['scope'] == 'wild')]
dfURLsMod = dfAllURLs[dfAllURLs['scope'] != 'out']
dfURLsMod = dfAllURLs[dfAllURLs['scope'] == 'other']
# dfURLsMod = dfAllURLs[(dfAllURLs['scope'] != 'out') | (dfAllURLs['scope'] != 'in') | (dfAllURLs['scope'] != 'wild')]
dfURLsOut = dfAllURLs[dfAllURLs['scope'] == 'out']

if (outputDir != 'NoOutput'):
Expand All @@ -140,7 +141,7 @@ def boundaryGuard(dfAllURLs, outputDir, programScope, quietMode, debugMode, outp
with open(statsFile, "a") as file_object:
file_object.write('Total number of urls: ' + str(len(dfAllURLs['url'].drop_duplicates())))
file_object.write('\n')
file_object.write('Number of urls not explicitly out-of-scope: ' + str(len(dfURLsMod['url'].drop_duplicates())))
file_object.write('Number of urls not in scope but not explicitly out-of-scope: ' + str(len(dfURLsMod['url'].drop_duplicates())))
file_object.write('\n')
file_object.write('Number of urls in-scope: ' + str(len(dfURLsIn['url'].drop_duplicates())))
file_object.write('\n')
Expand Down

0 comments on commit 324292d

Please sign in to comment.