# -*- coding: utf8 -*-
from wikitools import Page
from Site import site
from Tools import printProgress
from Tools import setOrphan
from Tools import isOrphanCat
from OrphanPage import OrphanPage

pageName = "Projet:Maintenance/Analyse des créations sous IP"
print(pageName)

p = Page(site,pageName)

print((str(len(p.getLinks()))))
nbOrphan = 0
toBeAdded = 0

i = 0
lines = p.getLinks()
for l in lines:
	printProgress(i,len(lines))
	i+=1
	p = OrphanPage(l)
	p.setPageInfo()
	if p.pageid < 1:
		print("del")
		continue
	if p.namespace != 0:
		print("not an article")
		continue
	if p.isHomo():
		print("page d'homo")
		continue
	if p.getNbLinks() < 3:
		nbOrphan += 1
		cat = p.getCategories()
		if ( not isOrphanCat(cat)):
			setOrphan(p)
			toBeAdded += 1

print((str(nbOrphan) + " among them are orphans"))
print((str(toBeAdded) + " among them are to be added"))

7b9df5e59313558bc7eab7ff959cbcf29e5066ef
<mask token>

<mask token>
print(pageName)
<mask token>
print(str(len(p.getLinks())))
<mask token>
for l in lines:
    printProgress(i, len(lines))
    i += 1
    p = OrphanPage(l)
    p.setPageInfo()
    if p.pageid < 1:
        print('del')
        continue
    if p.namespace != 0:
        print('not an article')
        continue
    if p.isHomo():
        print("page d'homo")
        continue
    if p.getNbLinks() < 3:
        nbOrphan += 1
        cat = p.getCategories()
        if not isOrphanCat(cat):
            setOrphan(p)
            toBeAdded += 1
print(str(nbOrphan) + ' among them are orphans')
print(str(toBeAdded) + ' among them are to be added')

<mask token>
pageName = 'Projet:Maintenance/Analyse des créations sous IP'
print(pageName)
p = Page(site, pageName)
print(str(len(p.getLinks())))
nbOrphan = 0
toBeAdded = 0
i = 0
lines = p.getLinks()
for l in lines:
    printProgress(i, len(lines))
    i += 1
    p = OrphanPage(l)
    p.setPageInfo()
    if p.pageid < 1:
        print('del')
        continue
    if p.namespace != 0:
        print('not an article')
        continue
    if p.isHomo():
        print("page d'homo")
        continue
    if p.getNbLinks() < 3:
        nbOrphan += 1
        cat = p.getCategories()
        if not isOrphanCat(cat):
            setOrphan(p)
            toBeAdded += 1
print(str(nbOrphan) + ' among them are orphans')
print(str(toBeAdded) + ' among them are to be added')

from wikitools import Page
from Site import site
from Tools import printProgress
from Tools import setOrphan
from Tools import isOrphanCat
from OrphanPage import OrphanPage
pageName = 'Projet:Maintenance/Analyse des créations sous IP'
print(pageName)
p = Page(site, pageName)
print(str(len(p.getLinks())))
nbOrphan = 0
toBeAdded = 0
i = 0
lines = p.getLinks()
for l in lines:
    printProgress(i, len(lines))
    i += 1
    p = OrphanPage(l)
    p.setPageInfo()
    if p.pageid < 1:
        print('del')
        continue
    if p.namespace != 0:
        print('not an article')
        continue
    if p.isHomo():
        print("page d'homo")
        continue
    if p.getNbLinks() < 3:
        nbOrphan += 1
        cat = p.getCategories()
        if not isOrphanCat(cat):
            setOrphan(p)
            toBeAdded += 1
print(str(nbOrphan) + ' among them are orphans')
print(str(toBeAdded) + ' among them are to be added')

# -*- coding: utf8 -*-
from wikitools import Page
from Site import site
from Tools import printProgress
from Tools import setOrphan
from Tools import isOrphanCat
from OrphanPage import OrphanPage

pageName = "Projet:Maintenance/Analyse des créations sous IP"
print(pageName)

p = Page(site,pageName)

print((str(len(p.getLinks()))))
nbOrphan = 0
toBeAdded = 0

i = 0
lines = p.getLinks()
for l in lines:
	printProgress(i,len(lines))
	i+=1
	p = OrphanPage(l)
	p.setPageInfo()
	if p.pageid < 1:
		print("del")
		continue
	if p.namespace != 0:
		print("not an article")
		continue
	if p.isHomo():
		print("page d'homo")
		continue
	if p.getNbLinks() < 3:
		nbOrphan += 1
		cat = p.getCategories()
		if ( not isOrphanCat(cat)):
			setOrphan(p)
			toBeAdded += 1

print((str(nbOrphan) + " among them are orphans"))
print((str(toBeAdded) + " among them are to be added"))
