merged with acq4

This commit is contained in:
Luke Campagnola 2012-12-27 14:54:00 -05:00
commit ce05e6fb8a
9 changed files with 62 additions and 22 deletions

7
MANIFEST.in Normal file
View File

@ -0,0 +1,7 @@
recursive-include pyqtgraph *.py *.ui *.m README *.txt
recursive-include tests *.py *.ui
recursive-include examples *.py *.ui
recursive-include doc *.rst *.py *.svg *.png *.jpg
recursive-include doc/build/html *
include doc/Makefile doc/make.bat

View File

@ -17,8 +17,7 @@ import sys, os
# add these directories to sys.path here. If the directory is relative to the # add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here. # documentation root, use os.path.abspath to make it absolute, like shown here.
path = os.path.dirname(os.path.abspath(__file__)) path = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.join(path, '..', '..', '..')) sys.path.insert(0, os.path.join(path, '..', '..'))
print sys.path
# -- General configuration ----------------------------------------------------- # -- General configuration -----------------------------------------------------
@ -50,9 +49,9 @@ copyright = '2011, Luke Campagnola'
# built documents. # built documents.
# #
# The short X.Y version. # The short X.Y version.
version = '1.8' version = ''
# The full version, including alpha/beta/rc tags. # The full version, including alpha/beta/rc tags.
release = '1.8' release = ''
# The language for content autogenerated by Sphinx. Refer to documentation # The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages. # for a list of supported languages.

View File

@ -3,8 +3,8 @@
You can adapt this file completely to your liking, but it should at least You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive. contain the root `toctree` directive.
Welcome to the documentation for pyqtgraph 1.8 Welcome to the documentation for pyqtgraph
============================================== ==========================================
Contents: Contents:

View File

@ -2,10 +2,10 @@
import sys, os import sys, os
path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
path.rstrip(os.path.sep) path.rstrip(os.path.sep)
if path.endswith('pyqtgraph'): if 'pyqtgraph' in os.listdir(path):
sys.path.insert(0, os.path.join(path, '..')) ## examples installed inside pyqtgraph package
elif 'pyqtgraph' in os.listdir(path):
sys.path.insert(0, path) ## examples adjacent to pyqtgraph (as in source) sys.path.insert(0, path) ## examples adjacent to pyqtgraph (as in source)
elif path.endswith('pyqtgraph'):
sys.path.insert(0, os.path.abspath(os.path.join(path, '..'))) ## examples installed inside pyqtgraph package
## should force example to use PySide instead of PyQt ## should force example to use PySide instead of PyQt
if 'pyside' in sys.argv: if 'pyside' in sys.argv:

View File

@ -1,5 +1,10 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
REVISION = None """
PyQtGraph - Scientific Graphics and GUI Library for Python
www.pyqtgraph.org
"""
__version__ = None
### import all the goodies and add some helper functions for easy CLI use ### import all the goodies and add some helper functions for easy CLI use
@ -63,19 +68,21 @@ def systemInfo():
from .Qt import VERSION_INFO from .Qt import VERSION_INFO
print("qt bindings: %s" % VERSION_INFO) print("qt bindings: %s" % VERSION_INFO)
global REVISION global __version__
if REVISION is None: ## this code was probably checked out from bzr; look up the last-revision file rev = None
lastRevFile = os.path.join(os.path.dirname(__file__), '.bzr', 'branch', 'last-revision') if __version__ is None: ## this code was probably checked out from bzr; look up the last-revision file
lastRevFile = os.path.join(os.path.dirname(__file__), '..', '.bzr', 'branch', 'last-revision')
if os.path.exists(lastRevFile): if os.path.exists(lastRevFile):
REVISION = open(lastRevFile, 'r').read().strip() rev = open(lastRevFile, 'r').read().strip()
print("pyqtgraph: %s" % REVISION) print("pyqtgraph: %s; %s" % (__version__, rev))
print("config:") print("config:")
import pprint import pprint
pprint.pprint(CONFIG_OPTIONS) pprint.pprint(CONFIG_OPTIONS)
## Rename orphaned .pyc files. This is *probably* safe :) ## Rename orphaned .pyc files. This is *probably* safe :)
## We only do this if __version__ is None, indicating the code was probably pulled
## from the repository.
def renamePyc(startDir): def renamePyc(startDir):
### Used to rename orphaned .pyc files ### Used to rename orphaned .pyc files
### When a python file changes its location in the repository, usually the .pyc file ### When a python file changes its location in the repository, usually the .pyc file
@ -108,9 +115,8 @@ def renamePyc(startDir):
print(" " + name2) print(" " + name2)
os.rename(fileName, name2) os.rename(fileName, name2)
import os
path = os.path.split(__file__)[0] path = os.path.split(__file__)[0]
if not hasattr(sys, 'frozen'): ## If we are frozen, there's a good chance we don't have the original .py files anymore. if __version__ is None and not hasattr(sys, 'frozen') and sys.version_info[0] == 2: ## If we are frozen, there's a good chance we don't have the original .py files anymore.
renamePyc(path) renamePyc(path)

