add python setuptools support

- add setup.py script,
 - switch to use images via "share:" resource name
   (this allows to work both versions of application:
     - system wide installation,
     - directly from source),
 - add .desktop file,
 - rename FlatCAM.py to flatcam and install it as an
   executable script.
This commit is contained in:
Damian Wrobel 2017-06-01 13:44:49 +02:00
parent 58f66ca866
commit cbad99e340
10 changed files with 190 additions and 95 deletions

View File

@ -1115,7 +1115,7 @@ class App(QtCore.QObject):
layout1.addLayout(layout2)
logo = QtGui.QLabel()
logo.setPixmap(QtGui.QPixmap('share/flatcam_icon256.png'))
logo.setPixmap(QtGui.QPixmap('share:flatcam_icon256.png'))
layout2.addWidget(logo, stretch=0)
title = QtGui.QLabel(
@ -4131,11 +4131,11 @@ class App(QtCore.QObject):
# TODO: Move this to constructor
icons = {
"gerber": "share/flatcam_icon16.png",
"excellon": "share/drill16.png",
"cncjob": "share/cnc16.png",
"project": "share/project16.png",
"svg": "share/geometry16.png"
"gerber": "share:flatcam_icon16.png",
"excellon": "share:drill16.png",
"cncjob": "share:cnc16.png",
"project": "share:project16.png",
"svg": "share:geometry16.png"
}
openers = {

View File

@ -693,23 +693,23 @@ class FlatCAMDraw(QtCore.QObject):
self.drawing_toolbar = QtGui.QToolBar()
self.drawing_toolbar.setDisabled(disabled)
self.app.ui.addToolBar(self.drawing_toolbar)
self.select_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/pointer32.png'), "Select 'Esc'")
self.add_circle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/circle32.png'), 'Add Circle')
self.add_arc_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/arc32.png'), 'Add Arc')
self.add_rectangle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/rectangle32.png'), 'Add Rectangle')
self.add_polygon_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/polygon32.png'), 'Add Polygon')
self.add_path_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/path32.png'), 'Add Path')
self.union_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/union32.png'), 'Polygon Union')
self.intersection_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/intersection32.png'), 'Polygon Intersection')
self.subtract_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/subtract32.png'), 'Polygon Subtraction')
self.cutpath_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/cutpath32.png'), 'Cut Path')
self.move_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/move32.png'), "Move Objects 'm'")
self.copy_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/copy32.png'), "Copy Objects 'c'")
self.delete_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share/deleteshape32.png'), "Delete Shape '-'")
self.select_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:pointer32.png'), "Select 'Esc'")
self.add_circle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:circle32.png'), 'Add Circle')
self.add_arc_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:arc32.png'), 'Add Arc')
self.add_rectangle_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:rectangle32.png'), 'Add Rectangle')
self.add_polygon_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:polygon32.png'), 'Add Polygon')
self.add_path_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:path32.png'), 'Add Path')
self.union_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:union32.png'), 'Polygon Union')
self.intersection_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:intersection32.png'), 'Polygon Intersection')
self.subtract_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:subtract32.png'), 'Polygon Subtraction')
self.cutpath_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:cutpath32.png'), 'Cut Path')
self.move_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:move32.png'), "Move Objects 'm'")
self.copy_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:copy32.png'), "Copy Objects 'c'")
self.delete_btn = self.drawing_toolbar.addAction(QtGui.QIcon('share:deleteshape32.png'), "Delete Shape '-'")
### Snap Toolbar ###
self.snap_toolbar = QtGui.QToolBar()
self.grid_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share/grid32.png'), 'Snap to grid')
self.grid_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share:grid32.png'), 'Snap to grid')
self.grid_gap_x_entry = QtGui.QLineEdit()
self.grid_gap_x_entry.setMaximumWidth(70)
self.grid_gap_x_entry.setToolTip("Grid X distance")
@ -719,7 +719,7 @@ class FlatCAMDraw(QtCore.QObject):
self.grid_gap_y_entry.setToolTip("Grid Y distante")
self.snap_toolbar.addWidget(self.grid_gap_y_entry)
self.corner_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share/corner32.png'), 'Snap to corner')
self.corner_snap_btn = self.snap_toolbar.addAction(QtGui.QIcon('share:corner32.png'), 'Snap to corner')
self.snap_max_dist_entry = QtGui.QLineEdit()
self.snap_max_dist_entry.setMaximumWidth(70)
self.snap_max_dist_entry.setToolTip("Max. magnet distance")
@ -731,21 +731,21 @@ class FlatCAMDraw(QtCore.QObject):
### Application menu ###
self.menu = QtGui.QMenu("Drawing")
self.app.ui.menu.insertMenu(self.app.ui.menutoolaction, self.menu)
# self.select_menuitem = self.menu.addAction(QtGui.QIcon('share/pointer16.png'), "Select 'Esc'")
# self.add_circle_menuitem = self.menu.addAction(QtGui.QIcon('share/circle16.png'), 'Add Circle')
# self.add_arc_menuitem = self.menu.addAction(QtGui.QIcon('share/arc16.png'), 'Add Arc')
# self.add_rectangle_menuitem = self.menu.addAction(QtGui.QIcon('share/rectangle16.png'), 'Add Rectangle')
# self.add_polygon_menuitem = self.menu.addAction(QtGui.QIcon('share/polygon16.png'), 'Add Polygon')
# self.add_path_menuitem = self.menu.addAction(QtGui.QIcon('share/path16.png'), 'Add Path')
self.union_menuitem = self.menu.addAction(QtGui.QIcon('share/union16.png'), 'Polygon Union')
self.intersection_menuitem = self.menu.addAction(QtGui.QIcon('share/intersection16.png'), 'Polygon Intersection')
# self.subtract_menuitem = self.menu.addAction(QtGui.QIcon('share/subtract16.png'), 'Polygon Subtraction')
self.cutpath_menuitem = self.menu.addAction(QtGui.QIcon('share/cutpath16.png'), 'Cut Path')
# self.move_menuitem = self.menu.addAction(QtGui.QIcon('share/move16.png'), "Move Objects 'm'")
# self.copy_menuitem = self.menu.addAction(QtGui.QIcon('share/copy16.png'), "Copy Objects 'c'")
self.delete_menuitem = self.menu.addAction(QtGui.QIcon('share/deleteshape16.png'), "Delete Shape '-'")
self.buffer_menuitem = self.menu.addAction(QtGui.QIcon('share/buffer16.png'), "Buffer selection 'b'")
self.paint_menuitem = self.menu.addAction(QtGui.QIcon('share/paint16.png'), "Paint selection")
# self.select_menuitem = self.menu.addAction(QtGui.QIcon('share:pointer16.png'), "Select 'Esc'")
# self.add_circle_menuitem = self.menu.addAction(QtGui.QIcon('share:circle16.png'), 'Add Circle')
# self.add_arc_menuitem = self.menu.addAction(QtGui.QIcon('share:arc16.png'), 'Add Arc')
# self.add_rectangle_menuitem = self.menu.addAction(QtGui.QIcon('share:rectangle16.png'), 'Add Rectangle')
# self.add_polygon_menuitem = self.menu.addAction(QtGui.QIcon('share:polygon16.png'), 'Add Polygon')
# self.add_path_menuitem = self.menu.addAction(QtGui.QIcon('share:path16.png'), 'Add Path')
self.union_menuitem = self.menu.addAction(QtGui.QIcon('share:union16.png'), 'Polygon Union')
self.intersection_menuitem = self.menu.addAction(QtGui.QIcon('share:intersection16.png'), 'Polygon Intersection')
# self.subtract_menuitem = self.menu.addAction(QtGui.QIcon('share:subtract16.png'), 'Polygon Subtraction')
self.cutpath_menuitem = self.menu.addAction(QtGui.QIcon('share:cutpath16.png'), 'Cut Path')
# self.move_menuitem = self.menu.addAction(QtGui.QIcon('share:move16.png'), "Move Objects 'm'")
# self.copy_menuitem = self.menu.addAction(QtGui.QIcon('share:copy16.png'), "Copy Objects 'c'")
self.delete_menuitem = self.menu.addAction(QtGui.QIcon('share:deleteshape16.png'), "Delete Shape '-'")
self.buffer_menuitem = self.menu.addAction(QtGui.QIcon('share:buffer16.png'), "Buffer selection 'b'")
self.paint_menuitem = self.menu.addAction(QtGui.QIcon('share:paint16.png'), "Paint selection")
self.menu.addSeparator()
self.paint_menuitem.triggered.connect(self.on_paint_tool)

View File

@ -29,55 +29,55 @@ class FlatCAMGUI(QtGui.QMainWindow):
self.menufile = self.menu.addMenu('&File')
# New
self.menufilenew = QtGui.QAction(QtGui.QIcon('share/file16.png'), '&New', self)
self.menufilenew = QtGui.QAction(QtGui.QIcon('share:file16.png'), '&New', self)
self.menufile.addAction(self.menufilenew)
# Open recent
# Recent
self.recent = self.menufile.addMenu(QtGui.QIcon('share/folder16.png'), "Open recent ...")
self.recent = self.menufile.addMenu(QtGui.QIcon('share:folder16.png'), "Open recent ...")
# Open gerber ...
self.menufileopengerber = QtGui.QAction(QtGui.QIcon('share/folder16.png'), 'Open &Gerber ...', self)
self.menufileopengerber = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Open &Gerber ...', self)
self.menufile.addAction(self.menufileopengerber)
# Open Excellon ...
self.menufileopenexcellon = QtGui.QAction(QtGui.QIcon('share/folder16.png'), 'Open &Excellon ...', self)
self.menufileopenexcellon = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Open &Excellon ...', self)
self.menufile.addAction(self.menufileopenexcellon)
# Open G-Code ...
self.menufileopengcode = QtGui.QAction(QtGui.QIcon('share/folder16.png'), 'Open G-&Code ...', self)
self.menufileopengcode = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Open G-&Code ...', self)
self.menufile.addAction(self.menufileopengcode)
# Open Project ...
self.menufileopenproject = QtGui.QAction(QtGui.QIcon('share/folder16.png'), 'Open &Project ...', self)
self.menufileopenproject = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Open &Project ...', self)
self.menufile.addAction(self.menufileopenproject)
# Import SVG ...
self.menufileimportsvg = QtGui.QAction(QtGui.QIcon('share/folder16.png'), 'Import &SVG ...', self)
self.menufileimportsvg = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Import &SVG ...', self)
self.menufile.addAction(self.menufileimportsvg)
# Export SVG ...
self.menufileexportsvg = QtGui.QAction(QtGui.QIcon('share/folder16.png'), 'Export &SVG ...', self)
self.menufileexportsvg = QtGui.QAction(QtGui.QIcon('share:folder16.png'), 'Export &SVG ...', self)
self.menufile.addAction(self.menufileexportsvg)
# Save Project
self.menufilesaveproject = QtGui.QAction(QtGui.QIcon('share/floppy16.png'), '&Save Project', self)
self.menufilesaveproject = QtGui.QAction(QtGui.QIcon('share:floppy16.png'), '&Save Project', self)
self.menufile.addAction(self.menufilesaveproject)
# Save Project As ...
self.menufilesaveprojectas = QtGui.QAction(QtGui.QIcon('share/floppy16.png'), 'Save Project &As ...', self)
self.menufilesaveprojectas = QtGui.QAction(QtGui.QIcon('share:floppy16.png'), 'Save Project &As ...', self)
self.menufile.addAction(self.menufilesaveprojectas)
# Save Project Copy ...
self.menufilesaveprojectcopy = QtGui.QAction(QtGui.QIcon('share/floppy16.png'), 'Save Project C&opy ...', self)
self.menufilesaveprojectcopy = QtGui.QAction(QtGui.QIcon('share:floppy16.png'), 'Save Project C&opy ...', self)
self.menufile.addAction(self.menufilesaveprojectcopy)
# Save Defaults
self.menufilesavedefaults = QtGui.QAction(QtGui.QIcon('share/floppy16.png'), 'Save &Defaults', self)
self.menufilesavedefaults = QtGui.QAction(QtGui.QIcon('share:floppy16.png'), 'Save &Defaults', self)
self.menufile.addAction(self.menufilesavedefaults)
# Quit
self.exit_action = QtGui.QAction(QtGui.QIcon('share/power16.png'), '&Exit', self)
self.exit_action = QtGui.QAction(QtGui.QIcon('share:power16.png'), '&Exit', self)
# exitAction.setShortcut('Ctrl+Q')
# exitAction.setStatusTip('Exit application')
#self.exit_action.triggered.connect(QtGui.qApp.quit)
@ -86,13 +86,13 @@ class FlatCAMGUI(QtGui.QMainWindow):
### Edit ###
self.menuedit = self.menu.addMenu('&Edit')
self.menueditnew = self.menuedit.addAction(QtGui.QIcon('share/new_geo16.png'), 'New Geometry')
self.menueditedit = self.menuedit.addAction(QtGui.QIcon('share/edit16.png'), 'Edit Geometry')
self.menueditok = self.menuedit.addAction(QtGui.QIcon('share/edit_ok16.png'), 'Update Geometry')
self.menueditnew = self.menuedit.addAction(QtGui.QIcon('share:new_geo16.png'), 'New Geometry')
self.menueditedit = self.menuedit.addAction(QtGui.QIcon('share:edit16.png'), 'Edit Geometry')
self.menueditok = self.menuedit.addAction(QtGui.QIcon('share:edit_ok16.png'), 'Update Geometry')
#self.menueditok.
#self.menueditcancel = self.menuedit.addAction(QtGui.QIcon('share/cancel_edit16.png'), "Cancel Edit")
self.menueditjoin = self.menuedit.addAction(QtGui.QIcon('share/join16.png'), 'Join Geometry')
self.menueditdelete = self.menuedit.addAction(QtGui.QIcon('share/trash16.png'), 'Delete')
#self.menueditcancel = self.menuedit.addAction(QtGui.QIcon('share:cancel_edit16.png'), "Cancel Edit")
self.menueditjoin = self.menuedit.addAction(QtGui.QIcon('share:join16.png'), 'Join Geometry')
self.menueditdelete = self.menuedit.addAction(QtGui.QIcon('share:trash16.png'), 'Delete')
### Options ###
self.menuoptions = self.menu.addMenu('&Options')
@ -106,22 +106,22 @@ class FlatCAMGUI(QtGui.QMainWindow):
### View ###
self.menuview = self.menu.addMenu('&View')
self.menuviewdisableall = self.menuview.addAction(QtGui.QIcon('share/clear_plot16.png'), 'Disable all plots')
self.menuviewdisableother = self.menuview.addAction(QtGui.QIcon('share/clear_plot16.png'),
self.menuviewdisableall = self.menuview.addAction(QtGui.QIcon('share:clear_plot16.png'), 'Disable all plots')
self.menuviewdisableother = self.menuview.addAction(QtGui.QIcon('share:clear_plot16.png'),
'Disable all plots but this one')
self.menuviewenable = self.menuview.addAction(QtGui.QIcon('share/replot16.png'), 'Enable all plots')
self.menuviewenable = self.menuview.addAction(QtGui.QIcon('share:replot16.png'), 'Enable all plots')
### Tool ###
#self.menutool = self.menu.addMenu('&Tool')
self.menutool = QtGui.QMenu('&Tool')
self.menutoolaction = self.menu.addMenu(self.menutool)
self.menutoolshell = self.menutool.addAction(QtGui.QIcon('share/shell16.png'), '&Command Line')
self.menutoolshell = self.menutool.addAction(QtGui.QIcon('share:shell16.png'), '&Command Line')
### Help ###
self.menuhelp = self.menu.addMenu('&Help')
self.menuhelp_about = self.menuhelp.addAction(QtGui.QIcon('share/tv16.png'), 'About FlatCAM')
self.menuhelp_home = self.menuhelp.addAction(QtGui.QIcon('share/home16.png'), 'Home')
self.menuhelp_manual = self.menuhelp.addAction(QtGui.QIcon('share/globe16.png'), 'Manual')
self.menuhelp_about = self.menuhelp.addAction(QtGui.QIcon('share:tv16.png'), 'About FlatCAM')
self.menuhelp_home = self.menuhelp.addAction(QtGui.QIcon('share:home16.png'), 'Home')
self.menuhelp_manual = self.menuhelp.addAction(QtGui.QIcon('share:globe16.png'), 'Manual')
###############
### Toolbar ###
@ -129,18 +129,18 @@ class FlatCAMGUI(QtGui.QMainWindow):
self.toolbar = QtGui.QToolBar()
self.addToolBar(self.toolbar)
self.zoom_fit_btn = self.toolbar.addAction(QtGui.QIcon('share/zoom_fit32.png'), "&Zoom Fit")
self.zoom_out_btn = self.toolbar.addAction(QtGui.QIcon('share/zoom_out32.png'), "&Zoom Out")
self.zoom_in_btn = self.toolbar.addAction(QtGui.QIcon('share/zoom_in32.png'), "&Zoom In")
self.clear_plot_btn = self.toolbar.addAction(QtGui.QIcon('share/clear_plot32.png'), "&Clear Plot")
self.replot_btn = self.toolbar.addAction(QtGui.QIcon('share/replot32.png'), "&Replot")
self.newgeo_btn = self.toolbar.addAction(QtGui.QIcon('share/new_geo32.png'), "New Blank Geometry")
self.editgeo_btn = self.toolbar.addAction(QtGui.QIcon('share/edit32.png'), "Edit Geometry")
self.updategeo_btn = self.toolbar.addAction(QtGui.QIcon('share/edit_ok32.png'), "Update Geometry")
self.zoom_fit_btn = self.toolbar.addAction(QtGui.QIcon('share:zoom_fit32.png'), "&Zoom Fit")
self.zoom_out_btn = self.toolbar.addAction(QtGui.QIcon('share:zoom_out32.png'), "&Zoom Out")
self.zoom_in_btn = self.toolbar.addAction(QtGui.QIcon('share:zoom_in32.png'), "&Zoom In")
self.clear_plot_btn = self.toolbar.addAction(QtGui.QIcon('share:clear_plot32.png'), "&Clear Plot")
self.replot_btn = self.toolbar.addAction(QtGui.QIcon('share:replot32.png'), "&Replot")
self.newgeo_btn = self.toolbar.addAction(QtGui.QIcon('share:new_geo32.png'), "New Blank Geometry")
self.editgeo_btn = self.toolbar.addAction(QtGui.QIcon('share:edit32.png'), "Edit Geometry")
self.updategeo_btn = self.toolbar.addAction(QtGui.QIcon('share:edit_ok32.png'), "Update Geometry")
self.updategeo_btn.setEnabled(False)
#self.canceledit_btn = self.toolbar.addAction(QtGui.QIcon('share/cancel_edit32.png'), "Cancel Edit")
self.delete_btn = self.toolbar.addAction(QtGui.QIcon('share/delete32.png'), "&Delete")
self.shell_btn = self.toolbar.addAction(QtGui.QIcon('share/shell32.png'), "&Command Line")
#self.canceledit_btn = self.toolbar.addAction(QtGui.QIcon('share:cancel_edit32.png'), "Cancel Edit")
self.delete_btn = self.toolbar.addAction(QtGui.QIcon('share:delete32.png'), "&Delete")
self.shell_btn = self.toolbar.addAction(QtGui.QIcon('share:shell32.png'), "&Command Line")
################
### Splitter ###
@ -179,7 +179,7 @@ class FlatCAMGUI(QtGui.QMainWindow):
self.options_tab_layout.addLayout(hlay1)
self.icon = QtGui.QLabel()
self.icon.setPixmap(QtGui.QPixmap('share/gear48.png'))
self.icon.setPixmap(QtGui.QPixmap('share:gear48.png'))
hlay1.addWidget(self.icon)
self.options_combo = QtGui.QComboBox()
@ -247,12 +247,12 @@ class FlatCAMGUI(QtGui.QMainWindow):
### Icons ###
#############
self.app_icon = QtGui.QIcon()
self.app_icon.addFile('share/flatcam_icon16.png', QtCore.QSize(16, 16))
self.app_icon.addFile('share/flatcam_icon24.png', QtCore.QSize(24, 24))
self.app_icon.addFile('share/flatcam_icon32.png', QtCore.QSize(32, 32))
self.app_icon.addFile('share/flatcam_icon48.png', QtCore.QSize(48, 48))
self.app_icon.addFile('share/flatcam_icon128.png', QtCore.QSize(128, 128))
self.app_icon.addFile('share/flatcam_icon256.png', QtCore.QSize(256, 256))
self.app_icon.addFile('share:flatcam_icon16.png', QtCore.QSize(16, 16))
self.app_icon.addFile('share:flatcam_icon24.png', QtCore.QSize(24, 24))
self.app_icon.addFile('share:flatcam_icon32.png', QtCore.QSize(32, 32))
self.app_icon.addFile('share:flatcam_icon48.png', QtCore.QSize(48, 48))
self.app_icon.addFile('share:flatcam_icon128.png', QtCore.QSize(128, 128))
self.app_icon.addFile('share:flatcam_icon256.png', QtCore.QSize(256, 256))
self.setWindowIcon(self.app_icon)
self.setGeometry(100, 100, 1024, 650)
@ -277,7 +277,7 @@ class FlatCAMActivityView(QtGui.QWidget):
self.icon = QtGui.QLabel(self)
self.icon.setGeometry(0, 0, 12, 12)
self.movie = QtGui.QMovie("share/active.gif")
self.movie = QtGui.QMovie("share:active.gif")
self.icon.setMovie(self.movie)
#self.movie.start()
@ -308,7 +308,7 @@ class FlatCAMInfoBar(QtGui.QWidget):
self.icon = QtGui.QLabel(self)
self.icon.setGeometry(0, 0, 12, 12)
self.pmap = QtGui.QPixmap('share/graylight12.png')
self.pmap = QtGui.QPixmap('share:graylight12.png')
self.icon.setPixmap(self.pmap)
layout = QtGui.QHBoxLayout()
@ -333,13 +333,13 @@ class FlatCAMInfoBar(QtGui.QWidget):
level = str(level)
self.pmap.fill()
if level == "error":
self.pmap = QtGui.QPixmap('share/redlight12.png')
self.pmap = QtGui.QPixmap('share:redlight12.png')
elif level == "success":
self.pmap = QtGui.QPixmap('share/greenlight12.png')
self.pmap = QtGui.QPixmap('share:greenlight12.png')
elif level == "warning":
self.pmap = QtGui.QPixmap('share/yellowlight12.png')
self.pmap = QtGui.QPixmap('share:yellowlight12.png')
else:
self.pmap = QtGui.QPixmap('share/graylight12.png')
self.pmap = QtGui.QPixmap('share:graylight12.png')
self.icon.setPixmap(self.pmap)
self.set_text_(text)

9
MANIFEST.in Normal file
View File

@ -0,0 +1,9 @@
recursive-include share *.png
recursive-include share *.svg
include flatcam.desktop
include LICENSE
include README.md
include *.py
include MANIFEST.in

View File

@ -38,10 +38,10 @@ class ObjectCollection(QtCore.QAbstractListModel):
}
icon_files = {
"gerber": "share/flatcam_icon16.png",
"excellon": "share/drill16.png",
"cncjob": "share/cnc16.png",
"geometry": "share/geometry16.png"
"gerber": "share:flatcam_icon16.png",
"excellon": "share:drill16.png",
"cncjob": "share:cnc16.png",
"geometry": "share:geometry16.png"
}
def __init__(self, parent=None):

View File

@ -11,7 +11,7 @@ class ObjectUI(QtGui.QWidget):
put UI elements in ObjectUI.custom_box (QtGui.QLayout).
"""
def __init__(self, icon_file='share/flatcam_icon32.png', title='FlatCAM Object', parent=None):
def __init__(self, icon_file='share:flatcam_icon32.png', title='FlatCAM Object', parent=None):
QtGui.QWidget.__init__(self, parent=parent)
layout = QtGui.QVBoxLayout()
@ -117,7 +117,7 @@ class CNCObjectUI(ObjectUI):
be placed in ``self.custom_box`` to preserve the layout.
"""
ObjectUI.__init__(self, title='CNC Job Object', icon_file='share/cnc32.png', parent=parent)
ObjectUI.__init__(self, title='CNC Job Object', icon_file='share:cnc32.png', parent=parent)
# Scale and offset are not available for CNCJob objects.
# Hiding from the GUI.
@ -231,7 +231,7 @@ class GeometryObjectUI(ObjectUI):
"""
def __init__(self, parent=None):
super(GeometryObjectUI, self).__init__(title='Geometry Object', icon_file='share/geometry32.png', parent=parent)
super(GeometryObjectUI, self).__init__(title='Geometry Object', icon_file='share:geometry32.png', parent=parent)
## Plot options
self.plot_options_label = QtGui.QLabel("<b>Plot Options:</b>")
@ -450,7 +450,7 @@ class ExcellonObjectUI(ObjectUI):
def __init__(self, parent=None):
ObjectUI.__init__(self, title='Excellon Object',
icon_file='share/drill32.png',
icon_file='share:drill32.png',
parent=parent)
#### Plot options ####

3
FlatCAM.py → flatcam Normal file → Executable file
View File

@ -1,3 +1,4 @@
#!/usr/bin/env python2
############################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
@ -8,6 +9,7 @@
import sys
from PyQt4 import QtGui
from PyQt4 import QtCore
from FlatCAMApp import App
@ -28,5 +30,6 @@ debug_trace()
# NOTE: Never talk to the GUI from threads! This is why I commented the above.
app = QtGui.QApplication(sys.argv)
QtCore.QDir.setSearchPaths("share", QtCore.QStringList(("share", "share/flatcam", "/usr/share/flatcam")));
fc = App()
sys.exit(app.exec_())

8
flatcam.desktop Normal file
View File

@ -0,0 +1,8 @@
[Desktop Entry]
Name=FlatCAM
Comment=2D Computer-Aided PCB Manufacturing
Exec=flatcam
Icon=flatcam
Keywords=cam;pcb;gerber
Terminal=false
Type=Application

View File

@ -43,7 +43,7 @@ if sys.platform == "win32":
buildOptions = dict(
compressed=False,
include_files=include_files,
icon='share/flatcam_icon48.ico',
icon='share:flatcam_icon48.ico',
# excludes=['PyQt4', 'tk', 'tcl']
excludes=['scipy.lib.lapack.flapack.pyd',
'scipy.lib.blas.fblas.pyd',

75
setup.py Normal file
View File

@ -0,0 +1,75 @@
############################################################
# FlatCAM: 2D Post-processing for Manufacturing #
# http://flatcam.org #
# Author: Damian Wrobel <dwrobel@ertelnet.rybnik.pl> #
# Date: 05/23/2017 #
# MIT Licence #
# A setuptools based setup module #
############################################################
from setuptools import setup
import glob
setup(
name='FlatCAM',
version='8.5',
description='2D Computer-Aided PCB Manufacturing',
long_description=('FlatCAM is a program for preparing CNC jobs for making'
'PCBs on a CNC router. Among other things, it can take'
'a Gerber file generated by your favorite PCB CAD'
'program, and create G-Code for Isolation routing.'),
url='http://flatcam.org/',
author='Juan Pablo Caram',
license='MIT',
packages=[
'descartes',
'tclCommands'
],
py_modules=[
"camlib",
"DblSidedTool",
"FlatCAMApp",
"FlatCAMCommon",
"FlatCAMDraw",
"FlatCAMGUI",
"FlatCAMObj",
"FlatCAMProcess",
"FlatCAMShell",
"FlatCAMTool",
"FlatCAMVersion",
"FlatCAMWorker",
"GUIElements",
"MeasurementTool",
"ObjectCollection",
"ObjectUI",
"PlotCanvas",
"svgparse",
"termwidget"
],
install_requires=[
'simplejson',
'numpy>=1.8',
'scipy',
'matplotlib>=1.3.1',
'shapely>=1.3'
'rtree',
'svg.path'
],
include_package_data=True,
data_files=[
('share/flatcam', glob.glob('share/*'))
],
scripts=['flatcam']
)