diff --git a/main.py b/main.py index 02e8383d2717b53875623b16ed9c6db501517a97..e83ee9d8b4300acbb5359a165faad200fbb281e8 100644 --- a/main.py +++ b/main.py @@ -163,5 +163,6 @@ def main_cli() -> None: # following code will only execute if run directly from this file. if __name__ == "__main__": + logging.debug("STARTING main_cli") main_cli() - logging.debug("main_cli finished, program exiting. bye bye!") + logging.debug("main_cli finished, program exiting. bye bye!") \ No newline at end of file diff --git a/src/cinemaObj.py b/src/cinemaObj.py index ac86e5285ee5784de023f18c016c5802c729a676..8d140b603b9bd2cf48c81931ccb8e8712318371d 100644 --- a/src/cinemaObj.py +++ b/src/cinemaObj.py @@ -28,12 +28,19 @@ class Cinema(object): def update_screen(self, screen:Screen, sizeHeight:float, sizeWidth:float, resolutionHeight:int, resolutionWidth:int, capacity:int) -> None: raise NotImplementedError() - def get_listings(self): + def get_showings(self) -> tuple: + """_summary_ + gets list of movie showings in self, odered by time starting from 30mins past the current time. + + Returns: + tuple: movie showings in time order. + """ + raise NotImplementedError() # return listing if dict/jason format? return self.listings def addListing(self, movieID): - # get movie details via movieId + # get movie details via movieId from db # append list with movie ID and more details to be showen in listing, eg; name, description, picture path. raise NotImplementedError() diff --git a/src/staffUser.py b/src/staffUser.py index 1a80f73fc1944b756cc594c3551120f72e30cec6..cc4ba0043e6add3e2b02aa26f4b65f06fb360e17 100644 --- a/src/staffUser.py +++ b/src/staffUser.py @@ -3,7 +3,7 @@ from .constants import DBNAME from .dbfunc import * from .cinemaObj import Cinema - +# trying to make this a base implementation for all user classes. class StaffUser(object): def __init__(self): @@ -11,7 +11,7 @@ class StaffUser(object): self.userName:str = "" self.userPass:str = "" self.permissionLevel:int = 0 - self.cinemas = [0] + self.cinemas = [] def __str__(self): return f"{self.__class__.__name__} user object(userID={self.userID}, userName={self.userName}, userPass={self.userPass}, permissionLevel={self.permissionLevel})" @@ -25,11 +25,9 @@ class StaffUser(object): # this will loop with i as any key from dictData and self.dict that matches, i hope lol. for i in dictData.keys(), self.__dict__.keys(): self.i = dictData[i] - - def logout(self): - logging.debug(f"user {self.userID} logging out.") - self._save_self_to_db() - self.close() + # replace cinema_ids in self.cinemas with Cinema objects + for i in self.cinemas: + self.cinemas[i] = Cinema(id=i) def _save_self_to_db(self) -> None: """save self.__dict__ to db.""" @@ -47,18 +45,22 @@ class StaffUser(object): self.close() def return_film_listings(self) -> list: + """gets film listings from cinema object""" logging.debug("called returnFilmListings func") listings = [] - for i in self.cinemas: - cinema = Cinema(id=i) - listings.append(cinema.get_listings()) + for cinema in self.cinemas: + listings.append(cinema.get_showings()) return listings def createBooking(self) -> None: logging.debug("called createBooking func") raise NotImplementedError() + + def veiwBookings(self) -> list: + logging.debug("called veiwBookings func") + raise NotImplementedError() - def manageBooking(self) -> None: + def updateBooking(self) -> None: logging.debug("called manageBooking func") raise NotImplementedError()