Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def reformat_white_space():
try:
import autopep8
except ImportError:
print(WARNING + "Could not find 'autopep8', exceeding whitespace will not be removed!" + TERMINATOR)
return
merchant_dir_path = os.path.abspath("./{{ cookiecutter.app_name }}")
args = autopep8.parse_args(['--max-line-length 119', '--in-place', '--recursive'])
if os.path.exists(merchant_dir_path):
autopep8.fix_multiple_files([merchant_dir_path], args)
cur_path = path.dirname(path.realpath(__file__))
except NameError:
# ASSUMES IN ROOT PATH - i.e. that wormpy package is in this folder
cur_path = os.getcwd()
wormpy_path = path.join(cur_path, 'wormpy')
stats_path = path.join(wormpy_path,'stats')
print(wormpy_path)
wormpy_files = glob.glob(path.join(wormpy_path, '*.py'))
root_files = glob.glob(path.join(cur_path, '*.py'))
stats_files = glob.glob(path.join(stats_path, '*.py'))
ap.fix_multiple_files(wormpy_files,options=options)
ap.fix_multiple_files(root_files, options=options)
ap.fix_multiple_files(stats_files, options=options)
experimental=False,
global_config=None,
ignore='',
ignore_local_config=False,
in_place=True,
indent_size=4,
jobs=0,
line_range=None,
list_fixes=False,
max_line_length=max_line_length,
pep8_passes=-1,
recursive=False,
select={'W', 'E'},
verbose=0,
hang_closing=False)
autopep8.fix_multiple_files(files, options, sys.stdout)
def fix_p2p8(directory):
import autopep8
import multiprocessing
# pylint: disable=protected-access
autopep8.fix_multiple_files([directory],
options=autopep8._get_options(
{
'jobs': multiprocessing.cpu_count(),
'verbose': True,
'recursive': True,
'in_place': True,
'max_line_length': 100
}, False))
def fix_p2p8(directory):
import autopep8
import multiprocessing
# pylint: disable=protected-access
autopep8.fix_multiple_files([directory],
options=autopep8._get_options(
{
'jobs': multiprocessing.cpu_count(),
'verbose': True,
'recursive': True,
'in_place': True,
'max_line_length': 100
}, False))