#
# Hyhyhy - https://github.com/MaciejCzyzewski/Hyhyhy
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Maciej A. Czyzewski
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Author: Maciej A. Czyzewski <maciejanthonyczyzewski@gmail.com>
#

import sys
import os

if sys.version_info < (3, 2):
    sys.exit("Hyhyhy requires python in version >= 3.2")

import configparser
import glob

__version__ = '1.0.0'

__help__ = '''
    Hyhyhy - Presentation nano-framework.            [v ''' + __version__ + ''']
        hyhyhy.py build     -     Build project to file
        hyhyhy.py status    -     Show project structure
    '''


def num(path):
    name = os.path.basename(path)
    name, ext = os.path.splitext(name)
    return int(name)


def prf(a):
    b = {
        'OK': '\033[92m[OK]\033[0m',
        'FAIL': '\033[91m[FAIL]\033[0m',
        'INFO': '\033[95m[INFO]\033[0m',
        'WARNING': '\033[93m[WARNING]\033[0m',
    }
    return b[str(a)]

assets, sections, default = list(glob.glob("assets/*")), list(glob.glob("sections/*")), 'default.cfg'
html = '<html><head>(head)</head><body>(body)</body></html>'

config = configparser.ConfigParser()
config.read(default)

sections.sort(key=num)


def get_head(a=""):
    global html, assets, sections

    if config['head']['charset']:
        a += "<meta charset='" + str(config['head']['charset']) + "'>"

    if config['head']['title']:
        a += "<title>" + str(config['head']['title']) + "</title>"

    for i in assets:
        print(prf('OK'), "Parsing file", i, "...")
        if i.split('.')[-1] == "css":
            a += "<style>" + str(open(i, 'r').read()) + "</style>"
        elif i.split('.')[-1] == "js":
            a += "<script>" + str(open(i, 'r').read()) + "</script>"

    return a


def get_body(a=""):
    global html, assets, sections

    for i in sections:
        print(prf('OK'), "Parsing file", i, "...")
        a += "<section>" + str(open(i, 'r').read()) + "</section>"

    return a


def get_html():
    global html

    html = html.replace('(head)', get_head())
    html = html.replace('(body)', get_body())

    return html


def init_build():
    global config

    if not os.path.exists(config['core']['build']):
        os.makedirs(config['core']['build'].split('/')[-2])

    with open(config['core']['build'], 'w') as build:
        build.write(get_html())

    print(prf('OK'), "Saved in", config['core']['build'], "->", config['head']['title'])


def init_status():
    global assets, sections

    print(prf('OK'), "Structure of project", "[" + str(len(sections)) + " slides]")

    print("   - assets/")

    for i in assets:
        if i.split('.')[-1] == "css":
            print("       -", i.split('/')[-1], "[style]")
        elif i.split('.')[-1] == "js":
            print("       -", i.split('/')[-1], "[script]")
        else:
            print("       -", i.split('/')[-1])

    print("   - sections/")

    for i in sections:
        print("       -", i.split('/')[-1])


if len(sys.argv) == 2 and sys.argv[1] == 'help':
    print(__help__)
else:
    print(prf('INFO'), "Starting hyhyhyhyhyhyhyhyhy", "...")
    print(prf('OK'), "Reading config file", default, "...")

    if len(sys.argv) == 2 and sys.argv[1] == 'status':
        init_status()
    else:
        init_build()

@@ -3592,19 +3592,16 @@
  print(%22
-   
 - assets
@@ -3602,16 +3602,26 @@
 assets/%22
+.rjust(14)
 )%0A%0A    f
@@ -3689,33 +3689,36 @@
      print(%22
-       -%22
+-%22.rjust(10)
 , i.split('/
@@ -3790,33 +3790,36 @@
      print(%22
-       -%22
+-%22.rjust(10)
 , i.split('/
@@ -3867,33 +3867,36 @@
      print(%22
-       -%22
+-%22.rjust(10)
 , i.split('/
@@ -3915,19 +3915,16 @@
  print(%22
-   
 - sectio
@@ -3927,16 +3927,26 @@
 ctions/%22
+.rjust(16)
 )%0A%0A    f
@@ -3982,17 +3982,20 @@
 nt(%22
-       -%22
+-%22.rjust(10)
 , i.
@@ -4012,16 +4012,47 @@
 %5B-1%5D)%0A%0A%0A
+if __name__ == '__main__':%0A    
 if len(s
@@ -4092,16 +4092,20 @@
 'help':%0A
+    
     prin
@@ -4116,22 +4116,30 @@
 help__)%0A
+    
 else:%0A
+    
     prin
@@ -4191,24 +4191,28 @@
  %22...%22)%0A    
+  
+  
 print(prf('O
@@ -4252,24 +4252,28 @@
 lt, %22...%22)%0A%0A
+    
     if len(s
@@ -4319,24 +4319,28 @@
 s':%0A        
+   
+ 
 init_status(
@@ -4341,16 +4341,20 @@
 tatus()%0A
+    
     else
@@ -4347,32 +4347,36 @@
 )%0A        else:%0A
+    
         init_bui

Replace spaces with '.rjust' function.