remove_purple

Intro

The remove_purple.py script is a Python script to remove Purple Numbers (NIDs) from a PurpleWiki database. This can be useful when you have a set of pages that you want to copy from one PurpleWiki to another and want a new set of NIDs for copied pages.

The script expects a source directory tree as the first parameter. It will recursively scan all files within the directory tree that have a {nid} tag and remove them. The source files are not overwritten. Instead, each file is written out to the destination_directory tree, with the same path and filename.

Instructions

remove_purple.py <source-directory> <destination-directory>

Example usage:
remove_purple.py /data/cop/cwe/www/wikidb/page/ /tmp/cwe/www/wikidb/page

Requirements

  • Python 2.3
  • An existing set of PurpleWiki pages

Download