From 795a19f950da779bee91ddee8f639bf8b27058e3 Mon Sep 17 00:00:00 2001 From: Castro0o Date: Fri, 24 Apr 2015 14:58:09 +0200 Subject: [PATCH] simple pages, without video or image --- allworks_mmdc.json | 2 +- mmdc_pages.py | 68 +++++++++++++++++++++------------------------- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/allworks_mmdc.json b/allworks_mmdc.json index b021e28..7757fbc 100644 --- a/allworks_mmdc.json +++ b/allworks_mmdc.json @@ -1 +1 @@ -{"16005": {"Website": "www.artyomkocharyan.com", "Bio": "Artyom Kocharyan (AM) is visual artist based in Rotterdam. His work explores the contemporary visual culture, namely the culture of images that increasingly dominate the world of communication. Artyom\u2019s work is concerned with the representation aspect of images and their ability to determine our vision of the world. Artyom is engaged with the representation apparatus that is peculiar to current digital and online culture.", "Description": "Artyom\u2019s work entitled \u201cNew Image\u201d is a series of images of that have been made using Google Image search results. In his work Artyom explores the relations between images and the technology that is responsible for their production and distribution. Namely how technological endeavors came to affect the dynamics within image culture. ", "Creator": "Artyom", "Title": "Artyom-graduation-work", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/thumb/6/6a/Screen_Shot_2014-10-26_at_16.10.08.jpg/500px-Screen_Shot_2014-10-26_at_16.10.08.jpg", "Date": "2015", "Thumbnail": "Screen Shot 2014-10-26 at 16.10.08.jpg"}, "15974": {"Date": "2015", "Creator": "JOK", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/thumb/a/af/22xxxxx.jpg/500px-22xxxxx.jpg", "Thumbnail": "22xxxxx.jpg", "Title": "Ahhhh"}, "16007": {"Bio": "Henk-Jelle de Groot is a Rotterdam based sound designer and musician. After graduating with an Audio / Visual design bachelor Henk-Jelle setup a sound studio in Rotterdam to work in the Audio / Visual industry. After 7 years of working he returned to the Piet Zwart Institute to graduate in a Master of comm design something something. In addition to working in the Audio / Visual industry, he is muscian and builder of electronic instruments.", "Description": "Untitled is a work about visualizing non audible and non visual acoustic properties of a space. Every space has a certain acoustic reverberation, a property that can't be heard or seen on it's own. With this project I aim to visualize that property trough data visualization. Untitled contains a (few) examples of spaces that have been mapped and visualized in a new form and material. These sculptures are presented in a way that the viewer may contextualize on it's own what the nature of the sculpture is", "Creator": "Henk-Jelle de Groot", "Title": "U_ntitled", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/e/e7/9m4MBqRM1w-6.png", "Date": "2015", "Thumbnail": "9m4MBqRM1w-6.png"}, "15982": {"Bio": "Ana Lu\u00edsa Moura (PT) has a background in Architecture / Urban Planning and is currently exploring means of visual storytelling and strategic illustration. Her research focuses on photographical protocols within media imagery, regarding in particular the instrumentalization of vulnerability and personal exposure.", "Creator": "Ana Lu\u00edsa Moura", "Title": "The_Aesthetics_of_Ethics", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/b/bd/Collage_007_thumbnail.jpg", "Date": "2015", "Thumbnail": "collage_007_thumbnail.jpg", "Extra": "The Aesthetics of Ethics is a reflection on the way social documentary photography shapes ethical concern. The aesthetics of these photographs map out a set of emotional reactions to social issues, tailoring a form of political consciousness. The project associated with the theoretical research, an illustration exercise, unfolds and explores the visual grammar of the genre. Attention to details of a manufactured informality allows the understanding of the images as an encoded language, detaching it from the objectivity and authority of the photographical medium (...)"}, "15986": {"Website": "http://joak.nospace.at", "Bio": "My Bio", "Description": "my description", "Creator": "Joseph Knierzinger", "Title": "User:Joak/graduation/catalog1", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/1/16/Pointer.gif", "Date": "2015", "Thumbnail": "pointer.gif", "Extra": "my free text"}, "16025": {"Website": "www.example.com", "Bio": "The bio is coming soon.", "Description": "Mina is a smart chat bot, a commercial project designed by a promising startup to fulfill humans' need of talking to someone else in a world where communication has become almost completely mediated by social media services. To keep the illusion alive, the software aims to be invisible.", "Creator": "Lucia Dossin", "Title": "Mina", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/5/59/3legs.jpg", "Date": "2015", "Thumbnail": "3legs.jpg", "Extra": "thumbnail is TEMPORARY (since it is mandatory to have a thumbnail for making this page, I used a temporary placeholder).===\"free text - short version\" 203 words===In a future not so far away, most humans were deprived from communicating with other humans through voice. Increased intolerance to raw subjective matters combined to a competitive labour market that practically forced every adult to work 12 to 16 hours everyday resulted in that most of human communication happened through written text messages or images using online social media services. As a side effect, the complexity of human conversation decreased to a level in which computers and people could understand each other reasonably well (an issue of Artificial Intelligence solved in an unexpectedly simple way, after many decades and much money spent on Natural Language research). Children were trained from early age to perform well in this environment. However, a parcel of the population still had the need to engage in conversation using their voices, like humans used to do 'in the good old times' (that's what they read somewhere online). Within this group, a few actually met other humans to talk. Others did not manage to find time or energy, despite their longings. With this group of people in mind, a promising startup company launched Mina, a chat bot that was able to fulfill this need for voice interaction remarkably well.===\"free text - full version\" 601 words===In a future not so far away, most humans were deprived from communicating with other humans through voice. Increased intolerance to raw subjective matters combined to a competitive labour market that practically forced every adult to work 12 to 16 hours everyday resulted in that most of human communication happened through written text messages or images using online social media services. As a side effect, the complexity of human conversation decreased to a level in which computers and people could understand each other reasonably well (an issue of Artificial Intelligence solved in an unexpectedly simple way, after many decades and much money spent on Natural Language research). Children were trained from early age to perform well in this environment. However, a parcel of the population still had the need to engage in conversation using their voices, like humans used to do 'in the good old times' (that's what they read somewhere online). Within this group, a few actually met other humans to talk. Others did not manage to find time or energy, despite their longings. With this group of people in mind, a promising startup company launched Mina, a chat bot that was able to fulfill this need for voice interaction remarkably well. Mina was presented as high technology, a product of years of research done by the brightest minds in the tech world. But in fact, it was a very old program, written in the infancy of digital electronic computing. This program worked quite well, since humans did not communicate too complex ideas anymore. But admitting the re-use of something old was completely out of question. Recycling was highly encouraged in matters like packaging, for example, but unthinkable for products and ideas. (That was regarded as not creative.) So, Mina was presented as a contemporary creation.Mina was a program that managed natural language in a quite rudimentary fashion. When the program was initiated, it loaded a script. This script contained a specific set of instructions for a conversation. It was able to identify some language patterns and according to these patterns, it chose a response that would sound plausible. But in order for the program to have the desired effect, these scripts would have to contain changes in the responses on a regular basis. These changes would keep alive the illusion of talking to another human being. Without them, subscribers would probably notice they were talking to a robot and would cancel their subscriptions. Also, scripts would be changed according to the calendar and the news - and would count on social media profile data to increase the (sanitized) subjectivity rate of the conversation. So for example, on Christmas season, the scripts would be almost completely different than scripts loaded along the year. For some subscribers, according to their profile data, Christmas scripts would contain emotional and inspiring words in a frequency higher than usual. For others, they would transmit the subscriber a sense of belonging to a group that hates Christmas.From time to time, the words database that was used to feed the scripts was attacked and the connections between words were switched or corrupted. That caused the script to reply using weird language constructs, and in many cases Mina's talk would not only unmask the robot but could also ignite a self-reflection process in the subscriber. Some would use this wake-up chance to try to find a way of having actual human contact back in their lives, others would instead sue the company and ask the subscription fee back. Nobody never found out if the ones responsible for these attacks were hackers or a business competitor."}, "15965": {"Website": "https://en.wikipedia.org/wiki/Luther_Blissett_%28nom_de_plume%29", "Bio": "Luther Blissett is a multiple-use name, an \"open pop star\" informally adopted and shared by hundreds of artists and activists all over Europe and the Americas since 1994. The pseudonym first appeared in Bologna, Italy, in mid-1994, when a number of cultural activists began using it for staging a series of urban and media pranks and to experiment with new forms of authorship and identity. From Bologna the multiple-use name spread to other European cities, such as Rome and London, as well as countries such as Germany, Spain, and Slovenia.[1] Sporadic appearances of Luther Blissett have been also noted in Canada, the United States, and Brazil.", "Description": "The novel Q was written by four Bologna-based members of the LBP, as a final contribution to the project, and published in Italy in 1999. So far, it has been translated into English (British and American), Spanish, German, Dutch, French, Portuguese (Brazilian), Danish, Polish, Greek, Czech, Russian, Turkish, Basque and Korean. In August 2003 the book was nominated for the Guardian First Book Prize.", "Creator": "Luther Blisset", "Title": "Qq", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/thumb/8/85/Luther-blissett-300.jpg/500px-Luther-blissett-300.jpg", "Date": "2015", "Thumbnail": "Luther-blissett-300.jpg", "Extra": "{{youtube|WUXsLyX4u3M}}While the folk heroes of the early-modern period and the nineteenth century served a variety of social and political purposes, the Luther Blissett Project (LBP) were able to utilize the media and communication strategies unavailable to their predecessors. According to Marco Deseriis, the main purpose of the LBP was to create \"a folk hero of the information society\" whereby knowledge workers and immaterial workers could organize and recognize themselves.[5] Thus, rather than being understood only as a media prankster and culture jammer, Luther Blissett became a positive mythic figure that was supposed to embody the very process of community and cross-media storytelling. Roberto Bui\u2014one of the co-founders of the LBP and Wu Ming\u2014explains the function of Luther Blissett{{youtube|fg-IyA0jX6w}} and other radical folk heroes as mythmaking or mythopoesis[[File:Quipu.png|Quipu - a hybrid between octopus and rope ]][[File:Screen_Shot_2015-03-31_at_11.07.35.png|This is possibly a screen shot]]"}, "15999": {"Website": "http://maxdovey.com", "Bio": "My Bio", "Description": "How to be more or less human.", "Creator": "Max Dovey", "Title": "User:Max_Dovey/maxgradbio", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/1/16/Pointer.gif", "Date": "2015", "Thumbnail": "pointer.gif", "Extra": "A solo performance exploring identity, perception and representation through automatic image analysis software. Software that is used to automatically tag online images is used to direct a live performance. Each scene is performed alongside software that reacts and interprets the performers actions. The performance explores the potential threat of computer vision and automated image perception on the human body. Every movement of the performance is analysed in detail to reductive categorisation."}} +{"16005": {"Website": "www.artyomkocharyan.com", "Bio": "Artyom Kocharyan (AM) is visual artist based in Rotterdam. His work explores the contemporary visual culture, namely the culture of images that increasingly dominate the world of communication. Artyom\u2019s work is concerned with the representation aspect of images and their ability to determine our vision of the world. Artyom is engaged with the representation apparatus that is peculiar to current digital and online culture.", "Description": "Artyom\u2019s work entitled \u201cNew Image\u201d is a series of images of that have been made using Google Image search results. In his work Artyom explores the relations between images and the technology that is responsible for their production and distribution. Namely how technological endeavors came to affect the dynamics within image culture. ", "Creator": "Artyom", "Title": "Artyom-graduation-work", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/thumb/6/6a/Screen_Shot_2014-10-26_at_16.10.08.jpg/500px-Screen_Shot_2014-10-26_at_16.10.08.jpg", "Date": "2015", "Thumbnail": "Screen Shot 2014-10-26 at 16.10.08.jpg"}, "15974": {"Date": "2015", "Creator": "JOK", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/thumb/a/af/22xxxxx.jpg/500px-22xxxxx.jpg", "Thumbnail": "22xxxxx.jpg", "Title": "Ahhhh"}, "16007": {"Bio": "Henk-Jelle de Groot is a Rotterdam based sound designer and musician. After graduating with an Audio / Visual design bachelor Henk-Jelle setup a sound studio in Rotterdam to work in the Audio / Visual industry. After 7 years of working he returned to the Piet Zwart Institute to graduate in a Master of comm design something something. In addition to working in the Audio / Visual industry, he is muscian and builder of electronic instruments.", "Description": "Untitled is a work about visualizing non audible and non visual acoustic properties of a space. Every space has a certain acoustic reverberation, a property that can't be heard or seen on it's own. With this project I aim to visualize that property trough data visualization. Untitled contains a (few) examples of spaces that have been mapped and visualized in a new form and material. These sculptures are presented in a way that the viewer may contextualize on it's own what the nature of the sculpture is", "Creator": "Henk-Jelle de Groot", "Title": "U_ntitled", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/e/e7/9m4MBqRM1w-6.png", "Date": "2015", "Thumbnail": "9m4MBqRM1w-6.png"}, "15982": {"Bio": "Ana Lu\u00edsa Moura (PT) has a background in Architecture / Urban Planning and is currently exploring means of visual storytelling and strategic illustration. Her research focuses on photographical protocols within media imagery, regarding in particular the instrumentalization of vulnerability and personal exposure.", "Creator": "Ana Lu\u00edsa Moura", "Title": "The_Aesthetics_of_Ethics", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/b/bd/Collage_007_thumbnail.jpg", "Date": "2015", "Thumbnail": "collage_007_thumbnail.jpg", "Extra": "The Aesthetics of Ethics is a reflection on the way social documentary photography shapes ethical concern. The aesthetics of these photographs map out a set of emotional reactions to social issues, tailoring a form of political consciousness. The project associated with the theoretical research, an illustration exercise, unfolds and explores the visual grammar of the genre. Attention to details of a manufactured informality allows the understanding of the images as an encoded language, detaching it from the objectivity and authority of the photographical medium (...)"}, "15986": {"Website": "http://joak.nospace.at", "Bio": "My Bio", "Description": "my description", "Creator": "Joseph Knierzinger", "Title": "User:Joak/graduation/catalog1", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/1/16/Pointer.gif", "Date": "2015", "Thumbnail": "pointer.gif", "Extra": "my free text"}, "16025": {"Website": "www.example.com", "Bio": "The bio is coming soon.", "Description": "Mina is a smart chat bot, a commercial project designed by a promising startup to fulfill humans' need of talking to someone else in a world where communication has become almost completely mediated by social media services. To keep the illusion alive, the software aims to be invisible.", "Creator": "Lucia Dossin", "Title": "Mina", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/5/59/3legs.jpg", "Date": "2015", "Thumbnail": "3legs.jpg", "Extra": "thumbnail is TEMPORARY (since it is mandatory to have a thumbnail for making this page, I used a temporary placeholder).===\"free text - short version\" 203 words===In a future not so far away, most humans were deprived from communicating with other humans through voice. Increased intolerance to raw subjective matters combined to a competitive labour market that practically forced every adult to work 12 to 16 hours everyday resulted in that most of human communication happened through written text messages or images using online social media services. As a side effect, the complexity of human conversation decreased to a level in which computers and people could understand each other reasonably well (an issue of Artificial Intelligence solved in an unexpectedly simple way, after many decades and much money spent on Natural Language research). Children were trained from early age to perform well in this environment. However, a parcel of the population still had the need to engage in conversation using their voices, like humans used to do 'in the good old times' (that's what they read somewhere online). Within this group, a few actually met other humans to talk. Others did not manage to find time or energy, despite their longings. With this group of people in mind, a promising startup company launched Mina, a chat bot that was able to fulfill this need for voice interaction remarkably well.===\"free text - full version\" 601 words===In a future not so far away, most humans were deprived from communicating with other humans through voice. Increased intolerance to raw subjective matters combined to a competitive labour market that practically forced every adult to work 12 to 16 hours everyday resulted in that most of human communication happened through written text messages or images using online social media services. As a side effect, the complexity of human conversation decreased to a level in which computers and people could understand each other reasonably well (an issue of Artificial Intelligence solved in an unexpectedly simple way, after many decades and much money spent on Natural Language research). Children were trained from early age to perform well in this environment. However, a parcel of the population still had the need to engage in conversation using their voices, like humans used to do 'in the good old times' (that's what they read somewhere online). Within this group, a few actually met other humans to talk. Others did not manage to find time or energy, despite their longings. With this group of people in mind, a promising startup company launched Mina, a chat bot that was able to fulfill this need for voice interaction remarkably well. Mina was presented as high technology, a product of years of research done by the brightest minds in the tech world. But in fact, it was a very old program, written in the infancy of digital electronic computing. This program worked quite well, since humans did not communicate too complex ideas anymore. But admitting the re-use of something old was completely out of question. Recycling was highly encouraged in matters like packaging, for example, but unthinkable for products and ideas. (That was regarded as not creative.) So, Mina was presented as a contemporary creation.Mina was a program that managed natural language in a quite rudimentary fashion. When the program was initiated, it loaded a script. This script contained a specific set of instructions for a conversation. It was able to identify some language patterns and according to these patterns, it chose a response that would sound plausible. But in order for the program to have the desired effect, these scripts would have to contain changes in the responses on a regular basis. These changes would keep alive the illusion of talking to another human being. Without them, subscribers would probably notice they were talking to a robot and would cancel their subscriptions. Also, scripts would be changed according to the calendar and the news - and would count on social media profile data to increase the (sanitized) subjectivity rate of the conversation. So for example, on Christmas season, the scripts would be almost completely different than scripts loaded along the year. For some subscribers, according to their profile data, Christmas scripts would contain emotional and inspiring words in a frequency higher than usual. For others, they would transmit the subscriber a sense of belonging to a group that hates Christmas.From time to time, the words database that was used to feed the scripts was attacked and the connections between words were switched or corrupted. That caused the script to reply using weird language constructs, and in many cases Mina's talk would not only unmask the robot but could also ignite a self-reflection process in the subscriber. Some would use this wake-up chance to try to find a way of having actual human contact back in their lives, others would instead sue the company and ask the subscription fee back. Nobody never found out if the ones responsible for these attacks were hackers or a business competitor."}, "15965": {"Website": "https://en.wikipedia.org/wiki/Luther_Blissett_%28nom_de_plume%29", "Bio": "Luther Blissett is a multiple-use name, an \"open pop star\" informally adopted and shared by hundreds of artists and activists all over Europe and the Americas since 1994. The pseudonym first appeared in Bologna, Italy, in mid-1994, when a number of cultural activists began using it for staging a series of urban and media pranks and to experiment with new forms of authorship and identity. From Bologna the multiple-use name spread to other European cities, such as Rome and London, as well as countries such as Germany, Spain, and Slovenia.[1] Sporadic appearances of Luther Blissett have been also noted in Canada, the United States, and Brazil.", "Description": "The novel Q was written by four Bologna-based members of the LBP, as a final contribution to the project, and published in Italy in 1999. So far, it has been translated into English (British and American), Spanish, German, Dutch, French, Portuguese (Brazilian), Danish, Polish, Greek, Czech, Russian, Turkish, Basque and Korean. In August 2003 the book was nominated for the Guardian First Book Prize.", "Creator": "Luther Blisset", "Title": "Qq", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/thumb/8/85/Luther-blissett-300.jpg/500px-Luther-blissett-300.jpg", "Date": "2015", "Thumbnail": "Luther-blissett-300.jpg", "Extra": "{{youtube|WUXsLyX4u3M}}While the folk heroes of the early-modern period and the nineteenth century served a variety of social and political purposes, the Luther Blissett Project (LBP) were able to utilize the media and communication strategies unavailable to their predecessors. According to Marco Deseriis, the main purpose of the LBP was to create \"a folk hero of the information society\" whereby knowledge workers and immaterial workers could organize and recognize themselves.[5] Thus, rather than being understood only as a media prankster and culture jammer, Luther Blissett became a positive mythic figure that was supposed to embody the very process of community and cross-media storytelling. Roberto Bui\u2014one of the co-founders of the LBP and Wu Ming\u2014explains the function of Luther Blissett{{youtube|fg-IyA0jX6w}} and other radical folk heroes as mythmaking or mythopoesis [[File:Quipu.png|Quipu - a hybrid between octopus and rope ]] [[File:Screen_Shot_2015-03-31_at_11.07.35.png|This is possibly a screen shot]]"}, "15999": {"Website": "http://maxdovey.com", "Bio": "My Bio", "Description": "How to be more or less human.", "Creator": "Max Dovey", "Title": "User:Max_Dovey/maxgradbio", "Thumbnail_url": "http://pzwiki.wdka.nl/mw-mediadesign/images/1/16/Pointer.gif", "Date": "2015", "Thumbnail": "pointer.gif", "Extra": "A solo performance exploring identity, perception and representation through automatic image analysis software. Software that is used to automatically tag online images is used to direct a live performance. Each scene is performed alongside software that reacts and interprets the performers actions. The performance explores the potential threat of computer vision and automated image perception on the human body. Every movement of the performance is analysed in detail to reductive categorisation."}} diff --git a/mmdc_pages.py b/mmdc_pages.py index 60a656d..b7e572e 100755 --- a/mmdc_pages.py +++ b/mmdc_pages.py @@ -19,8 +19,6 @@ img_exp=re.compile('(File:|Image:)((.*?)\.(gif|jpg|jpeg|png))(?=\||File:|Image:| video_exp=re.compile('\{\{(.*?)\|(.*?)\}\}') def replace_gallery(content): - # from .* imgs, return list of img ET elements - # replace .* with '' gallery_imgs = [] gallery_found = re.findall(gallery_exp, content) content = re.sub(gallery_exp, '', content) @@ -30,6 +28,9 @@ def replace_gallery(content): imgfile = imgfile[1] imgsrc = api_file_url(imgfile) # search for original image gallery_imgs.append(imgsrc) + print 'gallery_imgs', gallery_imgs + # from .* imgs, return list of img ET elements + # replace .* with '' return content, gallery_imgs def replace_video(content): @@ -44,8 +45,11 @@ def replace_video(content): elif (video_provider.lower()) == 'vimeo': video_src="https://player.vimeo.com/video/" + video_hash if video_src: - videos.append(video_src) - content = re.sub(video_exp, '', content) + videos.append(video_src) + iframe = "".format(video_src) +# content = re.sub(video_exp, ' iframe ', content) + else: + content = re.sub(video_exp, '', content) return content, videos def create_workpage( work, work_key, tree): # replace text content in dict with html nodes, holding the content @@ -59,23 +63,23 @@ def create_workpage( work, work_key, tree): # replace text content in dict with if key in ['Description', 'Extra']: mw_content = work[key] - if re.search(gallery_exp, mw_content): - mw_content, gallery_imgs = replace_gallery(mw_content) - work['Images'] = gallery_imgs - for imgsrc in gallery_imgs: - img_el = ET.SubElement(div_av, 'img', attrib={'src': imgsrc}) - elif re.search(video_exp, mw_content): - mw_content, videos = replace_video(mw_content) - work['Video'] = videos - for video in videos: - iframe_el = ET.SubElement(div_av, 'iframe', attrib={'src': video, 'width':'600px', 'height':'450px'}) - print 'VIDEO', ET.tostring(iframe_el) +# if re.search(gallery_exp, mw_content): +# # replace_gallery must replace the gallery inline +# mw_content, gallery_imgs = replace_gallery(mw_content) +# work['Images'] = gallery_imgs +# for imgsrc in gallery_imgs: +# img_el = ET.SubElement(div_av, 'img', attrib={'src': imgsrc}) +# elif re.search(video_exp, mw_content): +# mw_content, videos = replace_video(mw_content) +# work['Video'] = videos +# # for video in videos: +# # iframe_el = ET.SubElement(div_av, 'iframe', attrib={'src': video, 'width':'600px', 'height':'450px'}) +# # print 'VIDEO', ET.tostring(iframe_el) print '--------------' print 'mw_content', mw_content print '--------------' - x=mw_content - html_content = pandoc2html( x if key in work.keys() else '') # convert to HTML + html_content = pandoc2html( mw_content if key in work.keys() else '') # convert to HTML print 'html_content', html_content document_el = html5lib.parse(html_content, namespaceHTMLElements=False)#ET.fromstring(html_content) print ET.tostring(document_el) @@ -89,14 +93,11 @@ def create_workpage( work, work_key, tree): # replace text content in dict with div_body.append(el) imgs = document_el.findall('.//img') - if imgs: - for img in imgs: - src = api_file_url(img.get('src')) - img.set('src', src) - print 'IMG', img, src - -# div_body.append( document_el ) -# print 'div_body', ET.tostring(div_body) + # if imgs: + # for img in imgs: + # src = api_file_url(img.get('src')) + # img.set('src', src) + # print 'IMG', img, src elif key in ['Thumbnail']: @@ -116,18 +117,6 @@ def create_workpage( work, work_key, tree): # replace text content in dict with -# for key in work.keys(): - -# # p = ET.Element('p') -# # p.text = " oooo oooo oo" -# # print 'ELEMENTS', ET.tostring(div_header) -# # print 'ELEMENTS', ET.tostring(div_body) -# # print 'ELEMENTS', ET.tostring(div_av) -# # ET.SubElement(div_header, 'p' ) - - - - # print "****************************" # print ET.tostring(div_body) # print "****************************" @@ -171,6 +160,11 @@ for key in json_allworks.keys(): ### ISSSUES +# pandoc mw->HTML NOT WORKING +# sub gallery/videos with corresponding elements + + + # Gallaries, Files, videos, in orginal places correct place # Specificy positions in template # insert

into