Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- snippet #!
- #!/usr/bin/env python
- snippet imp
- import ${1:module}
- # Module Docstring
- snippet docs
- '''
- File: ${1:`Filename('$1.py', 'foo.py')`}
- Author: ${2:`g:snips_author`}
- Description: ${3}
- '''
- snippet wh
- while ${1:condition}:
- ${2:# code...}
- snippet for
- for ${1:needle} in ${2:haystack}:
- ${3:# code...}
- # New Class
- snippet cl
- class ${1:ClassName}(${2:object}):
- """${3:docstring for $1}"""
- def __init__(self, ${4:arg}):
- ${5:super($1, self).__init__()}
- self.$4 = $4
- ${6}
- # New Function
- snippet def
- def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
- """${3:docstring for $1}"""
- ${4:pass}
- snippet deff
- def ${1:fname}(${2:`indent('.') ? 'self' : ''`}):
- ${3}
- # New Method
- snippet defs
- def ${1:mname}(self, ${2:arg}):
- ${3:pass}
- # New Property
- snippet property
- def ${1:foo}():
- doc = "${2:The $1 property.}"
- def fget(self):
- ${3:return self._$1}
- def fset(self, value):
- ${4:self._$1 = value}
- # Lambda
- snippet ld
- ${1:var} = lambda ${2:vars} : ${3:action}
- snippet .
- self.
- snippet try Try/Except
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
- snippet try Try/Except/Else
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
- else:
- ${5:pass}
- snippet try Try/Except/Finally
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
- finally:
- ${5:pass}
- snippet try Try/Except/Else/Finally
- try:
- ${1:pass}
- except ${2:Exception}, ${3:e}:
- ${4:raise $3}
- else:
- ${5:pass}
- finally:
- ${6:pass}
- # if __name__ == '__main__':
- snippet ifmain
- if __name__ == '__main__':
- ${1:main()}
- # __magic__
- snippet _
- __${1:init}__${2}
- # FreeCAD convienence snippets
- # FreeCAD
- #sys path to catch FreeCAD libs
- snippet isys
- import sys
- sys.path.append("usr/local/lib")
- snippet ifc
- import FreeCAD
- snippet fc
- FreeCAD
- # FreeCADGui
- snippet ifgui
- import FreeCADGui as Gui
- # selection
- snippet sl
- = Gui.Selection.getSelection()
- # selectionex
- snippet slx
- = Gui.Selection.getSelectionEx()
- # Part
- snippet ip
- import Part
- snippet sh
- Shape
- snippet cu
- Curve
- snippet ed
- Edge
- snippet wi
- Wire
- # Base
- snippet fb
- from FreeCAD import Base
- # Mod
- snippet mod
- sys.path.append("/usr/local/Mod/")
- # Draft
- snippet idf
- import Draft
- snippet df
- Draft
- # DraftVecUtils
- snippet idv
- import DraftVecUtils
- snippet dv
- DraftVecUtils
- # DraftGeomUtils
- snippet idg
- import DraftGeomUtils
- snippet dg
- DraftGeomUtils
- #parametric properties
- snippet obj.
- obj.addProperty("App::Property${1}","${2}","${3}","${4}")
- ${5}
- # Drawing Workbench
- snippet idw
- import Drawing
- snippet dw
- Drawing
- # Base.Vector
- snippet bv
- Base.Vector(${1},${2},${3})
- ${4}
- snippet =bv
- =Base.Vector(${1},${2},${3})
- ${4}
- # BoundBox
- snippet bb
- BoundBox
- snippet bbxM
- BoundBox.XMax
- snippet bbxm
- BoundBox.XMin
- snippet bbyM
- BoundBox.YMax
- snippet bbym
- BoundBox.YMin
- snippet bbzM
- BoundBox.ZMax
- snippet bbzm
- BoundBox.ZMin
- # LGPLv2 license
- snippet lic
- #***************************************************************************
- #* *
- #* Copyright (c) 2013 Daniel Falck <ddfalck@gmail.com> *
- #* *
- #* This program is free software; you can redistribute it and/or modify *
- #* it under the terms of the GNU Lesser General Public License (LGPL) *
- #* as published by the Free Software Foundation; either version 2 of *
- #* the License, or (at your option) any later version. *
- #* for detail see the LICENCE text file. *
- #* *
- #* This program is distributed in the hope that it will be useful, *
- #* but WITHOUT ANY WARRANTY; without even the implied warranty of *
- #* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- #* GNU Library General Public License for more details. *
- #* *
- #* You should have received a copy of the GNU Library General Public *
- #* License along with this program; if not, write to the Free Software *
- #* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 *
- #* USA *
- #* *
- #***************************************************************************
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement