Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(0)  |  Call(0)  |  Derive(0)  |  Import(0)

src/t/u/turtlebot-HEAD/linux_hardware/scripts/laptop_battery.py   turtlebot(Download)
                'full':        LaptopChargeStatus.CHARGED, 
                'charging':    LaptopChargeStatus.CHARGING, 
                'discharging': LaptopChargeStatus.DISCHARGING,
                'unknown':     LaptopChargeStatus.CHARGING, }
 
        rv.charge_state = state_to_val.get(state, 0)
        rv.rate     = _strip_A(batt_info.get('present rate',        '-1 mA'))
        if rv.charge_state == LaptopChargeStatus.DISCHARGING:
            rv.rate = math.copysign(rv.rate, -1) # Need to set discharging rate to negative
 
            rv.rate     = _read_number(_battery_acpi_path + '/current_now')/10e5
 
        if rv.charge_state == LaptopChargeStatus.DISCHARGING:
            rv.rate = math.copysign(rv.rate, -1) # Need to set discharging rate to negative