From 405e6679c83c8c91da96bcf2feb65ac4ba7994b4 Mon Sep 17 00:00:00 2001 From: "Michal Krenek (Mikos)" Date: Fri, 24 Apr 2015 16:26:42 +0200 Subject: [PATCH] Code refactoring before publishing on PyPI --- .gitignore | 9 +++++---- MANIFEST.in | 2 ++ README.md => README.rst | 12 ++++++------ .../{qspectrumanalyzer.py => __main__.py} | 0 scripts/qspectrumanalyzer | 4 ++-- setup.py | 17 ++++++++++++++++- 6 files changed, 31 insertions(+), 13 deletions(-) create mode 100644 MANIFEST.in rename README.md => README.rst (70%) rename qspectrumanalyzer/{qspectrumanalyzer.py => __main__.py} (100%) diff --git a/.gitignore b/.gitignore index edc2383..b355436 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ -# Backup files -*~ - -# Compiled Python files +__pycache__/ *.py[cod] + +build/ +dist/ +MANIFEST diff --git a/MANIFEST.in b/MANIFEST.in new file mode 100644 index 0000000..9d5d250 --- /dev/null +++ b/MANIFEST.in @@ -0,0 +1,2 @@ +include LICENSE +include README.rst diff --git a/README.md b/README.rst similarity index 70% rename from README.md rename to README.rst index 97bd859..8785900 100644 --- a/README.md +++ b/README.rst @@ -6,7 +6,7 @@ Spectrum analyzer for RTL-SDR (GUI for rtl_power based on PyQtGraph) Screenshot ---------- -![QSpectrumAnalyzer](https://xmikos.github.io/qspectrumanalyzer/qspectrumanalyzer_screenshot.png) +.. image:: https://xmikos.github.io/qspectrumanalyzer/qspectrumanalyzer_screenshot.png Requirements ------------ @@ -17,16 +17,16 @@ Requirements - rtl-sdr (https://github.com/keenerd/rtl-sdr) You should use Keenerds fork of rtl-sdr (latest Git revision), -bacause `rtl_power` in original rtl-sdr (from osmocom.org) is broken +bacause ``rtl_power`` in original rtl-sdr (from osmocom.org) is broken (especially when used with cropping). Usage ----- -Start QSpectrumAnalyzer by running `qspectrumanalyzer`. +Start QSpectrumAnalyzer by running ``qspectrumanalyzer``. -If you don't have `rtl_power` executable in system path, you can specify -location of it manually in _File_ -> _Settings_. You can also specify waterfall +If you don't have ``rtl_power`` executable in system path, you can specify +location of it manually in *File* -> *Settings*. You can also specify waterfall plot history size in there. Default is 100 lines, be aware that really large sweeps (with a lot of bins) would require a lot of system memory, so don't make this number too big. @@ -34,7 +34,7 @@ this number too big. Controls should be intuitive, but if you want consistent results, you should turn off automatic gain control (set it to some fixed number) and also set crop to 20% or more. For finding out ppm correction factor for your rtl-sdr -stick, use [kalibrate-rtl](https://github.com/steve-m/kalibrate-rtl). +stick, use `kalibrate-rtl `_. You can move and zoom plot with mouse, change plot settings or export plots from right-click menu. Waterfall plot black/white levels and color lookup diff --git a/qspectrumanalyzer/qspectrumanalyzer.py b/qspectrumanalyzer/__main__.py similarity index 100% rename from qspectrumanalyzer/qspectrumanalyzer.py rename to qspectrumanalyzer/__main__.py diff --git a/scripts/qspectrumanalyzer b/scripts/qspectrumanalyzer index 3c91945..c0f38fb 100755 --- a/scripts/qspectrumanalyzer +++ b/scripts/qspectrumanalyzer @@ -1,4 +1,4 @@ #!/usr/bin/env python -from qspectrumanalyzer import qspectrumanalyzer -qspectrumanalyzer.main() +from qspectrumanalyzer import __main__ +__main__.main() diff --git a/setup.py b/setup.py index b248357..5c15c82 100755 --- a/setup.py +++ b/setup.py @@ -14,4 +14,19 @@ setup(name="QSpectrumAnalyzer", data_files=[("share/applications", ["qspectrumanalyzer.desktop"]), ("share/pixmaps", ["qspectrumanalyzer.png"])], scripts=["scripts/qspectrumanalyzer"], - requires=["PyQt4", "pyqtgraph"]) + requires=["PyQt4", "pyqtgraph"], + classifiers=[ + 'Development Status :: 4 - Beta', + 'Environment :: MacOS X', + 'Environment :: Win32 (MS Windows)', + 'Environment :: X11 Applications :: Qt', + 'Intended Audience :: End Users/Desktop', + 'Intended Audience :: Science/Research', + 'Intended Audience :: Telecommunications Industry', + 'License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)', + 'Natural Language :: English', + 'Operating System :: OS Independent', + 'Programming Language :: Python :: 3', + 'Topic :: Communications :: Ham Radio', + 'Topic :: Scientific/Engineering :: Visualization' + ])