Skip to content

Commit

Permalink
Make nemo-dropbox compilation scripts Python3-compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardDopler committed Nov 28, 2015
1 parent a766dbb commit 744da22
Show file tree
Hide file tree
Showing 4 changed files with 255 additions and 256 deletions.
8 changes: 4 additions & 4 deletions nemo-dropbox/docgen.py
Expand Up @@ -3,7 +3,7 @@

# heeeheee
env = {"__name__":"__notmain__"}
execfile("dropbox", env)
exec(compile(open("dropbox").read(), "dropbox", 'exec'), env)
commands = env["commands"]

f = open("AUTHORS", "r")
Expand All @@ -13,13 +13,13 @@
formatted_commands = ""
for cmd in commands:
split = commands[cmd].__doc__.split('\n', 2)
formatted_commands += split[1].decode('ascii').replace(cmd, "`%s`" % cmd).replace("dropbox", "``dropbox``")
formatted_commands += split[2].decode('ascii').replace('\n', '\n | ')
formatted_commands += split[1].replace(cmd, "`%s`" % cmd).replace("dropbox", "``dropbox``")
formatted_commands += split[2].replace('\n', '\n | ')
formatted_commands += '\n\n'

sys.stdout.write(sys.stdin.read().replace\
('@AUTHORS@', authors).replace\
('@DATE@', datetime.date.today().isoformat()).replace\
('@PACKAGE_VERSION@', sys.argv[1]).replace\
('@SYNOPSIS@', '| '+'\n| '.join(commands[cmd].__doc__.split('\n', 2)[1].decode('ascii').replace(cmd, "`%s`" % cmd).replace("dropbox", "``dropbox``") for cmd in commands)).replace\
('@SYNOPSIS@', '| '+'\n| '.join(commands[cmd].__doc__.split('\n', 2)[1].replace(cmd, "`%s`" % cmd).replace("dropbox", "``dropbox``") for cmd in commands)).replace\
('@COMMANDS@', formatted_commands))

0 comments on commit 744da22

Please sign in to comment.