diff --git a/mmdc_modules.py b/mmdc_modules.py index 0b0686d..20e828c 100644 --- a/mmdc_modules.py +++ b/mmdc_modules.py @@ -4,6 +4,13 @@ import pprint, re, subprocess, shlex, urllib import xml.etree.ElementTree as ET from mwclient import Site +from datetime import datetime +###### +# GLOBAL VARS +###### + + +years = range(2015, (datetime.now()).year ) ######### diff --git a/mmdc_wiki2web.py b/mmdc_wiki2web.py index 324c0b5..0c9cd2b 100755 --- a/mmdc_wiki2web.py +++ b/mmdc_wiki2web.py @@ -3,35 +3,23 @@ import xml.etree.ElementTree as ET import html5lib, urllib, pprint -from mmdc_modules import pandoc2html, parse_work, write_html_file, mw_cats, mw_page_imgsurl, mw_img_url, mw_page_text, mwsite, mw_page_cats, mw_page, remove_cats, find_authors, replace_video, replace_img_a_tag, index_addwork +from mmdc_modules import pandoc2html, parse_work, write_html_file, mw_cats, mw_page_imgsurl, mw_img_url, mw_page_text, mwsite, mw_page_cats, mw_page, remove_cats, find_authors, replace_video, replace_img_a_tag, index_addwork, years from argparse import ArgumentParser from random import shuffle - ### WORKINGS #### # * each year has its own html template in YYYY-template.html # * the --category provides the year. I.e. 2017 -# +# * year does not need to be indicated in arguments # # ################ ### TO DO ###### -# * [DONE] in def mw_cats(): select pages member of the years from 2015 to the indicate year -# ** [DONE] resulting in all work pages from those year being created -# ** [DONE] the creation of the index pages is missing # # Issues @current commit -# * index.html page contains ALL works from ALL years, not just the last -# * year.html contain none -# -# indexdict = create_page(memberpages, 'index') # X indexdict includes only set year -# and # create_index(indexdict) -# * update/create index pages: -# -# * let program define year +# * 2015 template is not present +# * purge year setting # -# * For different user categories serve different templates -# * how & why are years and works mixed?? ######### ##### @@ -52,10 +40,12 @@ for i in args.category: year = i print year - ###### # DEFS: create_page create_index ###### + + + def create_page(memberpages, mode): page_template = open("./{}-template.html".format(year), "r") # a template for each year indexdict = {} #parent dict: contains articledict instances @@ -145,30 +135,37 @@ def create_page(memberpages, mode): return indexdict -def create_index(indexdict): +def create_index(indexdict, year): index_template = open("./index-template-{}.html".format(year), "r") index_tree = html5lib.parse(index_template, namespaceHTMLElements=False) index_container = index_tree.find(".//div[@class='isotope']") #maybe id is imp - keys = indexdict.keys() - shuffle(keys) + works = indexdict.keys() + + print '\n\n******* indexdict keys: works ***********\n\n' + print(works) + + for work in works: + print '---TITLE:', indexdict[work]['Title'] + print '---PATH:', indexdict[work]['Path'] - for key in keys: index_addwork( parent=index_container, - workid=key, - href=indexdict[key]['Path'], - title=indexdict[key]['Title'],#.decode('utf-8'), - creator=indexdict[key]['Creator'], - date=indexdict[key]['Date'], - thumbnail=(indexdict[key]['Thumbnail']) + workid=work, + href=indexdict[work]['Path'], + title=indexdict[work]['Title'],#.decode('utf-8'), + creator=indexdict[work]['Creator'], + date=indexdict[work]['Date'], + thumbnail=(indexdict[work]['Thumbnail']) ) - #print '----', indexdict[key]['Title'],indexdict[key]['Path'] + + #print '----', indexdict[key]['Title'],indexdict[key]['Path'] indexfile_year = './web/{}.html'.format(year) - indexfile = './web/index.html' - - print indexfile_year write_html_file(index_tree, indexfile_year) - # only for last year - write_html_file(index_tree, indexfile) + + years.sort() + if year == years[-1]: # last year works --> index.html + indexfile = './web/index.html' + write_html_file(index_tree, indexfile) + @@ -186,13 +183,33 @@ if args.preview is not None: create_page(memberpages, 'preview') else: - print "** New Index Mode **" +# print "** New Index Mode **" memberpages=mw_cats(site, args) - print '\n\nmemberpages:\n\n', memberpages, '\n\n********\n\n' # X memberpages includes only set year - indexdict = create_page(memberpages, 'index') # X indexdict includes only set year - create_index(indexdict) - print - print '******************' - print - pprint.pprint(indexdict) +# print '\n\nmemberpages:\n\n', memberpages, '\n\n********\n\n' # memberpages include years, from current to 2015 + indexdict = create_page(memberpages, 'index') + # indexdict[u'A Unique Line']['Date'] + + # rather than interveening in the create_index or create_page + # I will place create_index in a loop + # with sublist of idexdict for each year + + indexdict_byyear={year:{} for year in years } + # indexdict_byyear structure: + # {year1:{ work1: {work1 prop:vals}, work2: {...} }, year2:..., year3: } + # {2015: {u'A Unique Line': {'Bio': u'
Jun + for key in indexdict.keys(): # populate indexdict_byyear with works + indexdict_byyear[ int(indexdict[key]['Date'])][key] = indexdict[key] + + print '\n\n******* indexdict_byyear ***********\n\n' + pprint.pprint( indexdict_byyear ) + + for year in indexdict_byyear.keys(): # create index page for each year ie 2016.html + print '\n***** ', year, ' *****\n' + create_index(indexdict_byyear[year], year) + +# print '\n\n******* indexdict ***********\n\n' +# pprint.pprint(indexdict) + +# print '\n\n******* loop indexdict ***********\n\n' + diff --git a/web/2015.html b/web/2015.html index 7634f74..353a273 100644 --- a/web/2015.html +++ b/web/2015.html @@ -7,18 +7,18 @@ - - + + - + - + -
Tempted by Tomorrow, is the title that has been chosen, after some debate, by the artists and designers in this year’s PZI Master Media Design and Communication graduation show. In an era where the death of the Future—that brave utopian concept that motivated a good deal of cultural activity across different strata of culture throughout the twentieth century and beyond—has been widely discussed, it is hard not to read the title ironically.
-But in the works in this show, that irony is tempered by a muted, but definite, optimism. The range of works in this year’s PZI MMDC are extremely diverse in terms of their formal approaches and aesthetic pre-occupations, yet when one engages with and reflects on each individual work there is a common strand running through the show: a sense that it is still possible to ‘make things better’; however carefully the concepts ‘make’, ‘things’ and above all ‘better’ might need to be interrogated.
-Each project reflects a unique research trajectory over two years, with each artist employing both studio-based practice and sustained critical reflection to create the artworks and research projects you will find in this show: works ranging from 3d-printed modular camera design and associated workshops; through to a union designed to give a voice to those who undertake the new forms of ‘immaterial labour’ that abound in our culture; to a series of photographic works that seek to extend the notion of gesture in image to include strategies of image search and recombination. Other works in the show loop together languages taken from a range of discourses including pop culture, social media, iconography, sound design, interface design, library studies performance, and archival research. It is this looping together of disparate technologies and codes that forms the common pre-occupations of the research undertaken within the department.
-As a department we are enormously proud of the research work of our graduating students. It has been a privilege to travel alongside their very various paths of enquiry. I would like to thank our guest curators Jon Thomson and Alison Craighead, and our regular curator Willie Stehouwer for the contributions they have made to this show.
+ + + +Locations:
+Piet Zwart Institute
Mauritsstraat 36
Rotterdam
V2_
Eendrachtsstraat 10
Rotterdam
An evening of performances, presentations and installations. Take the opportunity to have a drink, discuss the presented - projects and choose the winner of the ‘Thesis – Karaoke’, the ultimate research based pop-jukebox.
+Each year the graduating artists and designers of the Media Design & Communication Department Piet Zwart Institute celebrate their graduation by creating an event: an exhibition, lectures, publications and performances to represent as fully as possible the diverse range of practices encompassed by the practice-based research undertaken in the department.
++ This year's show is entitled Fuzzy Logic: it features work by Lucas Battich [AR], + Manetta Berends [NL], Julie Boschat Thorez [FR], Cihad Caner [TR], Joana Chicau [PT], Cristina Cochior [RO], Solange Frankort [NL], Arantxa Gonlag [NL], Anne Lamb [US], Benjamin Li [NL], Yuzhen Tang [CN], Ruben van de Ven [NL] and Thomas Walskaar [NO]
+ + +