MakerCMS mini

Moke

moke

A mini 'Jeep thing...'

Below is the python function that audits the local directory structure, it first sets a group of list objects (actually 'un-typed' objects at this stage) and places in the 'global' namespace (so that other functions can use them) then it lists the html files, the content files and the dynamic files, initially it sets the modified files list to the contents list, so that other functions start with a complete list of files and can modify as required. The function also checks for the presence of basic 'maker' files required for site building.


@task
def audit():
    '''list required files to be included'''
    print "Auditing local file system..."
    global requiredFiles, allFiles, contentList, dynamics, htmlList, modList
    requiredFiles=('en.head','en.body','en.nav','en.foot','project_setup.xml','distribution.xml')
    allFiles = os.listdir('.')
    found=[]
    for f in requiredFiles:
        for a in os.walk('./'):
            if f in a[2]:
                found.append(f)
    diff = [x for x in requiredFiles if x not in set(found)]
    if len(diff)>0:print diff, 'not found'
    contentList =[f for f in allFiles if '.content' in f]
    htmlList = [f for f in allFiles if '.htm' in f]
    dynamics =[f for f in allFiles if ".dynamic" in f]
    modList = contentList

Curabitur sodales ligula in libero. Sed dignissim lacinia nunc. Curabitur tortor. Pellentesque nibh. Fusce nec tellus sed augue semper porta. Aenean quam. In scelerisque sem at dolor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas mattis. Sed convallis tristique sem. Proin ut ligula vel nunc egestas porttitor. Morbi lectus risus, iaculis vel, suscipit quis, luctus non, massa. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Fusce ac turpis quis ligula lacinia aliquet. Mauris ipsum. Nulla metus metus, ullamcorper vel, tincidunt sed, euismod in, nibh. Quisque volutpat condimentum velit.

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. Maecenas mattis. Suspendisse in justo eu magna luctus suscipit.

Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Nam nec ante. Sed lacinia, urna non tincidunt mattis, tortor neque adipiscing diam, a cursus ipsum ante quis turpis. Nulla facilisi. Ut fringilla. Suspendisse potenti. Nunc feugiat mi a tellus consequat imperdiet. Vestibulum sapien. Proin quam. Etiam ultrices. Maecenas mattis. Suspendisse in justo eu magna luctus suscipit.