If you find this page useful and would like to be notified of changes made to this page, start by inputting your email below.
powered by ChangeDetection
Wellwiki uses four primary scripts in order to generate new pages. All of these scripts are located within ~/installers/wikimanager/
The first script updates the violation counts for wells in the well table of wellsdb_dev. It can be run from mysql by logging in as root, selecting wellsdb_dev as the table of choice, and running source ~/installers/wikimanager/pre_deployment.sql
The script takes about 1 minute to fully execute.
This is a python2 script which adds any wells within the mysql wellsdb_dev database to the wikiManagerPages table within the wikidb database. This should be run prior to CreateEntitySources such that all necessary pages needed to be generated are able to be flagged for updates.
This is a python2 script that will read through all wiki pages located in the wikiManagerPages table within the wikidb database that have "NEEDS_UPDATE" set to 1.
It uses scripts within DBUtil/ to query the mysql database, which in turn return dictionaries for each well in question in which keys correspond with column names from the mysql database, and values are the corresponding entries for a given well. Scripts within FileUtil/SourceBuilders/ generate page templates and output parsed files using well specific data from DBUtil results.
Each entry within the wikiManagerPages table will be queried for in the wellsdb_dev database, which then outputs newly generated pages to ~/PycharmProjects/WikiManager/WikiSources
Here is some sample SQL to flag all Pennsylvania pages for update:
UPDATE `wikiManagerPages`
SET `NEEDS_UPDATE`='1'
WHERE `PAGE_NAME` LIKE '37%
This script is currently fully functional for at least the state of Pennsylvania.
This python2 file takes a source directory as an argument, and begins adding all wiki pages within that source directory to the actual wikimedia database, making them available for viewing here.
It is extremely important to note that by default, CreateEntitySources.py creates appends "_main.txt" to every file it generates. If commit_stages_sources.py is run as is on the generated files in ~/PycharmProjects/WikiManager/WikiSources then all pages added to the wiki will have _main.txt in their title. Any pages that already existed and needed updating will thus have a duplicate page (with more up to date information) with _main.txt in its name.
As this behavior should be avoided, the following can be run within ~/PycharmProjects/WikiManager/WikiSources to correct the filenames and prevent the _main.txt issue.
for f in *; do mv "$f" "${f#_main.txt}"; done
Usage: python commit_staged_sources.py ~/PycharmProjects/WikiManager/WikiSources