mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
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:
parent
1f32624e8b
commit
8009324a3b
11 changed files with 782 additions and 786 deletions
0
tools/__init__.py
Normal file
0
tools/__init__.py
Normal file
|
|
@ -1 +0,0 @@
|
|||
@python "%~dpn0" %*
|
||||
|
|
@ -1 +0,0 @@
|
|||
@python "%~dpn0" %*
|
||||
|
|
@ -1 +0,0 @@
|
|||
@python "%~dpn0" %*
|
||||
|
|
@ -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)
|
||||
Loading…
Add table
Add a link
Reference in a new issue