import kivy
kivy.require('1.8.0')

import waterCosts
from database_functions import plantdb

from math import pi
from kivy.app import App
from kivy.uix.screenmanager import ScreenManager, Screen
from kivy.uix.gridlayout import GridLayout
from kivy.uix.floatlayout import FloatLayout
from kivy.uix.widget import Widget
from kivy.uix.button import Button
from kivy.uix.togglebutton import ToggleButton
from kivy.uix.label import Label
from kivy.uix.popup import Popup
from kivy.uix.dropdown import DropDown
from kivy.config import ConfigParser
from kivy.uix.settings import Settings

class LoginScreen(Screen):
    def __init__(self,config,**kwargs):
        super(LoginScreen,self).__init__(**kwargs)
        self.config = config

    def save(self):
        username = self.ids.username.text
        password = self.ids.password.text
        self.config.set('remotedb','username',username)
        self.config.set('remotedb','password',password)
        self.config.write()
        self.manager.current = 'main'


class UserInput(Screen):
    def __init__(self,config,**kwargs):
        super(UserInput,self).__init__(**kwargs)
        self.city = 'Austin'
        self.config = config

    def startdb(self,*args,**kwargs):