User:Loredana Bontempi/plan/assignement 1

From XPUB & Lens-Based wiki

I took the assignment as an excuse to spend time playing around issues I've always wanted to explore but never had the time,
so basically nothing is working I've just learned something more :)

-work on Seppukoo (with Ema and LLI)
-clock try to make something similar with open source softwares - pygame
the script is crashing and acting differently every time. something needs to be fixed, or pygame is really the wrong solution to use movies.

from pygame.locals import *

pygame.init()  
  f2=[]
  for e in f1:  

    if e != 'None' and e != 'Login' and e != 'Preferences' and e != 'Register' and e != 'Help/Guide' and e != 'Browse Source' and e != 'Wiki' and e != 'Timeline' and e != 'About Trac' and e != 'Search' and e != 'View Tickets' and e != 'Start Page' and e != 'Index' and e != 'History' and e != 'Last Change' and e != 'Edgewall Software' and e != 'Plain Text' and e != 'http://trac.edgewall.org/':
      f2.append(e)

screen = pygame.display.set_mode((640,480))
pygame.mixer.quit()
movie = pygame.movie.Movie("toycom13.mpeg")
movie1 = pygame.movie.Movie("toycom13.mpeg")
movie.set_display(screen, (0,0))
movie1.set_display(screen, (400,0))
movie.play()
movie1.play()
movie.set_volume(1)
flip()
sec=movie.get_length()
print sec
frame=movie.get_frame()
selftime= movie.get_time()
print frame

while 1:
  for event in pygame.event.get():
    print 'si'
    if event.type == QUIT:
      exit()
    elif event.type == KEYDOWN and event.key == K_ESCAPE:
      exit()
    print frame
    print selftime
    if movie.get_time() >= 5:	
      print ">10"
      movie.stop()   
    if not movie.get_busy():
      print 'stop'


-content automatized magazine - scribus/python (for an hypothetical PZI magazine take the contents of all the students' wiki pages)
This project would be partecipatory taking contents from different people pages, and collecting them in one paper.


Here is the beginning(open it with scribus(execute script)):

import urllib2
from BeautifulSoup import BeautifulSoup
import scribus
from scribus import *

def wget (url):
	"""
	returns (page, actualurl)
	sets user_agent and resolves possible redirection
	realurl maybe different than url in the case of a redirect
	"""	
	request = urllib2.Request(url)
	user_agent = "Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.14) Gecko/20080418 Ubuntu/7.10 (gutsy) Firefox/2.0.0.14"
	request.add_header("User-Agent", user_agent)
	pagefile=urllib2.urlopen(request)
	realurl = pagefile.geturl()
	return (pagefile, realurl)
 
if __name__ == "__main__":
# Example to use...	
  theurl = 'http://code.goto10.org/projects/nmm/wiki/People'
  (f, theurl) = wget(theurl)
  html = f.read()
  soup = BeautifulSoup(html)
  
  f1=[] 


  for entry in soup.findAll("a"):
    students= str(entry.string)
    f1.append(students)
  
  f2=[]
  for e in f1:  

    if e != 'None' and e != 'Login' and e != 'Preferences' and e != 'Register' and e != 'Help/Guide' and e != 'Browse Source' and e != 'Wiki' and e != 'Timeline' and e != 'About Trac' and e != 'Search' and e != 'View Tickets' and e != 'Start Page' and e != 'Index' and e != 'History' and e != 'Last Change' and e != 'Edgewall Software' and e != 'Plain Text' and e != 'http://trac.edgewall.org/':
      f2.append(e)

  if openDoc("one.sla"):
    n=0
    while n < 2:
      scribus.insertText(f2[n], 0, "title"+str(n))
      n=n+1

    saveDocAs("one1.sla")


Attachments

  • User Loredana Bontempi plan assignement 1 scribus.jpg