Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
Using Python's built-in defaultdict we can easily define a tree data structure:
def tree(): return defaultdict(tree)That's it!
| from __future__ import division # allows floating point division from integers | |
| from FreeCAD import Base | |
| import Part | |
| import math | |
| # Run this macro to create a generic project enclosure box | |
| # You can change all the parameters by selecting the object in the tree view and tweaking values in the "Data" tab | |
| # Possible additions/improvements | |
| # counterbore bridging .4mm |
| package forma; | |
| import forma.WholeFileInputFormat; | |
| import cascading.scheme.Scheme; | |
| import cascading.tap.Tap; | |
| import cascading.tuple.Fields; | |
| import cascading.tuple.Tuple; | |
| import cascading.tuple.TupleEntry; | |
| import java.io.IOException; | |
| import org.apache.hadoop.mapred.JobConf; |
| # from: http://kfahlgren.com/blog/2006/11/01/multipart-post-in-ruby-2/ | |
| # edited by makevoid, http://makevoid.com | |
| URL = "http://localhost:3000/your_url" | |
| TIMEOUT_SECONDS = 10 | |
| params = {} | |
| file = File.open(filename, "rb") | |
| params["file[replay]"] = file |