Skip to content

Commit 2077584

Browse files
committed
Make "pypack.py pypack.py" possible
1 parent e55170c commit 2077584

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Quickly pack .py module into source distribution.
44

55
* no `setup.py` is needed
66
* resulting `.zip` file is **executable**
7+
(make sure there is main() function)
78

89
##### Usage
910

pypack.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
Public domain work by:
1616
anatoly techtonik <techtonik@gmail.com>
1717
"""
18+
19+
__version__ = '0.1'
20+
1821
import os
1922
import sys
2023

@@ -113,7 +116,7 @@ def lookup(match):
113116
)
114117
"""
115118

116-
if __name__ == '__main__':
119+
def main():
117120
if not sys.argv[1:]:
118121
sys.exit("usage: pack.py <module.py>")
119122

@@ -147,3 +150,5 @@ def lookup(match):
147150
zf.writestr('PKG-INFO', '')
148151
zf.close()
149152

153+
if __name__ == '__main__':
154+
main()

0 commit comments

Comments
 (0)