Difference between revisions of "Import Lessons from test wiki"

From forestDSS
Jump to: navigation, search
m
m
Line 4: Line 4:
 
|Has responsible person or organization=Sean (help from Dominique / Jussi)
 
|Has responsible person or organization=Sean (help from Dominique / Jussi)
 
|Has issue description=Some Lessons on the test wiki have been changed since the last import. Need to re-import.
 
|Has issue description=Some Lessons on the test wiki have been changed since the last import. Need to re-import.
|Has issue solution=#Delete current Lessons on public wiki
+
|Has issue solution=# Delete current Lessons on public wiki
**(Problem: code below was successful in deleting about half the lessons, but now getting unclear error message on 'for' statement (like no Lessons exist or maybe next Lesson has some problem?)
+
*(Problem: code below was successful in deleting about half the lessons, but now getting unclear error message on 'for' statement (like no Lessons exist or maybe next Lesson has some problem?)
#Re-import lessons from test wiki
+
# Re-import lessons from test wiki
 
|Has issue priority=high
 
|Has issue priority=high
 
|Is issue closed:=No
 
|Is issue closed:=No

Revision as of 04:18, 1 May 2013

Has issue type Suggestion
Has author Sean
Has responsible person or organization Sean (help from Dominique / Jussi)
Has issue description Some Lessons on the test wiki have been changed since the last import. Need to re-import.
Has issue solution # Delete current Lessons on public wiki
  • (Problem: code below was successful in deleting about half the lessons, but now getting unclear error message on 'for' statement (like no Lessons exist or maybe next Lesson has some problem?)
  1. Re-import lessons from test wiki
Has issue priority "high" is not in the list of possible values (1-high, 2-medium, 3-low) for this property.
Has task status

import sys sys.path.append('mwclient') import os import mwclient cat = 'Lesson' ##site = mwclient.Site('test.forsys.siwawa.org','/wiki/') ##site.login('forsys', 'forsys1') site = mwclient.Site('fp0804.emu.ee','/wiki/') site.login('SeanGordon', '4other') for pg in site.Categories[cat]: pgname = pg.page_title print pgname pg.delete(reason='Seans automated delete') print "DONE"