From 0dc4ea6d97280bd9f720f602302ae03d07d51452 Mon Sep 17 00:00:00 2001 From: pikachu Date: Sat, 20 Sep 2014 08:58:26 +0000 Subject: [PATCH] Prepare 0.2.2.3 release --- ev3/ev3dev.py | 49 +++++++++++++++++++++++++------------------------ setup.py | 4 ++-- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/ev3/ev3dev.py b/ev3/ev3dev.py index 19544bc..34fc177 100755 --- a/ev3/ev3dev.py +++ b/ev3/ev3dev.py @@ -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 """ @@ -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}, diff --git a/setup.py b/setup.py index 73c4a9b..f00e4a8 100755 --- a/setup.py +++ b/setup.py @@ -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='topikachu@163.com', 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" )