Skip to content
This repository was archived by the owner on Mar 15, 2026. It is now read-only.

Commit 73f6ce5

Browse files
author
Marcel Radischat
authored
Merge pull request #2 from quiqua/clean_init
Clean init
2 parents ba0a103 + 3282c7a commit 73f6ce5

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
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') or filename.endswith('.pyc'):
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, requirements=False, local_package=None):

aws_lambda/project_template/__init__.py

Whitespace-only changes.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
url='https://github.com/nficano/python-lambda',
3030
packages=find_packages(),
3131
package_data={
32-
'aws_lambda': ['templates/*'],
32+
'aws_lambda': ['project_templates/*'],
3333
'': ['*.json'],
3434
},
3535
include_package_data=True,

0 commit comments

Comments
 (0)