Skip to content
This repository has been archived by the owner on Nov 23, 2019. It is now read-only.

Commit

Permalink
Prepare 0.2.2.3 release
Browse files Browse the repository at this point in the history
  • Loading branch information
topikachu committed Sep 20, 2014
1 parent ba38877 commit 0dc4ea6
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 26 deletions.
49 changes: 25 additions & 24 deletions ev3/ev3dev.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,30 +104,7 @@ def fset(self, value):

return cls


class Ev3Dev(object):

def __init__(self):
self.sys_path = ""

def read_value(self, name):
attr_file = os.path.join(self.sys_path, name)
if os.path.isfile(attr_file):
with open(attr_file) as f:
value = f.read().strip()
return value
else:
return None

def write_value(self, name, value):
attr_file = os.path.join(self.sys_path, name)
if os.path.isfile(attr_file):
with open(attr_file, 'w') as f:
f.write(str(value))
else:
return

def get_battery_percentage(self):
def get_battery_percentage():
"""
Return an int() of the percentage of battery life remaining
"""
Expand Down Expand Up @@ -181,6 +158,30 @@ def get_battery_percentage(self):
(voltage_max, voltage_min, voltage_now))
return 0

class Ev3Dev(object):

def __init__(self):
self.sys_path = ""

def read_value(self, name):
attr_file = os.path.join(self.sys_path, name)
if os.path.isfile(attr_file):
with open(attr_file) as f:
value = f.read().strip()
return value
else:
return None

def write_value(self, name, value):
attr_file = os.path.join(self.sys_path, name)
if os.path.isfile(attr_file):
with open(attr_file, 'w') as f:
f.write(str(value))
else:
return



@create_ev3_property(
bin_data={'read_only': True},
bin_data_format={'read_only': True},
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
from setuptools import setup

setup(name='python-ev3',
version='0.0.2.2',
version='0.0.2.3',
license='Apache License 2.0',
description='Python library of ev3dev firmware',
author='Gong Yi',
author_email='[email protected]',
url='https://github.com/topikachu/python-ev3',
packages=['ev3'],
download_url="https://github.com/topikachu/python-ev3/releases/tag/0.0.2.2"
download_url="https://github.com/topikachu/python-ev3/releases/tag/0.0.2.3"
)

0 comments on commit 0dc4ea6

Please sign in to comment.