fix: method call in console_scripts
This commit is contained in:
2
Makefile
2
Makefile
@@ -8,7 +8,7 @@ install:
|
|||||||
uninstall:
|
uninstall:
|
||||||
python3 -m pip uninstall abcddb2vcard
|
python3 -m pip uninstall abcddb2vcard
|
||||||
rm -rf ./*.egg-info/
|
rm -rf ./*.egg-info/
|
||||||
-rm -i "$$(which abcddb2vcard)" "$$(which vcard2img)"
|
@-rm -i "$$(which abcddb2vcard)" "$$(which vcard2img)"
|
||||||
|
|
||||||
dist: setup.py abcddb2vcard/*
|
dist: setup.py abcddb2vcard/*
|
||||||
[ -z "$${VIRTUAL_ENV}" ] # you can not do this inside a virtual environment.
|
[ -z "$${VIRTUAL_ENV}" ] # you can not do this inside a virtual environment.
|
||||||
|
|||||||
@@ -2,6 +2,6 @@
|
|||||||
'''
|
'''
|
||||||
Convert AddressBook database (.abcddb) to Contacts VCards file (.vcf)
|
Convert AddressBook database (.abcddb) to Contacts VCards file (.vcf)
|
||||||
'''
|
'''
|
||||||
__version__ = '1.0.0'
|
__version__ = '1.0.1'
|
||||||
|
|
||||||
from .ABCDDB import ABCDDB
|
from .ABCDDB import ABCDDB
|
||||||
|
|||||||
@@ -1,2 +1,4 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
from . import abcddb2vcard # execute sub-module code
|
from .abcddb2vcard import main
|
||||||
|
|
||||||
|
main()
|
||||||
|
|||||||
@@ -11,10 +11,11 @@ try:
|
|||||||
except ImportError: # fallback if not run as module
|
except ImportError: # fallback if not run as module
|
||||||
from ABCDDB import ABCDDB # type: ignore[import, no-redef]
|
from ABCDDB import ABCDDB # type: ignore[import, no-redef]
|
||||||
|
|
||||||
|
|
||||||
DB_FILE = str(Path.home().joinpath(
|
DB_FILE = str(Path.home().joinpath(
|
||||||
'Library', 'Application Support', 'AddressBook', 'AddressBook-v22.abcddb'))
|
'Library', 'Application Support', 'AddressBook', 'AddressBook-v22.abcddb'))
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
cli = ArgumentParser(description=__doc__)
|
cli = ArgumentParser(description=__doc__)
|
||||||
cli.add_argument('output', type=str, metavar='outfile.vcf',
|
cli.add_argument('output', type=str, metavar='outfile.vcf',
|
||||||
help='VCard output file.')
|
help='VCard output file.')
|
||||||
@@ -45,4 +46,6 @@ with open(args.output, 'w') as f:
|
|||||||
f.write(rec.makeVCard())
|
f.write(rec.makeVCard())
|
||||||
print(len(contacts), 'contacts.')
|
print(len(contacts), 'contacts.')
|
||||||
|
|
||||||
exit()
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import sys
|
|||||||
from base64 import b64decode
|
from base64 import b64decode
|
||||||
from argparse import ArgumentParser, FileType
|
from argparse import ArgumentParser, FileType
|
||||||
|
|
||||||
|
|
||||||
|
def main() -> None:
|
||||||
cli = ArgumentParser(description=__doc__)
|
cli = ArgumentParser(description=__doc__)
|
||||||
cli.add_argument('input', type=FileType('r'), metavar='infile.vcf',
|
cli.add_argument('input', type=FileType('r'), metavar='infile.vcf',
|
||||||
help='VCard input file.')
|
help='VCard input file.')
|
||||||
@@ -51,4 +53,7 @@ for line in args.input.readlines():
|
|||||||
fw.write(b64decode(img))
|
fw.write(b64decode(img))
|
||||||
|
|
||||||
print(c1, 'contacts.', c2, 'images.')
|
print(c1, 'contacts.', c2, 'images.')
|
||||||
exit()
|
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
||||||
|
|||||||
4
setup.py
4
setup.py
@@ -15,8 +15,8 @@ setup(
|
|||||||
packages=['abcddb2vcard'],
|
packages=['abcddb2vcard'],
|
||||||
entry_points={
|
entry_points={
|
||||||
'console_scripts': [
|
'console_scripts': [
|
||||||
'abcddb2vcard=abcddb2vcard.abcddb2vcard',
|
'abcddb2vcard=abcddb2vcard.abcddb2vcard:main',
|
||||||
'vcard2img=abcddb2vcard.vcard2img',
|
'vcard2img=abcddb2vcard.vcard2img:main',
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|||||||
Reference in New Issue
Block a user