Skip to content

Commit 95cd2b8

Browse files
authored
Merge pull request nficano#13 from quiqua/clean_init
Clean init action
2 parents be648af + 3282c7a commit 95cd2b8

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

aws_lambda/aws_lambda.py

+7-9
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import boto3
1313
import pip
1414
import yaml
15-
from . import project_template
15+
1616
from .helpers import mkdir, read, archive, timestamp
1717

1818

@@ -137,15 +137,13 @@ def init(src, minimal=False):
137137
Minimal possible template files (excludes event.json).
138138
"""
139139

140-
path_to_project_template = project_template.__path__[0]
141-
for f in os.listdir(path_to_project_template):
142-
path_to_file = os.path.join(path_to_project_template, f)
143-
if minimal and f == 'event.json':
144-
continue
145-
if f.endswith('.pyc'):
146-
# We don't need the compiled files.
140+
templates_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),
141+
"project_templates")
142+
for filename in os.listdir(templates_path):
143+
if (minimal and filename == 'event.json') or filename.endswith('.pyc'):
147144
continue
148-
copy(path_to_file, src)
145+
destination = os.path.join(templates_path, filename)
146+
copy(destination, src)
149147

150148

151149
def build(src, local_package=None):

aws_lambda/project_template/__init__.py

Whitespace-only changes.

setup.py

+1-1
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)