[printrun] Initial import (#863796)

Miro Hrončok churchyard at fedoraproject.org
Wed Jan 23 13:36:43 UTC 2013


commit b6f9de5069d6eafa80a04283faba56e3e47167b1
Author: Miro Hrončok <miro at hroncok.cz>
Date:   Wed Jan 23 14:36:37 2013 +0100

    Initial import (#863796)

 .gitignore              |    1 +
 plater.desktop          |    9 ++
 printrun-pull-318.patch |   82 +++++++++++++++++
 printrun.spec           |  221 +++++++++++++++++++++++++++++++++++++++++++++++
 pronsole.desktop        |    9 ++
 pronterface.desktop     |    9 ++
 sources                 |    1 +
 7 files changed, 332 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..6accfa2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/printrun-0.0-5897fbc.tar.gz
diff --git a/plater.desktop b/plater.desktop
new file mode 100644
index 0000000..5b3251c
--- /dev/null
+++ b/plater.desktop
@@ -0,0 +1,9 @@
+
+[Desktop Entry]
+Name=Plater
+GenericName=Plate building tool
+Exec=plater.py
+Icon=/usr/share/pixmaps/plater.ico
+Terminal=false
+Type=Application
+Categories=Graphics;
diff --git a/printrun-pull-318.patch b/printrun-pull-318.patch
new file mode 100644
index 0000000..f8b0f4d
--- /dev/null
+++ b/printrun-pull-318.patch
@@ -0,0 +1,82 @@
+From f942c1a00724a87ef0d115cc237bf48f8c837a70 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro at hroncok.cz>
+Date: Tue, 15 Jan 2013 21:22:56 +0100
+Subject: [PATCH] Tell the user, there was an error while connecting
+
+Before, when there was an error while connecting, user didn't know, when
+Pronterface wasn't launched from the terminal.
+
+So you could just hit Connect button several times and all you've get was:
+Connecting...
+Connecting...
+Connecting...
+
+Now, when there is an exception during the connection, the user will notice:
+Connecting...
+Error: You are trying to connect to a non-exisiting port.
+
+Or:
+Connecting...
+Error: You don't have permission to open /dev/ttyUSB0.
+You might need to add yourself to the dialout group.
+
+Unfortunately pyserial's SerialException doesn't provide errno yet, so the
+message isn't so user friendly:
+Connecting...
+could not open port None: [Errno 2] No such file or directory: 'None'
+
+I've filled a bug report with patch to pyserial.
+
+Together with this I've realised, there is unnecessary UTF8 decoding of the
+output. When user has UTF-8 locale, there was an exception when printing the
+exception to the output (almost an exception inception). So I have dropped it,
+but feel free to add it back, if I broke anything else.
+---
+ pronterface.py |   17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/pronterface.py b/pronterface.py
+index 476ffb9..c13b8f7 100755
+--- a/pronterface.py
++++ b/pronterface.py
+@@ -28,6 +28,7 @@
+ import sys, glob, time, datetime, threading, traceback, cStringIO, subprocess
+ 
+ from printrun.pronterface_widgets import *
++from serial import SerialException
+ 
+ StringIO = cStringIO
+ 
+@@ -72,7 +73,7 @@ def write(self, data):
+             self.target(data)
+         except:
+             pass
+-        self.stdout.write(data.encode("utf-8"))
++        self.stdout.write(data)
+     def flush(self):
+         self.stdout.flush()
+ 
+@@ -1420,7 +1421,19 @@ def connect(self, event):
+             self.paused = 0
+             if self.sdprinting:
+                 self.p.send_now("M26 S0")
+-        self.p.connect(port, baud)
++        try:
++            self.p.connect(port, baud)
++        except SerialException as e:
++            # Currently, there is no errno, but it should be there in the future
++            if e.errno == 2:
++                print _("Error: You are trying to connect to a non-exisiting port.")
++            elif e.errno == 8:
++                print _("Error: You don't have permission to open %s.") % port
++                print _("You might need to add yourself to the dialout group.")
++            else:
++                print e
++            # Kill the thread anyway
++            raise
+         self.statuscheck = True
+         if port != self.settings.port:
+             self.set("port", port)
+-- 
+1.7.10
+
diff --git a/printrun.spec b/printrun.spec
new file mode 100644
index 0000000..1670906
--- /dev/null
+++ b/printrun.spec
@@ -0,0 +1,221 @@
+%global commit 5897fbc60f761dd273c6692b7bf1d75bce981351
+%global shortcommit %(c=%{commit}; echo ${c:0:7})
+%global snapshot 20130113git%{shortcommit}
+Name:           printrun
+Version:        0.0
+Release:        19.%{snapshot}%{?dist}
+Summary:        RepRap printer interface and tools
+License:        GPLv3+
+Group:          Applications/Engineering
+URL:            https://github.com/kliment/Printrun
+Source0:        https://github.com/kliment/Printrun/archive/%{commit}/%{name}-%{version}-%{shortcommit}.tar.gz
+
+# Desktop files
+Source1:        pronsole.desktop
+Source2:        pronterface.desktop
+Source3:        plater.desktop
+
+# https://github.com/kliment/Printrun/pull/318
+Patch0:         %{name}-pull-318.patch
+
+BuildArch:      noarch
+BuildRequires:  python2-devel
+BuildRequires:  desktop-file-utils
+BuildRequires:  gettext
+Requires:       pronterface = %{version}-%{release}
+Requires:       pronsole = %{version}-%{release}
+Requires:       plater = %{version}-%{release}
+
+%description
+Printrun is a set of G-code sending applications for RepRap.
+It consists of printcore (dumb G-code sender), pronsole (featured command line
+G-code sender), pronterface (featured G-code sender with graphical user
+interface), and a small collection of helpful scripts. Together with skeinforge
+they form a pretty powerful softwarecombo. This package installs whole Printrun.
+
+###############################################
+
+%package        common
+Summary:        Common files for Printrun
+Requires:       pyserial
+
+%description    common
+Printrun is a set of G-code sending applications for RepRap.
+This package contains common files.
+
+###############################################
+
+%package     -n pronsole
+Summary:        CLI interface for RepRap
+Requires:       %{name}-common = %{version}-%{release}
+Requires:       skeinforge
+
+%description -n pronsole
+Pronsole is a featured command line G-code sender.
+It controls the ReRap printer and integrates skeinforge.
+It is a part of Printrun.
+
+###############################################
+
+%package     -n pronterface
+Summary:        GUI interface for RepRap
+Requires:       wxPython
+Requires:       pronsole = %{version}-%{release}
+
+%description -n pronterface
+Pronterface is a featured G-code sender with graphical user interface.
+It controls the ReRap printer and integrates skeinforge.
+It is a part of Printrun.
+
+###############################################
+
+%package     -n plater
+Summary:        RepRap STL plater
+Requires:       wxPython
+Requires:       %{name}-common = %{version}-%{release}
+
+%description -n plater
+Plater is a GUI tool to prepare printing plate from STL files for ReRap.
+It is a part of Printrun.
+
+###############################################
+
+
+%prep
+%setup -qn Printrun-%{commit}
+%patch0 -p1
+
+# use launchers for skeinforge
+sed -i 's|python skeinforge/skeinforge_application/skeinforge.py|skeinforge|' pronsole.py
+sed -i 's|python skeinforge/skeinforge_application/skeinforge_utilities/skeinforge_craft.py|skeinforge-craft|' pronsole.py
+
+%build
+CFLAGS="$RPM_OPT_FLAGS" %{__python} setup.py build
+
+# rebuild locales
+cd locale
+for FILE in *
+  do msgfmt $FILE/LC_MESSAGES/plater.po -o $FILE/LC_MESSAGES/plater.mo || echo plater not there
+     msgfmt $FILE/LC_MESSAGES/pronterface.po -o $FILE/LC_MESSAGES/pronterface.mo || echo pronterface not there
+done
+cd ..
+
+%install
+%{__python} setup.py install --skip-build --prefix %{buildroot}%{_prefix}
+
+# desktop files
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE1}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE2}
+desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{SOURCE3}
+
+# locales
+mkdir -p %{buildroot}%{_datadir}/locale
+cp -ar %{buildroot}%{_datadir}/pronterface/locale/* %{buildroot}%{_datadir}/locale
+rm -rf %{buildroot}%{_datadir}/pronterface/locale
+ln -s -f %{_datadir}/locale/ %{buildroot}%{_datadir}/pronterface/ # the app expects the locale folder in here
+
+# exacutables
+cd %{buildroot}%{python_sitelib}/%{name}
+chmod +x gcview.py graph.py stlview.py SkeinforgeQuickEditDialog.py calibrateextruder.py webinterface.py
+cd -
+
+%{find_lang} pronterface
+%{find_lang} plater
+
+%files
+%doc README* COPYING
+
+%files common
+%{python_sitelib}/%{name}
+%{python_sitelib}/Printrun*
+%{_bindir}/printcore.*
+%doc README* COPYING
+
+%files -n pronsole
+%{_bindir}/pronsole.*
+%{_bindir}/gcoder.*
+%{_datadir}/pixmaps/pronsole.ico
+%{_datadir}/applications/pronsole.desktop
+%doc README* COPYING
+
+%files -n pronterface -f pronterface.lang
+%{_bindir}/pronterface.*
+%{_datadir}/pronterface
+%{_datadir}/pixmaps/P-face.ico
+%{_datadir}/applications/pronterface.desktop
+%doc README* COPYING
+
+%files -n plater -f plater.lang
+%{_bindir}/plater.*
+%{_datadir}/pixmaps/plater.ico
+%{_datadir}/applications/plater.desktop
+%doc README* COPYING
+
+%changelog
+* Sat Jan 19 2013 Miro Hrončok <mhroncok at redhat.com> - 0.0-19.20130113git5897fbc
+- Removed run-time deps, that are resolved automatically
+
+* Sat Jan 19 2013 Miro Hrončok <mhroncok at redhat.com> - 0.0-18.20130113git5897fbc
+- Added patch from my pull request
+
+* Sun Jan 13 2013 Miro Hrončok <mhroncok at redhat.com> - 0.0-17.20130113git5897fbc
+- New "version" (bugfix)
+
+* Sun Jan 13 2013 Miro Hrončok <mhroncok at redhat.com> - 0.0-16.20130113git094dffa
+- New upstream "version", where everything is GPLv3+
+- pronsole.ico and gcoder.py now part of setup.py
+- Skeinforge path changing moved from %%install to %%prep
+- Commented macros in changelog
+- Use skeinforge launchers in default settings
+- Pronterface lang moved from common to pronterface, is not needed by pronsole any more
+
+* Wed Jan 09 2013 Miro Hrončok <mhroncok at redhat.com> - 0.0-15.20121103git6fa4766
+- Updated to respect new GitHub rule
+
+* Mon Dec 31 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-14.20121103git6fa47668f2
+- Changed location of skeinforge from %%{_datadir}/%%{name}/
+                                   to %%{python_sitelib}/%%{name}
+
+* Sun Dec 30 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-13.20121103git6fa47668f2
+- Do not download the desktop files from my GitHub
+
+* Fri Nov 23 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-12.20121103git6fa47668f2
+- Fixing a source mistake
+- Redone, using setup.py now
+
+* Fri Nov 23 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-11.20121103git6fa47668f2
+- New upstream "version" (merge from experimetal)
+- Commented macros in comments
+- Playing a bit with attr
+
+* Mon Oct 29 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-10-20120924gitb6935b93
+- Switched generic names and names in desktop files
+- Don't use rm, cp and ln -s macros
+
+* Tue Oct 09 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-9-20120924gitb6935b93
+- updated bash lounchers
+
+* Tue Oct 09 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-8-20120924gitb6935b93
+- ln -s skeinforge
+- printrun requires exact version and release
+
+* Thu Oct 04 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-7-20120924gitb6935b93
+- New sources links
+
+* Fri Sep 22 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-6-20120924gitb6935b93
+- New commits, inlude the license
+
+* Fri Sep 22 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-5-20120921gitdceaf26f
+- launching scripts now pass the params
+
+* Fri Sep 21 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-4-20120921gitdceaf26f
+- Build gettext
+
+* Fri Sep 21 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-3-20120921gitdceaf26f
+- BuildRequires:  desktop-file-utils
+
+* Fri Sep 21 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-2-20120921gitdceaf26f
+- Language files correctly added
+
+* Fri Sep 21 2012 Miro Hrončok <miro at hroncok.cz> - 0.0-1-20120921gitdceaf26f
+- New package
diff --git a/pronsole.desktop b/pronsole.desktop
new file mode 100644
index 0000000..4b3bc3e
--- /dev/null
+++ b/pronsole.desktop
@@ -0,0 +1,9 @@
+
+[Desktop Entry]
+Name=Pronsole
+GenericName=Printer console
+Exec=pronsole.py
+Icon=/usr/share/pixmaps/pronsole.ico
+Terminal=true
+Type=Application
+Categories=Graphics;
diff --git a/pronterface.desktop b/pronterface.desktop
new file mode 100644
index 0000000..bc462b5
--- /dev/null
+++ b/pronterface.desktop
@@ -0,0 +1,9 @@
+
+[Desktop Entry]
+Name=Pronterface
+GenericName=Printer Interface
+Exec=pronterface.py
+Icon=/usr/share/pixmaps/P-face.ico
+Terminal=false
+Type=Application
+Categories=Graphics;
diff --git a/sources b/sources
index e69de29..931f986 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+7a6c9aad7e939fad19aa0a16100c7de9  printrun-0.0-5897fbc.tar.gz


More information about the scm-commits mailing list