Skip to content

Commit 6419597

Browse files
author
Marcel Radischat
committed
Simplify init action
1 parent 65e9b94 commit 6419597

File tree

5 files changed

+7
-36
lines changed

5 files changed

+7
-36
lines changed

aws_lambda/aws_lambda.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import boto3
1212
import pip
1313
import yaml
14-
from . import project_template
14+
1515
from .helpers import mkdir, read, archive, timestamp
1616

1717

@@ -93,15 +93,13 @@ def init(src, minimal=False):
9393
Minimal possible template files (excludes event.json).
9494
"""
9595

96-
path_to_project_template = project_template.__path__[0]
97-
for f in os.listdir(path_to_project_template):
98-
path_to_file = os.path.join(path_to_project_template, f)
99-
if minimal and f == 'event.json':
100-
continue
101-
if f.endswith('.pyc'):
102-
# We don't need the compiled files.
96+
templates_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
97+
"project_templates")
98+
for filename in os.listdir(templates_path):
99+
if minimal and filename == 'event.json':
103100
continue
104-
copy(path_to_file, src)
101+
destination = os.path.join(templates_path, filename)
102+
copy(destination, src)
105103

106104

107105
def build(src, local_package=None):

aws_lambda/project_template/__init__.py

Whitespace-only changes.

aws_lambda/project_template/config.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

aws_lambda/project_template/event.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

aws_lambda/project_template/service.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

0 commit comments

Comments
 (0)