~yacinechaouche/+junk/BZR

« back to all changes in this revision

Viewing changes to PROG/WIKIMOVER/first.py

  • Committer: yacinechaouche at yahoo
  • Date: 2015-01-14 22:23:03 UTC
  • Revision ID: yacinechaouche@yahoo.com-20150114222303-6gbtqqxii717vyka
Ajout de CODE et PROD. Il faudra ensuite ajouter ce qu'il y avait dan TMP

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
def download(page):
 
2
    print "downloading %s" % page
 
3
 
 
4
class MyWiki(object):
 
5
    def __init__(self):
 
6
        self.pages = [1,2,3]
 
7
        self.index = 0
 
8
        
 
9
    def __iter__(self):
 
10
        for page in self.pages : 
 
11
            yield page
 
12
    
 
13
 
 
14
mywiki = MyWiki()
 
15
for page in mywiki:
 
16
    download(page)