Repository: obspy/obspy

Issue:
debian packages version string
It seems that during Debian packaging of stable release versions the "dirty" prefix is not stripped from the version number correctly everywhere:

```
$ obspy-scan ??/*/*/*
25 BW/BGLD/LOG.L/BW.BGLD..LOG.L.2013.104Traceback (most recent call last):
  File "/usr/bin/obspy-scan", line 9, in <module>
    load_entry_point('obspy==0.8.3-dirty', 'console_scripts',
'obspy-scan')()
  File "/usr/lib/pymodules/python2.6/obspy/imaging/scripts/scan.py",
line 239, in main
    options.verbose, options.ignore_links)
  File "/usr/lib/pymodules/python2.6/obspy/imaging/scripts/scan.py",
line 108, in recursive_parse
    format, verbose)
  File "/usr/lib/pymodules/python2.6/obspy/imaging/scripts/scan.py",
line 97, in parse_file_to_dict
    1.0 / (24 * 3600 * tr.stats.sampling_rate))
ZeroDivisionError: float division
```



Discussion:

Resolving patch:
diff --git a/obspy/station/inventory.py b/obspy/station/inventory.py
--- a/obspy/station/inventory.py
+++ b/obspy/station/inventory.py
@@ -529,8 +529,15 @@ def plot(self, projection='cyl', resolution='l',
             count = len(ax.collections)
             for code, color in sorted(color_per_network.items()):
                 ax.scatter([0], [0], size, color, label=code, marker=marker)
-            ax.legend(loc=legend, fancybox=True, scatterpoints=1,
-                      fontsize="medium", markerscale=0.8, handletextpad=0.1)
+            # workaround for older matplotlib versions
+            try:
+                ax.legend(loc=legend, fancybox=True, scatterpoints=1,
+                          fontsize="medium", markerscale=0.8,
+                          handletextpad=0.1)
+            except TypeError:
+                leg_ = ax.legend(loc=legend, fancybox=True, scatterpoints=1,
+                                 markerscale=0.8, handletextpad=0.1)
+                leg_.prop.set_size("medium")
             # remove collections again solely created for legend handles
             ax.collections = ax.collections[:count]
 
diff --git a/obspy/station/response.py b/obspy/station/response.py
--- a/obspy/station/response.py
+++ b/obspy/station/response.py
@@ -1516,7 +1516,12 @@ def _adjust_bode_plot_figure(fig, grid=True, show=True):
     # make more room in between subplots for the ylabel of right plot
     fig.subplots_adjust(hspace=0.02, top=0.87, right=0.82)
     ax1, ax2 = fig.axes[:2]
-    ax1.legend(loc="lower center", ncol=3, fontsize='small')
+    # workaround for older matplotlib versions
+    try:
+        ax1.legend(loc="lower center", ncol=3, fontsize='small')
+    except TypeError:
+        leg_ = ax1.legend(loc="lower center", ncol=3)
+        leg_.prop.set_size("small")
     plt.setp(ax1.get_xticklabels(), visible=False)
     plt.setp(ax2.get_yticklabels()[-1], visible=False)
     ax1.set_ylabel('Amplitude')
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -340,6 +340,11 @@
         'bandpass_preview = obspy.db.feature:BandpassPreviewFeature',
     ],
 }
+# PY3: rename entry points for executable scripts to "obspy3-..."
+if sys.version_info[0] == 3:
+    ENTRY_POINTS['console_scripts'] = [
+        string.replace("obspy", "obspy3", 1)
+        for string in ENTRY_POINTS['console_scripts']]
 
 
 def find_packages():


Test patch: