|
|
|
@ -38,15 +38,21 @@ def split_to_parts(line, mod_desc=None):
|
|
|
|
|
|
|
|
|
|
def store_to_file(dest, parts):
|
|
|
|
|
for package, line in parts:
|
|
|
|
|
dir_path = os.path.abspath(dest)
|
|
|
|
|
dirpath = os.path.abspath(dest)
|
|
|
|
|
filename = package
|
|
|
|
|
|
|
|
|
|
if not os.path.exists(dir_path):
|
|
|
|
|
os.makedirs(dir_path)
|
|
|
|
|
open(os.path.join(dir_path, '__init__.py'), 'w').close()
|
|
|
|
|
open(os.path.join(dir_path, '.mock-generated'), 'w').close()
|
|
|
|
|
if not os.path.exists(dirpath):
|
|
|
|
|
os.makedirs(dirpath)
|
|
|
|
|
open(os.path.join(dirpath, '__init__.py'), 'w').close()
|
|
|
|
|
open(os.path.join(dirpath, '.mock-generated'), 'w').close()
|
|
|
|
|
|
|
|
|
|
with open(os.path.join(dir_path, filename + '.py'), 'a') as f:
|
|
|
|
|
filepath = os.path.join(dirpath, filename + '.py')
|
|
|
|
|
|
|
|
|
|
if not os.path.exists(filepath):
|
|
|
|
|
with open(filepath, 'a') as f:
|
|
|
|
|
f.write('from typing import *\n')
|
|
|
|
|
|
|
|
|
|
with open(filepath, 'a') as f:
|
|
|
|
|
f.write(line)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|