-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from TomConlin/master
Static analysis refactoring
- Loading branch information
Showing
93 changed files
with
8,600 additions
and
5,030 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,29 @@ | ||
__author__ = 'nicole' | ||
|
||
import json | ||
import os.path | ||
import logging | ||
|
||
__author__ = 'nicole' | ||
|
||
logger = logging.getLogger(__name__) | ||
|
||
#read configuration file | ||
# read configuration file | ||
conf = {} | ||
|
||
#load the configuration file, if it exists. | ||
#it isn't required, but may be for some sources | ||
''' | ||
Load the configuration file 'conf.json', if it exists. | ||
it isn't always required, but may be for some sources. | ||
''' | ||
|
||
if os.path.exists(os.path.join(os.path.dirname(__file__), 'conf.json')): | ||
with open(os.path.join(os.path.dirname(__file__), | ||
'conf.json')) as json_file: | ||
with open( | ||
os.path.join(os.path.dirname(__file__), | ||
'conf.json')) as json_file: | ||
conf = json.load(json_file) | ||
logger.debug("Finished loading config") | ||
else: | ||
logger.warning("'conf.json' not found in '%s'", os.path.dirname(__file__)) | ||
logger.warning("Sources that depend on 'conf.json' will fail") | ||
|
||
|
||
def get_config(): | ||
return conf | ||
return conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#! /bin/bash | ||
|
||
# Requires | ||
# pip3 install pycallgraph | ||
# [yum|apt-get] install graphviz | ||
|
||
|
||
|
||
# relative path to where the output goes | ||
outdir="./callgraph" | ||
|
||
rm -fr ${outdir} | ||
|
||
for src in `find . -type f -name "*.py" -exec echo \{\} \\;`; do | ||
|
||
oldpth="${src%/*}" # drop all from last slash on | ||
basefn="${src##.*/}" # drop all up to & inc last slash | ||
newpth="${outdir}${oldpth#.}" # drop leading dot | ||
rtname="${basefn%.py}" # drop ".py" suffix | ||
|
||
# echo "src: ${src}" | ||
|
||
if [ ! -d ${newpth} ] ; then | ||
mkdir -p ${newpth} | ||
# echo "mkdir: ${newpth}" | ||
fi | ||
# echo "oldpth: ${oldpth}" | ||
# echo "basefn: ${basefn}" | ||
# echo "newpth: ${newpth}" | ||
# echo "rtname: ${rtname}" | ||
# echo "" | ||
|
||
|
||
echo "pycallgraph graphviz --output-file=\"${newpth}/${rtname}.png\" -- \"${src}\"" | ||
echo "" | ||
done |
Oops, something went wrong.