restructure the whole way scripts are created, using setuptools magic

to take care of creating .exe wrappers for windows.

To make this work needed to
- rename modules with a "-" in it (not a valid name)
- add an __init__.py to the tools directory
- create an entry point dictionary which stores the right associations
This commit is contained in:
Andrea Crotti 2012-03-07 10:33:46 +00:00
commit 8009324a3b
11 changed files with 782 additions and 786 deletions

0
tools/__init__.py Normal file
View file

View file

@ -1 +0,0 @@
@python "%~dpn0" %*

View file

@ -1 +0,0 @@
@python "%~dpn0" %*

View file

@ -1 +0,0 @@
@python "%~dpn0" %*

View file

@ -231,18 +231,7 @@ def fields2pelican(fields, out_markup, output_path, dircat=False):
fs.write(header + content)
def main(input_type, input, out_markup, output_path, dircat=False):
if input_type == 'wordpress':
fields = wp2fields(input)
elif input_type == 'dotclear':
fields = dc2fields(input)
elif input_type == 'feed':
fields = feed2fields(input)
fields2pelican(fields, out_markup, output_path, dircat=dircat)
if __name__ == '__main__':
def main():
parser = argparse.ArgumentParser(
description="Transform feed, Wordpress or Dotclear files to rst files."
"Be sure to have pandoc installed")
@ -280,4 +269,13 @@ if __name__ == '__main__':
error("Couldn't create the output folder: " + args.output)
exit()
main(input_type, args.input, args.markup, args.output, dircat=args.dircat)
input_type, input, out_markup, output_path, dircat=False = input_type, args.input, args.markup, args.output, args.dircat
if input_type == 'wordpress':
fields = wp2fields(input)
elif input_type == 'dotclear':
fields = dc2fields(input)
elif input_type == 'feed':
fields = feed2fields(input)
fields2pelican(fields, out_markup, output_path, dircat=dircat)