Esempio n. 1
0
def disp_your_conversations():
    telNumber = input('enter your fhone number: ')
    allConv = SqlConnection.convs_by_telnumber(telNumber)
    for conv in allConv:
        print(
            str(conv.startDate) + ', ' + str(conv.endDate) + ', ' +
            conv.fromTel + ', ' + conv.toTel)
Esempio n. 2
0
def create_conv():
    # create a conversation that ended now, get the start time and the call numbers from the user
    hour = int(input("enter the start hour: "))
    min = int(input("enter the start minute: "))
    endDate = datetime.datetime.now()
    startDate = datetime.datetime(endDate.year, endDate.month, endDate.day,
                                  hour, min)
    fromTel = input("enter tel number to call from. ")
    toTel = input("enter tel number to call to. ")
    conv = conversations(111, startDate, endDate, fromTel, toTel)
    answer = SqlConnection.create_conv(conv)
    print(answer)
Esempio n. 3
0
def menu():
    quit = 0;
    while(quit==0):
        print("*****MENU OPTIONS*****")

        choice = input("""
                              A: פונקציה שיוצרת שיחה חדשה.
                              B: פונקציה שמציגה את כל השיחות של לקוח לפי מספר טלפון.
                              C: פונקציה שמציגה את הסכום לתשלום של לקוח לכל הקווים שלו לפי ת"ז.
                              D: פונקציה שבודקת את מספר הקווים לכל מסלול.
                              E: פונקציה שבודקת קו האם חרג ממספר הדקות המותר.
                              F: Quit/Log Out
                              
                              Please enter your choice: """)

        if choice == "A" or choice == "a" or choice=="ש":
            SqlConnection.addTalking();
            print("succeed")
        elif choice == "B" or choice == "b" or choice=="נ":
            phone=input("enter phone: ")
            SqlConnection.getTalkingByPhone(phone);
            print("succeed")
        elif choice == "C" or choice == "c" or choice=="ב":
            yourCode=input("enter your code: ")
            SqlConnection.getcost(yourCode);
            print("succeed")
        elif choice == "D" or choice == "d" or choice=="ג":
            SqlConnection.getCountLinesOfAnyRoute()
            print("succeed")
        elif choice == "E" or choice == "e" or choice=="ק":
            phone = input("enter phone: ")
            SqlConnection.exceptionCheck(phone)
            print("succeed")
        elif choice == "F" or choice == "f" or choice=="כ":
            print("יציאה                              ")
            quit = 1;
            sys.exit
        else:
            print("You must only select either A,B,C, or D.")
    def __init__(self, ldapConfig, sqlConfig, loggingFacility):
        '''
        (MemberDatabase, dict, dict, Logger) -> None
        
        Initializes the MemberDatabase, by connecting to the associated LDAP directory
        and SQL database.
        
        ldapConfig contains three keys: name (hostname of server), dn (user as whom
        to bind), password.

        sqlConfig contains five keys: host (hostname of server), port (port of server),
        user (username as whom to connect), password and name (database to which to
        connect).
        '''
        self._directory = LdapConnection.LdapConnection(
            ldapConfig['name'], ldapConfig['dn'], ldapConfig['password'],
            loggingFacility)
        self._database = SqlConnection.SqlConnection(sqlConfig['host'],
                                                     int(sqlConfig['port']),
                                                     sqlConfig['name'],
                                                     sqlConfig['user'],
                                                     sqlConfig['password'],
                                                     loggingFacility)
        self._logger = loggingFacility
Esempio n. 5
0
mongodb_param._interpolation = configparser.ExtendedInterpolation()
if not mongodb_param.read(
        os.path.join(os.path.abspath(os.path.dirname(__file__)),
                     'private/mongodb_param.ini')):
    Log.fatal("main", "Impossible to open mongodb_param.ini !")
    exit(1)

Log.info(
    "************************************************************************************************************"
)
Log.info("Starting Conversion\n")

# Open SQL Network
NetLiensSqlNetwork = SqlConnection(
    settings.get('sql_localhost', 'address'),
    settings.get('sql_localhost', 'user'),
    settings.get('sql_localhost', 'password'),
    settings.get('sql_localhost', 'databasename'))

NetLiensMongoDb = MongoDBClient(settings.get('mongodb_localhost', 'address'),
                                settings.get('mongodb_localhost', 'port'),
                                "NetLiens")
""" --------------------------------------------------------------------------------------------------------------------
CategoryManager
-------------------------------------------------------------------------------------------------------------------- """
if not createCategoryData(NetLiensSqlNetwork, NetLiensMongoDb, mongodb_param):
    exit(1)
""" --------------------------------------------------------------------------------------------------------------------
LocalisationManager
-------------------------------------------------------------------------------------------------------------------- """
#if not createLocalisationData(NetLiensMongoDb, mongodb_param, settings) : exit(1)
Esempio n. 6
0
def check_exceeding_for_kav():
    kavNumber = input("enter kav number")
    print(SqlConnection.check_exceeding_for_kav(kavNumber))
Esempio n. 7
0
def cnt_kavim_for_every_route():
    cntList = SqlConnection.cnt_kavim_for_every_route()
    print(cntList)
Esempio n. 8
0
def disp_amount_to_pay():
    id = input('enter yuor id number')
    kavimList = SqlConnection.get_cust_kavimList(id)
    costList = SqlConnection.get_cost_for_kavimList(kavimList)
    print("the amount to pay is: " + str(sum(costList)) + "NIS")