This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
python pwb.py cosmetic_changes -family:bomb -lang:en-gb -page:Äöü | |
ATTENTION: You can run this script as a stand-alone for testing purposes. | |
However, the changes that are made are only minor, and other users | |
might get angry if you fill the version histories and watchlists with such | |
irrelevant changes. Some wikis prohibit stand-alone running. | |
Do you really want to continue? ([y]es, [N]o) y | |
Password for user BobBot on bomb:en-gb (no characters will be shown): | |
Logging in to bomb:en-gb as BobBot | |
Retrieving 1 pages from bomb:en-gb. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import argparse | |
import math | |
import getpass | |
import sys | |
ALPHABET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' | |
def test(orig, encr): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
['-o', 'hello world'] | |
['-o', 'hello world'] | |
False | |
None | |
hello world | |
['-o', 'hello world', '-p:page'] | |
['-o', 'hello world', '-p=page'] | |
False | |
page | |
hello world |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os | |
import re | |
import subprocess | |
import sys | |
import tempfile | |
import shutil | |
import traceback | |
if sys.version_info[0] >= 3: | |
basestring = (str, ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
found = -2 | |
if args.inposition < 0: | |
args.inposition %= len([s for s in video.streams if s.fftype == "a"]) | |
args.inposition += 1 | |
i = 0 | |
left = args.inposition | |
for stream in video.streams: | |
if stream.fftype != "v" and found < -1: | |
found = -1 | |
if left == 0 and found == -1: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Checks after an update of Kerbal Space Program if part configuration | |
files need to be updated, added or moved. | |
It first searches through the complete GameData/Squad/Parts directory | |
and catalogues all parts. It then compares every file with the existing | |
one on the wiki. If it doesn't exists, it searches for the infobox with | |
the part name to determine the current location on the wiki. It will |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
import pywikibot | |
import re | |
from pywikibot import textlib | |
site = pywikibot.getSite() | |
data_template = re.compile(".*/(Data|Box|RefFrame|Param)") | |
yes_all = False | |
for arg in pywikibot.handleArgs(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Automatically adds a new language to the KSP wiki. It follows | |
the instructions from http://wiki.kerbalspaceprogram.com/wiki/Kerbal_Space_Program_Wiki:Adding_a_New_Language : | |
1. Create MediaWiki:langlink-##, where ## is the two-letter language code. The content should be {{mw-langlink|##}} | |
2. Add {{mp-lang|##}} to Template:Main Page Layout/Language Box. | |
3. Add ** langlink-##|Language Name to MediaWiki:Sidebar under Languages. | |
4. Check the templates in Category:Language code templates if the language code needs to be added. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class CelestialBody { | |
double mass; | |
QVector3D position; | |
QVector3D velocity; | |
QVector3D f[]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PART | |
{ | |
// this is a sample config file, for determining a good file format for defining part parameters | |
// comment line - ignored by cfg parser | |
// empty lines, or lines without a '=' sign are also ignored | |
// all other lines are split at the '=' sign, and the left operand is used to know what parameter we are setting | |
// diferent parameters require data in different formats (see docs), and each module has it's own parameters (again, see docs) | |
// each assignment must be in a single line. Lines without assignments will be ignored. (You CAN turn on word wrap, though) | |
// each keyword here relates to an existing variable in the assigned module. If the keyword isn't found, it is ignored. | |
// conversely, if a keyword is left unassigned (as in not in the file), it will be initialized with it's default value |