Exemple #1
0
 def create_publication_body(self):  # form publication body
     self.text = InputClass.read_str_input(
         "input user comment text:")  # input text
     self.user_name = InputClass.read_str_input(
         "input user name:")  # input user name
     self.pub_date = Content.set_pub_date(self)  # set publication date
     self.pub_body = f"{self.text}'\nFrom {self.user_name}, at {self.pub_date}"  # for publication body
Exemple #2
0
 def __set_values_from_console(
         self):  # define procedure for setting fields values from console
     user_input = InputClass()  # use object of InputClass
     self.text = user_input.read_str_input(
         "input user comment text:")  # input text
     self.user_name = user_input.read_str_input(
         "input user name:")  # input city
Exemple #3
0
 def __set_values_from_console(
         self):  # define procedure for setting fields values from console
     user_input = InputClass()  # use object of InputClass
     self.text = user_input.read_str_input(
         "input advertising text:")  # input text
     self.exp_date = user_input.read_date_input(
         "input advertising expiration date:"
     )  # input date (date input is corrected via console dialog)
Exemple #4
0
 def create_publication_body(self):  # form publication body
     self.text = InputClass.read_str_input(
         "input advertising text:")  # input text
     self.exp_date = InputClass.read_date_input(
         "input advertising expiration date:")  # input date
     Content.set_pub_date(self)  # set publication date
     self.num_of_days = (self.exp_date -
                         self.pub_date).days  # calculate number of days
     self.pub_body = f"{self.text} \nActual until: {self.exp_date.strftime('%d/%m/%Y')}, {self.num_of_days} days left"  # form advertising body
Exemple #5
0
 def __set_values_from_console(
         self):  # define procedure for setting fields values from console
     user_input = InputClass()  # use object of InputClass
     self.text = user_input.read_str_input("input news text:")  # input text
     self.text = normilize_str(self.text)
     self.city = user_input.read_str_input("input news city:")  # input city
Exemple #6
0
 def create_publication_body(self):  # form publication body
     self.text = InputClass.read_str_input("input news text:")  # input text
     self.city = InputClass.read_str_input("input news city:")  # input city
     self.pub_date = Content.set_pub_date(self)  # set publication date
     self.pub_body = f"{self.text}\n{self.city}, {self.pub_date}"  # form news body
Exemple #7
0
 def create_publication_body(self):
     self.text = InputClass.read_str_input("input user comment text:")
     self.user_name = InputClass.read_str_input("input user name:")
     self.pub_date = Content.set_pub_date(self)
     self.pub_body = f"{self.text}'\nFrom {self.user_name}, at {self.pub_date}"
Exemple #8
0
 def create_publication_body(self):
     self.text = InputClass.read_str_input("input advertising text:")
     self.exp_date = InputClass.read_date_input("input advertising expiration date:")
     Content.set_pub_date(self)
     self.num_of_days = (self.exp_date - self.pub_date).days
     self.pub_body = f"{self.text} \nActual until: {self.exp_date.strftime('%d/%m/%Y')}, {self.num_of_days} days left"
Exemple #9
0
 def create_publication_body(self):
     self.text = InputClass.read_str_input("input news text:")
     self.city = InputClass.read_str_input("input news city:")
     self.pub_date = Content.set_pub_date(self)
     self.pub_body = f"{self.text}\n{self.city}, {self.pub_date}"