Skip to content

Instantly share code, notes, and snippets.

@b1naryth1ef
Created August 23, 2011 05:25
Show Gist options
  • Save b1naryth1ef/1164409 to your computer and use it in GitHub Desktop.
Save b1naryth1ef/1164409 to your computer and use it in GitHub Desktop.
New Checkin Install
"""The install file for checkin. Rewritten 8/23/2011"""
import getpass
from MySQLdb import *
import MySQLdb
import sys
#Vars
dev_flag = 0 #1-on, 0-off
default_name = "Pycheckins"
c_db = ""
c_server = ""
c_user = ""
c_passwd = ""
def curse(server,user,passwd,db=None):
if db is not None:
x = [server,user,passwd,db]
else:
x = [server,user,passwd]
db = MySQLdb.connect([x for x in x])
return db.cursor()
def db_create(c,dbname=default_name):
cmd = "create database %s" % (dbname)
c.execute(cmd)
def db_fill(c,):
def db_probe(c,):
def part2(): #Setup DB Connect
serv = raw_input("Server / Node name [localhost]: ").lower()
if serv != "":
c_server = serv
user = raw_input("Username [root]: ").lower()
if user != "":
c_user = user
c_passwd = getpass.getpass("Password (Hidden Field): ")
x2 = raw_input("Create a (NEW) db or use an (EXS)isting one? [NEW]: ").lower()
if x2 == "":
pass #Create DB
elif x2 == "exs":
pass #use exsisting
def part1():
print "Hi! Welcome to the guided walkthrough for installing PyCheckin!"
print "Each question will have a default anwser in [brackets]. Pressing enter will assume the default value"
print "Questions with Y/N values will suggest values in (parenthesis)"
x1 = raw_input("Ready to go? [Yes]: ").lower()
if x1 != "":
print "Okay! Quitting..."
sys.exit()
print "Now let's setup your DB Connect!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment