Beispiel #1
0
def addnew():
    global nBox, sBox, win, optionstring
    #create a new instance of pirate class
    p = piratedata.Pirate()
    #get values out of boxes
    #load into pirate
    p.name = nBox.get()
    p.ship = sBox.get()
    p.fictional = optionstring.get()
    #now upload the image and get  signed url back
    im = imagemanager.ImageManager()
    im.imagepath = win.filename
    im.uploadImage()
    p.image = im.url
    #clear boxes
    nBox.delete(0, "end")
    sBox.delete(0, "end")
    imgLabel.config(text="")
    #generate dict
    d = p.getdict()
    #create new instance of file manager class
    f = firebasemanager.FirebaseManager()
    #generate random id
    r = random.randint(10000, 99999)
    #use file manager to save the pirate dict into our pirate database
    f.writenewobject(r, d)
    win.destroy()
def display(pirateId):
    Piratelabel.config(text=dlist[pirateId]["name"])
    ShipLabel.config(text=dlist[pirateId]["ship"])
    if dlist[pirateId]["fictional"] == "True":
        FicLabel.config(text="Fictional")
    else:
        FicLabel.config(text="Real")
    im = imagemanager.ImageManager()
    try:
        im.url = dlist[pirateId]["image"]
    except:
        pass
    if im.url != "":
        img = im.downloadurl()
        Pirateimg.config(image=img)
        Pirateimg.image = img
    else:
        Pirateimg.config(image=sponge)
Beispiel #3
0
def display(pirate_id):
    name.config(text=d[pirate_id]["name"])
    ship.config(text=d[pirate_id]["ship"])
    if d[pirate_id]["fictional"] == "true":
        fict.config(text="Fictional")
    else:
        fict.config(text="Not Fictional")
    im = imagemanager.ImageManager()
    try:
        im.url = d[pirate_id]["image"]
    except:
        pass

    #if we got a image, display it
    if im.url != "":
        img = im.downloadImage()
        pic.config(image=img)
        pic.image = img
    else:

        pic.config(image=placeholder)
def addnew():

    global win, namentry, shipentry, optionString, lbimage
    p = Pirate()
    p.name = namentry.get()
    p.ship = shipentry.get()
    p.fictional = optionString.get()

    im = imagemanager.ImageManager()
    im.imagepath = win.filename
    im.uploadImage()
    p.image = im.url

    namentry.delete(0, "end")
    shipentry.delete(0, "end")
    lbimage.config(text="")

    d = p.getdict()
    fm = FirebaseManager()
    fm.writetofile(random.randint(10000, 99999), d)

    win.destroy()
Beispiel #5
0
import configmanager
import dynamicclassmanager
import mapgen.enveffectmanager
import eventmanager
import mapgen.featuremanager
import fontmanager
import mapgen.furnituremanager
import gameobjectmanager
import imagemanager
import mapgen.editor
import mapgen.scenerymanager
import soundmanager

# Load this ahead of time because other modules need it ready so they can
# load their configuration.
dynamicClassManager = dynamicclassmanager.DynamicClassManager()

animationManager = animationmanager.AnimationManager()
configManager = configmanager.ConfigManager()
envEffectManager = mapgen.enveffectmanager.EnvEffectManager()
eventManager = eventmanager.EventManager()
featureManager = mapgen.featuremanager.FeatureManager()
fontManager = fontmanager.FontManager()
furnitureManager = mapgen.furnituremanager.FurnitureManager()
gameObjectManager = gameobjectmanager.GameObjectManager()
imageManager = imagemanager.ImageManager()
mapEditor = mapgen.editor.MapEditor()
sceneryManager = mapgen.scenerymanager.SceneryManager()
soundManager = soundmanager.SoundManager()