#!/usr/bin/env python
# -*- coding: utf-8 -*-

""" Show all scribus commands. """

import sys

try:
    from scribus import *
except ImportError:
    print("This script only runs from within Scribus.")
    sys.exit(1)

import os

d = dir(scribus)
for j in d:
   try:
       exec('res = '+j+'.__doc__')
       if res[0:5] == 'float':
           print('\nCONSTANT:\n',j,'\nVALUE: float')
           exec('print '+j+'\n')
       elif res[0:5] == 'int(x':
           print('\nCONSTANT:\n',j,'\nVALUE: integer')
           exec('print '+j+'\n')
       elif res[0:5] == 'tuple':
           print('\nTUPLE:\n',j,'\nVALUE:')
           exec('print repr('+j+')\n')
       elif res[0:4] == 'str(':
           print('\nSTRING:\n',j,'\nVALUE:')
           exec('print repr('+j+')\n')
       else:
           print('\nFUNCTION:\n'+j+'\n\nSINTAX:')
           print(res)
   except: pass
