<commit_before>import helpers

# platform-specific imports
if helpers.is_running_on_rpi():# running on Raspberry Pi
    import RPi.GPIO as GPIO
    print "freesprints.hardware using Rpi.GPIO"
else: # running on computer
    import FakeRPiGPIO.GPIO as GPIO
    print "freesprints.hardware using FakeRpiGPIO.GPIO"

class Roller(object):
    pin = None # board number
    number = None
    spin_count = 0
    spin_callback = None
    
    def __init__(self, pin):
        self.pin = pin
    
    def set_spin_callback(self, callback_function):
        self.spin_callback = callback_function
    
    



class RollerController(object):
    rollers = []
    
    def __init__(self):
        GPIO.setmode(GPIO.BCM)
        
    def get_rollers(self):
        return rollers
        
    def get_roller_for_pin(pin_number):
        return Roller(pin_number)<commit_msg>basic set up of GPIO in Roller<commit_after>import helpers

# platform-specific imports
if helpers.is_running_on_rpi():# running on Raspberry Pi
    import RPi.GPIO as GPIO
    print "freesprints.hardware using Rpi.GPIO"
else: # running on computer
    import FakeRPiGPIO.GPIO as GPIO
    print "freesprints.hardware using FakeRpiGPIO.GPIO"

class Roller(object):
    pin = None # board number
    number = None
    spin_count = 0
    spin_callback = None
    
    def __init__(self, pin):
        self.pin = pin
        GPIO.setup(pin, GPIO.IN)
        GPIO.add_event_detect(pin, GPIO.RISING, self.event_callback)
    
    def set_spin_callback(self, callback_function):
        self.spin_callback = callback_function
        
    def event_callback(self, channel):
        print "CALLBACK"
    
    



class RollerController(object):
    rollers = []
    
    def __init__(self):
        GPIO.setmode(GPIO.BCM)
        
    def get_rollers(self):
        return rollers
        
    def get_roller_for_pin(pin_number):
        return Roller(pin_number)
{'fraction_non_alphanumeric': 0.07507820646506778, 'fraction_numerical': 0.0010427528675703858, 'mean_word_length': 2.6692160611854683, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4015628', 'n_tokens_mistral': 605, 'n_tokens_neox': 595, 'n_words': 147}