From 5e27ab70e29701631b1ab1e9d8e23e6b0329d8a3 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Wed, 26 Dec 2012 20:12:49 -0500 Subject: [PATCH 1/4] Fixed bug 1089042 (AttributeError in PlotItem) --- graphicsItems/PlotItem/PlotItem.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/graphicsItems/PlotItem/PlotItem.py b/graphicsItems/PlotItem/PlotItem.py index 6c2e1a6f..c362ffb5 100644 --- a/graphicsItems/PlotItem/PlotItem.py +++ b/graphicsItems/PlotItem/PlotItem.py @@ -158,6 +158,8 @@ class PlotItem(GraphicsWidget): self.autoAlpha = True self.spectrumMode = False + self.legend = None + ## Create and place axis items if axisItems is None: axisItems = {} @@ -538,7 +540,7 @@ class PlotItem(GraphicsWidget): #item.sigPlotChanged.connect(self.plotChanged) #self.plotChanged() 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) From b85fa5cb03ca5cec94ea6587867a3ee865ad495b Mon Sep 17 00:00:00 2001 From: Luke Campagnola <> Date: Thu, 27 Dec 2012 01:52:32 -0500 Subject: [PATCH 2/4] Added MANIFEST.in for generating cleaner source distributions updated versioning system --- __init__.py | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/__init__.py b/__init__.py index 6e950770..93d9f7b8 100644 --- a/__init__.py +++ b/__init__.py @@ -1,5 +1,10 @@ # -*- 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 @@ -63,19 +68,21 @@ def systemInfo(): from .Qt import VERSION_INFO print("qt bindings: %s" % VERSION_INFO) - global REVISION - if REVISION 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') + global __version__ + rev = None + 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): - REVISION = open(lastRevFile, 'r').read().strip() + rev = open(lastRevFile, 'r').read().strip() - print("pyqtgraph: %s" % REVISION) + print("pyqtgraph: %s; %s" % (__version__, rev)) print("config:") import pprint pprint.pprint(CONFIG_OPTIONS) ## 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): ### Used to rename orphaned .pyc files ### When a python file changes its location in the repository, usually the .pyc file @@ -108,9 +115,8 @@ def renamePyc(startDir): print(" " + name2) os.rename(fileName, name2) -import os 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) From ddbbfc4cc83828ecc3d2664d1840f9227b2a4e16 Mon Sep 17 00:00:00 2001 From: Luke Campagnola <> Date: Thu, 27 Dec 2012 03:13:35 -0500 Subject: [PATCH 3/4] Fixed doc version (again) Added debian control files --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 93d9f7b8..2998be79 100644 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,7 @@ PyQtGraph - Scientific Graphics and GUI Library for Python www.pyqtgraph.org """ -__version__ = None +__version__ = '0.9.0' ### import all the goodies and add some helper functions for easy CLI use From dfa300d11baec67da0f3e83f9234ec9ff82db57c Mon Sep 17 00:00:00 2001 From: Luke Campagnola <> Date: Thu, 27 Dec 2012 11:53:22 -0500 Subject: [PATCH 4/4] Removed incorrect version numbers --- __init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index 2998be79..93d9f7b8 100644 --- a/__init__.py +++ b/__init__.py @@ -4,7 +4,7 @@ PyQtGraph - Scientific Graphics and GUI Library for Python www.pyqtgraph.org """ -__version__ = '0.9.0' +__version__ = None ### import all the goodies and add some helper functions for easy CLI use