View File

@ -158,6 +158,8 @@ class PlotItem(GraphicsWidget):
self.autoAlpha = True self.autoAlpha = True
self.spectrumMode = False self.spectrumMode = False
self.legend = None
## Create and place axis items ## Create and place axis items
if axisItems is None: if axisItems is None:
axisItems = {} axisItems = {}
@ -538,7 +540,7 @@ class PlotItem(GraphicsWidget):
#item.sigPlotChanged.connect(self.plotChanged) #item.sigPlotChanged.connect(self.plotChanged)
#self.plotChanged() #self.plotChanged()
name = kargs.get('name', getattr(item, 'opts', {}).get('name', None)) name = kargs.get('name', getattr(item, 'opts', {}).get('name', None))
if name is not None and self.legend is not None: if name is not None and hasattr(self, 'legend') and self.legend is not None:
self.legend.addItem(item, name=name) self.legend.addItem(item, name=name)

View File

@ -1,11 +1,19 @@
from distutils.core import setup from distutils.core import setup
import distutils.dir_util
import os import os
## generate list of all sub-packages ## generate list of all sub-packages
subdirs = [i[0].split(os.path.sep)[1:] for i in os.walk('./pyqtgraph') if '__init__.py' in i[2]] path = os.path.abspath(os.path.dirname(__file__))
subdirs = filter(lambda p: len(p) == 1 or p[1] != 'build', subdirs) n = len(path.split(os.path.sep))
subdirs = [i[0].split(os.path.sep)[n:] for i in os.walk(os.path.join(path, 'pyqtgraph')) if '__init__.py' in i[2]]
all_packages = ['.'.join(p) for p in subdirs] + ['pyqtgraph.examples'] all_packages = ['.'.join(p) for p in subdirs] + ['pyqtgraph.examples']
## Make sure build directory is clean before installing
buildPath = os.path.join(path, 'build')
if os.path.isdir(buildPath):
distutils.dir_util.remove_tree(buildPath)
setup(name='pyqtgraph', setup(name='pyqtgraph',
version='', version='',
description='Scientific Graphics and GUI Library for Python', description='Scientific Graphics and GUI Library for Python',
@ -23,6 +31,9 @@ It is intended for use in mathematics / scientific / engineering applications. D
#package_data={'pyqtgraph': ['graphicsItems/PlotItem/*.png']}, #package_data={'pyqtgraph': ['graphicsItems/PlotItem/*.png']},
classifiers = [ classifiers = [
"Programming Language :: Python", "Programming Language :: Python",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
"Development Status :: 4 - Beta", "Development Status :: 4 - Beta",
"Environment :: Other Environment", "Environment :: Other Environment",
@ -33,7 +44,7 @@ It is intended for use in mathematics / scientific / engineering applications. D
"Topic :: Scientific/Engineering :: Visualization", "Topic :: Scientific/Engineering :: Visualization",
"Topic :: Software Development :: User Interfaces", "Topic :: Software Development :: User Interfaces",
], ],
requires = [ install_requires = [
'numpy', 'numpy',
'scipy', 'scipy',
], ],

13
tools/DEBIAN/control Normal file
View File

@ -0,0 +1,13 @@
Package: python-pyqtgraph
Version: 0.9.0
Section: python
Priority: optional
Architecture: all
Essential: no
Installed-Size: 5048
Maintainer: Luke Campagnola <luke.campagnola@gmail.com>
Homepage: http://luke.campagnola.me/code/pyqtgraph
Depends: python (>= 2.6), python-qt4 | python-pyside, python-scipy, python-numpy
Suggests: python-opengl, python-qt4-gl
Description: Scientific Graphics and GUI Library for Python
PyQtGraph is a pure-python graphics and GUI library built on PyQt4 and numpy. It is intended for use in mathematics / scientific / engineering applications. Despite being written entirely in python, the library is very fast due to its heavy leverage of numpy for number crunching and Qt's GraphicsView framework for fast display.

2
tools/DEBIAN/postrm Executable file
View File

@ -0,0 +1,2 @@
#!/bin/sh
rm -rf /usr/lib/python2.7/dist-packages/pyqtgraph