merged with acq4
This commit is contained in:
commit
b06204b492
24
__init__.py
24
__init__.py
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user