With the many games the B3 project supports, third party patches are essential to keep the project great. There are a few guidelines that we need contributors to follow so that we can have a chance of keeping B3 project as clean and organized as possible.
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 | |
import RPi.GPIO as GPIO | |
import time | |
import subprocess | |
BUTTON_PIN = 40 | |
BUTTON_SHUTDOWN_TIMEOUT = 3 | |
# we will use the pin numbering to match the pins on the Pi, instead of the | |
# GPIO pin outs (makes it easier to keep track of things) |
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
# | |
# MstPlugin for BigBrotherBot(B3) (www.bigbrotherbot.net) | |
# Copyright (C) 2013 Daniele Pantaleone <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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
from contextlib import contextmanager | |
@contextmanager | |
def context_query(self, query, bindata=None): | |
""" | |
Alias for DatabaseStorage.query which can make use of the python 'with' statement. | |
The contextmanager approach ensures that the generated DatabaseStorage.Cursor object instance | |
is always closed whenever the execution goes out of the 'with' statement block. | |
Example: |
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
def getWrap(self, text, length=80, sv_prefix_length=9): | |
""" | |
Returns a sequence of lines for text that fits within the limits | |
:param text: The text to be splitted | |
:param length: The maximum length of each line | |
:param sv_prefix_length: The length of the prefix added by the server to the message | |
""" | |
if not text: | |
return [] |
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
# | |
# BigBrotherBot(B3) (www.bigbrotherbot.net) | |
# Copyright (C) 2014 Fenix <[email protected]> | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 2 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |