| 26 | return 0 |
| 27 | |
| 28 | def unwrap(args): |
| 29 | l = args.input.readline() |
| 30 | firstline = True |
| 31 | while l: |
| 32 | if len(l) > 80: |
| 33 | print("Error: input line invalid (longer than 80 characters)", file=sys.stderr) |
| 34 | return 1 |
| 35 | if not firstline and l[0] != ' ': |
| 36 | print("Error: continuation line not start with blank", file=sys.stderr) |
| 37 | return 1 |
| 38 | |
| 39 | if len(l) > 71 and l[71] == '*': |
| 40 | if firstline: |
| 41 | args.output.write(l[:71]) |
| 42 | firstline = False |
| 43 | else: |
| 44 | args.output.write(l[1:71]) |
| 45 | else: |
| 46 | if firstline: |
| 47 | args.output.write(l) |
| 48 | else: |
| 49 | args.output.write(l[1:]) |
| 50 | firstline = True |
| 51 | l = args.input.readline() |
| 52 | return 0 |
| 53 | |
| 54 | def Main(): |
| 55 | parser = argparse.ArgumentParser(description="Wrap sidedeck source to card formats") |