printrun-no-py-in-binaries.patch 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. diff -urN Printrun-printrun-20140730.old/plater Printrun-printrun-20140730/plater
  2. --- Printrun-printrun-20140730.old/plater 1970-01-01 01:00:00.000000000 +0100
  3. +++ Printrun-printrun-20140730/plater 2014-06-06 12:04:34.000000000 +0200
  4. @@ -0,0 +1,27 @@
  5. +#!/usr/bin/env python
  6. +
  7. +# This file is part of the Printrun suite.
  8. +#
  9. +# Printrun is free software: you can redistribute it and/or modify
  10. +# it under the terms of the GNU General Public License as published by
  11. +# the Free Software Foundation, either version 3 of the License, or
  12. +# (at your option) any later version.
  13. +#
  14. +# Printrun is distributed in the hope that it will be useful,
  15. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. +# GNU General Public License for more details.
  18. +#
  19. +# You should have received a copy of the GNU General Public License
  20. +# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  21. +
  22. +import sys
  23. +import wx
  24. +
  25. +from printrun.stlplater import StlPlater
  26. +
  27. +if __name__ == '__main__':
  28. + app = wx.App(False)
  29. + main = StlPlater(sys.argv[1:])
  30. + main.Show()
  31. + app.MainLoop()
  32. diff -urN Printrun-printrun-20140730.old/plater.py Printrun-printrun-20140730/plater.py
  33. --- Printrun-printrun-20140730.old/plater.py 2014-08-10 15:44:04.877086955 +0200
  34. +++ Printrun-printrun-20140730/plater.py 1970-01-01 01:00:00.000000000 +0100
  35. @@ -1,27 +0,0 @@
  36. -#!/usr/bin/env python
  37. -
  38. -# This file is part of the Printrun suite.
  39. -#
  40. -# Printrun is free software: you can redistribute it and/or modify
  41. -# it under the terms of the GNU General Public License as published by
  42. -# the Free Software Foundation, either version 3 of the License, or
  43. -# (at your option) any later version.
  44. -#
  45. -# Printrun is distributed in the hope that it will be useful,
  46. -# but WITHOUT ANY WARRANTY; without even the implied warranty of
  47. -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  48. -# GNU General Public License for more details.
  49. -#
  50. -# You should have received a copy of the GNU General Public License
  51. -# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  52. -
  53. -import sys
  54. -import wx
  55. -
  56. -from printrun.stlplater import StlPlater
  57. -
  58. -if __name__ == '__main__':
  59. - app = wx.App(False)
  60. - main = StlPlater(sys.argv[1:])
  61. - main.Show()
  62. - app.MainLoop()
  63. diff -urN Printrun-printrun-20140730.old/printcore Printrun-printrun-20140730/printcore
  64. --- Printrun-printrun-20140730.old/printcore 1970-01-01 01:00:00.000000000 +0100
  65. +++ Printrun-printrun-20140730/printcore 2014-06-06 12:04:34.000000000 +0200
  66. @@ -0,0 +1,76 @@
  67. +#!/usr/bin/env python
  68. +
  69. +# This file is part of the Printrun suite.
  70. +#
  71. +# Printrun is free software: you can redistribute it and/or modify
  72. +# it under the terms of the GNU General Public License as published by
  73. +# the Free Software Foundation, either version 3 of the License, or
  74. +# (at your option) any later version.
  75. +#
  76. +# Printrun is distributed in the hope that it will be useful,
  77. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  78. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  79. +# GNU General Public License for more details.
  80. +#
  81. +# You should have received a copy of the GNU General Public License
  82. +# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  83. +
  84. +import time
  85. +import getopt
  86. +import sys
  87. +
  88. +from printrun.printcore import printcore
  89. +from printrun import gcoder
  90. +
  91. +if __name__ == '__main__':
  92. + baud = 115200
  93. + loud = False
  94. + statusreport = False
  95. + try:
  96. + opts, args = getopt.getopt(sys.argv[1:], "h,b:,v,s",
  97. + ["help", "baud", "verbose", "statusreport"])
  98. + except getopt.GetoptError, err:
  99. + print str(err)
  100. + sys.exit(2)
  101. + for o, a in opts:
  102. + if o in ('-h', '--help'):
  103. + # FIXME: Fix help
  104. + print ("Opts are: --help, -b --baud = baudrate, -v --verbose, "
  105. + "-s --statusreport")
  106. + sys.exit(1)
  107. + if o in ('-b', '--baud'):
  108. + baud = int(a)
  109. + if o in ('-v', '--verbose'):
  110. + loud = True
  111. + elif o in ('-s', '--statusreport'):
  112. + statusreport = True
  113. +
  114. + if len(args) > 1:
  115. + port = args[-2]
  116. + filename = args[-1]
  117. + print "Printing: %s on %s with baudrate %d" % (filename, port, baud)
  118. + else:
  119. + print "Usage: python [-h|-b|-v|-s] printcore.py /dev/tty[USB|ACM]x filename.gcode"
  120. + sys.exit(2)
  121. + p = printcore(port, baud)
  122. + p.loud = loud
  123. + time.sleep(2)
  124. + gcode = [i.strip() for i in open(filename)]
  125. + gcode = gcoder.LightGCode(gcode)
  126. + p.startprint(gcode)
  127. +
  128. + try:
  129. + if statusreport:
  130. + p.loud = False
  131. + sys.stdout.write("Progress: 00.0%\r")
  132. + sys.stdout.flush()
  133. + while p.printing:
  134. + time.sleep(1)
  135. + if statusreport:
  136. + progress = 100 * float(p.queueindex) / len(p.mainqueue)
  137. + sys.stdout.write("Progress: %02.1f%%\r" % progress)
  138. + sys.stdout.flush()
  139. + p.disconnect()
  140. + sys.exit(0)
  141. + except:
  142. + p.disconnect()
  143. diff -urN Printrun-printrun-20140730.old/printcore.py Printrun-printrun-20140730/printcore.py
  144. --- Printrun-printrun-20140730.old/printcore.py 2014-08-10 15:44:04.881086932 +0200
  145. +++ Printrun-printrun-20140730/printcore.py 1970-01-01 01:00:00.000000000 +0100
  146. @@ -1,76 +0,0 @@
  147. -#!/usr/bin/env python
  148. -
  149. -# This file is part of the Printrun suite.
  150. -#
  151. -# Printrun is free software: you can redistribute it and/or modify
  152. -# it under the terms of the GNU General Public License as published by
  153. -# the Free Software Foundation, either version 3 of the License, or
  154. -# (at your option) any later version.
  155. -#
  156. -# Printrun is distributed in the hope that it will be useful,
  157. -# but WITHOUT ANY WARRANTY; without even the implied warranty of
  158. -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  159. -# GNU General Public License for more details.
  160. -#
  161. -# You should have received a copy of the GNU General Public License
  162. -# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  163. -
  164. -import time
  165. -import getopt
  166. -import sys
  167. -
  168. -from printrun.printcore import printcore
  169. -from printrun import gcoder
  170. -
  171. -if __name__ == '__main__':
  172. - baud = 115200
  173. - loud = False
  174. - statusreport = False
  175. - try:
  176. - opts, args = getopt.getopt(sys.argv[1:], "h,b:,v,s",
  177. - ["help", "baud", "verbose", "statusreport"])
  178. - except getopt.GetoptError, err:
  179. - print str(err)
  180. - sys.exit(2)
  181. - for o, a in opts:
  182. - if o in ('-h', '--help'):
  183. - # FIXME: Fix help
  184. - print ("Opts are: --help, -b --baud = baudrate, -v --verbose, "
  185. - "-s --statusreport")
  186. - sys.exit(1)
  187. - if o in ('-b', '--baud'):
  188. - baud = int(a)
  189. - if o in ('-v', '--verbose'):
  190. - loud = True
  191. - elif o in ('-s', '--statusreport'):
  192. - statusreport = True
  193. -
  194. - if len(args) > 1:
  195. - port = args[-2]
  196. - filename = args[-1]
  197. - print "Printing: %s on %s with baudrate %d" % (filename, port, baud)
  198. - else:
  199. - print "Usage: python [-h|-b|-v|-s] printcore.py /dev/tty[USB|ACM]x filename.gcode"
  200. - sys.exit(2)
  201. - p = printcore(port, baud)
  202. - p.loud = loud
  203. - time.sleep(2)
  204. - gcode = [i.strip() for i in open(filename)]
  205. - gcode = gcoder.LightGCode(gcode)
  206. - p.startprint(gcode)
  207. -
  208. - try:
  209. - if statusreport:
  210. - p.loud = False
  211. - sys.stdout.write("Progress: 00.0%\r")
  212. - sys.stdout.flush()
  213. - while p.printing:
  214. - time.sleep(1)
  215. - if statusreport:
  216. - progress = 100 * float(p.queueindex) / len(p.mainqueue)
  217. - sys.stdout.write("Progress: %02.1f%%\r" % progress)
  218. - sys.stdout.flush()
  219. - p.disconnect()
  220. - sys.exit(0)
  221. - except:
  222. - p.disconnect()
  223. diff -urN Printrun-printrun-20140730.old/pronsole Printrun-printrun-20140730/pronsole
  224. --- Printrun-printrun-20140730.old/pronsole 1970-01-01 01:00:00.000000000 +0100
  225. +++ Printrun-printrun-20140730/pronsole 2014-06-06 12:04:34.000000000 +0200
  226. @@ -0,0 +1,33 @@
  227. +#!/usr/bin/env python
  228. +
  229. +# This file is part of the Printrun suite.
  230. +#
  231. +# Printrun is free software: you can redistribute it and/or modify
  232. +# it under the terms of the GNU General Public License as published by
  233. +# the Free Software Foundation, either version 3 of the License, or
  234. +# (at your option) any later version.
  235. +#
  236. +# Printrun is distributed in the hope that it will be useful,
  237. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  238. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  239. +# GNU General Public License for more details.
  240. +#
  241. +# You should have received a copy of the GNU General Public License
  242. +# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  243. +
  244. +import sys
  245. +import traceback
  246. +from printrun.pronsole import pronsole
  247. +
  248. +if __name__ == "__main__":
  249. +
  250. + interp = pronsole()
  251. + interp.parse_cmdline(sys.argv[1:])
  252. + try:
  253. + interp.cmdloop()
  254. + except SystemExit:
  255. + interp.p.disconnect()
  256. + except:
  257. + print _("Caught an exception, exiting:")
  258. + traceback.print_exc()
  259. + interp.p.disconnect()
  260. diff -urN Printrun-printrun-20140730.old/pronsole.py Printrun-printrun-20140730/pronsole.py
  261. --- Printrun-printrun-20140730.old/pronsole.py 2014-08-10 15:44:04.863087038 +0200
  262. +++ Printrun-printrun-20140730/pronsole.py 1970-01-01 01:00:00.000000000 +0100
  263. @@ -1,33 +0,0 @@
  264. -#!/usr/bin/env python
  265. -
  266. -# This file is part of the Printrun suite.
  267. -#
  268. -# Printrun is free software: you can redistribute it and/or modify
  269. -# it under the terms of the GNU General Public License as published by
  270. -# the Free Software Foundation, either version 3 of the License, or
  271. -# (at your option) any later version.
  272. -#
  273. -# Printrun is distributed in the hope that it will be useful,
  274. -# but WITHOUT ANY WARRANTY; without even the implied warranty of
  275. -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  276. -# GNU General Public License for more details.
  277. -#
  278. -# You should have received a copy of the GNU General Public License
  279. -# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  280. -
  281. -import sys
  282. -import traceback
  283. -from printrun.pronsole import pronsole
  284. -
  285. -if __name__ == "__main__":
  286. -
  287. - interp = pronsole()
  288. - interp.parse_cmdline(sys.argv[1:])
  289. - try:
  290. - interp.cmdloop()
  291. - except SystemExit:
  292. - interp.p.disconnect()
  293. - except:
  294. - print _("Caught an exception, exiting:")
  295. - traceback.print_exc()
  296. - interp.p.disconnect()
  297. diff -urN Printrun-printrun-20140730.old/pronterface Printrun-printrun-20140730/pronterface
  298. --- Printrun-printrun-20140730.old/pronterface 1970-01-01 01:00:00.000000000 +0100
  299. +++ Printrun-printrun-20140730/pronterface 2014-06-06 12:04:34.000000000 +0200
  300. @@ -0,0 +1,40 @@
  301. +#!/usr/bin/env python
  302. +
  303. +# This file is part of the Printrun suite.
  304. +#
  305. +# Printrun is free software: you can redistribute it and/or modify
  306. +# it under the terms of the GNU General Public License as published by
  307. +# the Free Software Foundation, either version 3 of the License, or
  308. +# (at your option) any later version.
  309. +#
  310. +# Printrun is distributed in the hope that it will be useful,
  311. +# but WITHOUT ANY WARRANTY; without even the implied warranty of
  312. +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  313. +# GNU General Public License for more details.
  314. +#
  315. +# You should have received a copy of the GNU General Public License
  316. +# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  317. +
  318. +import sys
  319. +
  320. +try:
  321. + import wx # NOQA
  322. +except:
  323. + print("wxPython is not installed. This program requires wxPython to run.")
  324. + if sys.version_info.major >= 3:
  325. + print("""\
  326. +As you are currently running python3, this is most likely because wxPython is
  327. +not yet available for python3. You should try running with python2 instead.""")
  328. + sys.exit(-1)
  329. + else:
  330. + raise
  331. +
  332. +from printrun.pronterface import PronterApp
  333. +
  334. +if __name__ == '__main__':
  335. + app = PronterApp(False)
  336. + try:
  337. + app.MainLoop()
  338. + except KeyboardInterrupt:
  339. + pass
  340. + del app
  341. diff -urN Printrun-printrun-20140730.old/pronterface.py Printrun-printrun-20140730/pronterface.py
  342. --- Printrun-printrun-20140730.old/pronterface.py 2014-08-10 15:44:04.862087044 +0200
  343. +++ Printrun-printrun-20140730/pronterface.py 1970-01-01 01:00:00.000000000 +0100
  344. @@ -1,40 +0,0 @@
  345. -#!/usr/bin/env python
  346. -
  347. -# This file is part of the Printrun suite.
  348. -#
  349. -# Printrun is free software: you can redistribute it and/or modify
  350. -# it under the terms of the GNU General Public License as published by
  351. -# the Free Software Foundation, either version 3 of the License, or
  352. -# (at your option) any later version.
  353. -#
  354. -# Printrun is distributed in the hope that it will be useful,
  355. -# but WITHOUT ANY WARRANTY; without even the implied warranty of
  356. -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  357. -# GNU General Public License for more details.
  358. -#
  359. -# You should have received a copy of the GNU General Public License
  360. -# along with Printrun. If not, see <http://www.gnu.org/licenses/>.
  361. -
  362. -import sys
  363. -
  364. -try:
  365. - import wx # NOQA
  366. -except:
  367. - print("wxPython is not installed. This program requires wxPython to run.")
  368. - if sys.version_info.major >= 3:
  369. - print("""\
  370. -As you are currently running python3, this is most likely because wxPython is
  371. -not yet available for python3. You should try running with python2 instead.""")
  372. - sys.exit(-1)
  373. - else:
  374. - raise
  375. -
  376. -from printrun.pronterface import PronterApp
  377. -
  378. -if __name__ == '__main__':
  379. - app = PronterApp(False)
  380. - try:
  381. - app.MainLoop()
  382. - except KeyboardInterrupt:
  383. - pass
  384. - del app
  385. diff -urN Printrun-printrun-20140730.old/setup.py Printrun-printrun-20140730/setup.py
  386. --- Printrun-printrun-20140730.old/setup.py 2014-08-10 15:44:04.869087003 +0200
  387. +++ Printrun-printrun-20140730/setup.py 2014-08-10 15:44:59.470765212 +0200
  388. @@ -162,7 +162,7 @@
  389. license = "GPLv3",
  390. data_files = data_files,
  391. packages = ["printrun", "printrun.gl", "printrun.gl.libtatlin", "printrun.gui", "printrun.power"],
  392. - scripts = ["pronsole.py", "pronterface.py", "plater.py", "printcore.py"],
  393. + scripts = ["pronsole", "pronterface", "plater", "printcore"],
  394. cmdclass = cmdclass,
  395. ext_modules = extensions,
  396. )