Пример #1
0
def addpoem( db, title, author, text, user ):

    if not is_valid_user( db, user ):
        raise InvalidRequest( "You must be logged in to add a poem.", 401 )

    id = make_id( db, title )
    db.poems[id] = {
        "title"       : title,
        "author"      : author,
        "text"        : text,
        "contributor" : user
    }
    return id
Пример #2
0
def addpoem(db, title, author, text, user):

    if not is_valid_user(db, user):
        raise InvalidRequest("You must be logged in to add a poem.", 401)

    id = make_id(db, title)
    db.poems[id] = {
        "title": title,
        "author": author,
        "text": text,
        "contributor": user
    }
    return id
Пример #3
0
from django.conf import settings
import drawMaze
import make_id
import make_pieces
import joinDXF
import drawMazeSVG
import buildInstructions
#import Box
from mazepuzzlebox.createbox.models import Box
id = 37
thickness=3.76
try:
    box = Box.objects.get(pk=id)
except:
    print "first instantiate failed... why?"
    box = Box.objects.get(pk=id)
drawMazeSVG.drawMaze( box.maze, box )
drawMaze.drawMaze( box.maze,box )
make_pieces.make_pieces(thickness)
make_id.make_id(box.id)
joinDXF.joinDXF(box.id)
buildInstructions.buildInstructions(box.id)
Пример #4
0
import make_id
import make_pieces
import ezjoinDXF
#import Box
from mazepuzzlebox.createbox.models import Box
id = 40
thickness = 3.72
try:
    box = Box.objects.get(pk=id)
except:
    print "first instantiate failed... why?"
    box = Box.objects.get(pk=id)

#the (not so?) awful DXFs - switched to ezdxf
drawMaze.drawMaze(box.maze, box)
make_pieces.make_pieces(thickness)
make_id.make_id(box.id)
ezjoinDXF.joinDXF(box.id)

#the instructions as an SVG
"""
drawInstructionsMaze.drawMaze( box.maze, box )
buildInstructions.buildInstructions(box.id)

#SVG version, hopefully better!
make_piecesSVG.make_pieces(thickness)
make_mazeSVG.make_maze(box.maze,box)
make_idSVG.make_id(box.id)
buildInstructions.buildBox(box.id)
"""