Permalink
Browse files

* add two new python modules: pyRRD & pyserial

 * requested by molfi in [http://www.ip-phone-forum.de/showthread.php?t=257977 this thread]


git-svn-id: file:///var/svn/freetz/trunk@10279 149334a1-2f27-0410-a3b9-fc62619ac1e6
  • Loading branch information...
1 parent 72bfde2 commit 832ea4f4cf30a2c8a4a727c0590837b9feba7ff5 er13 committed Mar 20, 2013
View
2 CHANGELOG
@@ -113,6 +113,8 @@ Latest changes:
* pycurl 7.19.0
* python imaging library (PIL) 1.1.7
* pyOpenSSL 0.13
+ * pyRRD 0.1.0
+ * pyserial 2.6
* RTMPDump 2.4-git
* Rush 1.7
* samba 3.6.12 (as an alternative to the 3.0.37, 3.0.37 is still the default one)
View
2 make/Config.in
@@ -184,6 +184,8 @@ menu "Python 3rd-party modules"
source make/python-pycrypto/Config.in
source make/python-pycurl/Config.in
source make/python-pyopenssl/Config.in
+ source make/python-pyrrd/Config.in
+ source make/python-pyserial/Config.in
endmenu
source make/quagga/Config.in
source make/ripmime/Config.in
View
7 make/python-pyrrd/Config.in
@@ -0,0 +1,7 @@
+config FREETZ_PACKAGE_PYTHON_PYRRD
+ bool "pyrrd 0.1.0"
+ depends on FREETZ_PACKAGE_PYTHON
+ select FREETZ_PACKAGE_RRDTOOL
+ default n
+ help
+ An Object-Oriented Python Interface for RRDTool.
View
28 make/python-pyrrd/patches/100-cross-compile.patch
@@ -0,0 +1,28 @@
+--- setup.py
++++ setup.py
+@@ -1,4 +1,6 @@
+-from setuptools import setup
++#!/usr/bin/env python
++
++from distutils.core import setup
+
+ from pyrrd import meta
+ from pyrrd.util import dist
+--- pyrrd/util/__init__.py
++++ pyrrd/util/__init__.py
+@@ -1,6 +1,3 @@
+-from time import mktime
+-from datetime import datetime
+-
+ try:
+ from xml.etree import ElementTree
+ except ImportError:
+@@ -19,6 +16,8 @@
+ >>> type(now)
+ <type 'int'>
+ '''
++ from time import mktime
++ from datetime import datetime
+ if not dt_obj:
+ dt_obj = datetime.now()
+ return int(mktime(dt_obj.timetuple()))
View
31 make/python-pyrrd/patches/200-fetch.openwrt.patch
@@ -0,0 +1,31 @@
+--- pyrrd/backend/external.py
++++ pyrrd/backend/external.py
+@@ -264,7 +264,7 @@
+ data += [unicode(x) for x in obj.rra]
+ return (obj.filename, params + data)
+
+- if function == 'update':
++ elif function == 'update':
+ validParams = ['template']
+ params = common.buildParameters(obj, validParams)
+ FIRST_VALUE = 0
+@@ -277,15 +277,15 @@
+ data = [data for data, nil in obj.values]
+ return (obj.filename, params + data)
+
+- if function == 'fetch':
++ elif function == 'fetch':
+ validParams = ['resolution', 'start', 'end']
+ params = common.buildParameters(obj, validParams)
+- return (obj.filename, obj.cf, params)
++ return (obj.filename, [obj.cf] + params)
+
+- if function == 'info':
++ elif function == 'info':
+ return (obj.filename, obj)
+
+- if function == 'graph':
++ elif function == 'graph':
+ validParams = ['start', 'end', 'step', 'title',
+ 'vertical_label', 'width', 'height', 'only_graph',
+ 'upper_limit', 'lower_limit', 'rigid', 'alt_autoscale',
View
33 make/python-pyrrd/python-pyrrd.mk
@@ -0,0 +1,33 @@
+$(call PKG_INIT_BIN, 0.1.0)
+$(PKG)_SOURCE:=PyRRD-$($(PKG)_VERSION).tar.gz
+$(PKG)_SOURCE_MD5:=c33a0760b42a23e45e423b8b9f2cd0b0
+$(PKG)_SITE:=https://pyrrd.googlecode.com/files
+
+$(PKG)_DIR:=$($(PKG)_SOURCE_DIR)/PyRRD-$($(PKG)_VERSION)
+
+$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)$(PYTHON_SITE_PKG_DIR)/pyrrd/__init__.py
+
+$(PKG)_DEPENDS_ON := python
+
+$(PKG_SOURCE_DOWNLOAD)
+$(PKG_UNPACKED)
+$(PKG_CONFIGURED_NOP)
+
+$($(PKG)_TARGET_BINARY): $($(PKG)_DIR)/.configured
+ $(call Build/PyMod/PKG, PYTHON_PYRRD)
+ (cd $(dir $@); $(RM) -r backend/tests testing tests)
+ touch -c $@
+
+$(pkg):
+
+$(pkg)-precompiled: $($(PKG)_TARGET_BINARY)
+
+$(pkg)-clean:
+ $(RM) -r $(PYTHON_PYRRD_DIR)/build
+
+$(pkg)-uninstall:
+ $(RM) -r \
+ $(PYTHON_PYRRD_DEST_DIR)$(PYTHON_SITE_PKG_DIR)/pyrrd \
+ $(PYTHON_PYRRD_DEST_DIR)$(PYTHON_SITE_PKG_DIR)/PyRRD-*.egg-info
+
+$(PKG_FINISH)
View
7 make/python-pyserial/Config.in
@@ -0,0 +1,7 @@
+config FREETZ_PACKAGE_PYTHON_PYSERIAL
+ bool "pyserial 2.6"
+ depends on FREETZ_PACKAGE_PYTHON
+ select FREETZ_PACKAGE_PYTHON_MOD_CTYPES
+ default n
+ help
+ Python Serial Port Extension.
View
11 make/python-pyserial/patches/010-variable_name_typo.patch
@@ -0,0 +1,11 @@
+--- serial/serialposix.py
++++ serial/serialposix.py
+@@ -215,7 +215,7 @@
+ # no exception, just continue with a brave attempt to build a device name
+ # even if the device name is not correct for the platform it has chances
+ # to work using a string with the real device name as port parameter.
+- def device(portum):
++ def device(portnum):
+ return '/dev/ttyS%d' % portnum
+ def set_special_baudrate(port, baudrate):
+ raise SerialException("sorry don't know how to handle non standard baud rate on this platform")
View
9 make/python-pyserial/patches/020-no_miniterm_script.patch
@@ -0,0 +1,9 @@
+--- setup.py
++++ setup.py
+@@ -82,5 +82,5 @@
+ platforms = 'any',
+ cmdclass = {'build_py': build_py, 'build_scripts': build_scripts},
+
+- scripts = ['serial/tools/miniterm.py'],
++# scripts = ['serial/tools/miniterm.py'],
+ )
View
32 make/python-pyserial/python-pyserial.mk
@@ -0,0 +1,32 @@
+$(call PKG_INIT_BIN, 2.6)
+$(PKG)_SOURCE:=pyserial-$($(PKG)_VERSION).tar.gz
+$(PKG)_SOURCE_MD5:=cde799970b7c1ce1f7d6e9ceebe64c98
+$(PKG)_SITE:=https://pypi.python.org/packages/source/p/pyserial
+
+$(PKG)_DIR:=$($(PKG)_SOURCE_DIR)/pyserial-$($(PKG)_VERSION)
+
+$(PKG)_TARGET_BINARY:=$($(PKG)_DEST_DIR)$(PYTHON_SITE_PKG_DIR)/serial/__init__.py
+
+$(PKG)_DEPENDS_ON := python
+
+$(PKG_SOURCE_DOWNLOAD)
+$(PKG_UNPACKED)
+$(PKG_CONFIGURED_NOP)
+
+$($(PKG)_TARGET_BINARY): $($(PKG)_DIR)/.configured
+ $(call Build/PyMod/PKG, PYTHON_PYSERIAL)
+ touch -c $@
+
+$(pkg):
+
+$(pkg)-precompiled: $($(PKG)_TARGET_BINARY)
+
+$(pkg)-clean:
+ $(RM) -r $(PYTHON_PYSERIAL_DIR)/build
+
+$(pkg)-uninstall:
+ $(RM) -r \
+ $(PYTHON_PYSERIAL_DEST_DIR)$(PYTHON_SITE_PKG_DIR)/serial \
+ $(PYTHON_PYSERIAL_DEST_DIR)$(PYTHON_SITE_PKG_DIR)/pyserial-*.egg-info
+
+$(PKG_FINISH)

0 comments on commit 832ea4f

Please sign in to comment.