This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
| def interwiki_prefix_path(self, site, max_depth=2): | |
| # all sites already checked | |
| visited = set() | |
| old_queue = [(self, [])] | |
| new_queue = [] | |
| for depth in range(max_depth): | |
| print('D{}'.format(depth)) | |
| print('Q{}'.format(old_queue)) | |
| for checked_site, path in old_queue: | |
| print('-' * 30) |
This file contains hidden or 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 -*- | |
| from collections import OrderedDict | |
| def parse_value(value, parameters, allow_unknown=False): | |
| """ | |
| Parse the value of an argument into subarguments. | |
| The value is basically a comma-separated string. Each comma-separated value | |
| can be named which is separated by an equals sign. It is possible to escape |
This file contains hidden or 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
| Lines (line number in brackets) sorted for length | |
| pywikibot/site.py 137 (l 3959) | |
| pywikibot/site.py 126 (l 3958) | |
| pywikibot/site.py 110 (l 3963) | |
| pywikibot/site.py 108 (l 4458) | |
| pywikibot/site.py 106 (l 588) | |
| pywikibot/site.py 101 (l 3960) | |
| pywikibot/site.py 095 (l 4380) | |
| pywikibot/site.py 095 (l 4507) |
This file contains hidden or 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 | |
| # -*- coding: utf-8 -*- | |
| """Clean up the git branches by removing branches whose change-id got merged.""" | |
| from __future__ import unicode_literals | |
| import argparse | |
| import collections | |
| import itertools | |
| import json | |
| import re |
This file contains hidden or 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 re | |
| import sys | |
| if sys.version_info[0] > 2: | |
| unichr = chr | |
| def make_compatible(src): | |
| delim = src[0] |