engine/process.py
def point_manual(self, message):
        """Control the message length. In the case of the successful text
           input validation, save a point geometry and its creation time
           in the latest feature for a message/call sender.
           Return the proper answer"""
        if len(message.text) > 25:
            return answers['LONG']
        else:
            try:
                lat, long = message.text.lower().split(',')
                lat, long = float(lat), float(long)
                if -90 <= lat <= 90 and -180 <= long <= 180:
                    time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
                    cursor.execute(f"update {self.db}features set point = ST_GeomFromText("
                                   f"'POINT({long} {lat})',4326), entr_time = '{time}'"
                                   f"where id = (select max(id) from {self.db}features where "
                                   f"user_id = {message.from_user.id})")
                    connection.commit()
                    return answers['POINT_MEDIA'] % (lat, long)
                elif not -90 <= lat <= 90 and not -180 <= long <= 180:
                    return answers['INVALID_COORD']
                elif not -90 <= lat <= 90:
                    return answers['INVALID_LAT']
                else:
                    return answers['INVALID_LONG']
            except ValueError:
                return answers['FOLLOW_TEMPLATE']
Control the message length. In the case of the successful text
           input validation, save a point geometry and its creation time
           in the latest feature for a message/call sender.
           Return the proper answer
Control the message length. In the case of the successful text
input validation, save a point geometry and its creation time
in the latest feature for a message/call sender.
Return the proper answer
Control the message length . In the case of the successful text input validation save a point geometry and its creation time in the latest feature for a message / call sender . Return the proper answer
def point_manual(self, message):
        if len(message.text) > 25:
            return answers['LONG']
        else:
            try:
                lat, long = message.text.lower().split(',')
                lat, long = float(lat), float(long)
                if -90 <= lat <= 90 and -180 <= long <= 180:
                    time = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
                    cursor.execute(f"update {self.db}features set point = ST_GeomFromText("
                                   f"'POINT({long} {lat})',4326), entr_time = '{time}'"
                                   f"where id = (select max(id) from {self.db}features where "
                                   f"user_id = {message.from_user.id})")
                    connection.commit()
                    return answers['POINT_MEDIA'] % (lat, long)
                elif not -90 <= lat <= 90 and not -180 <= long <= 180:
                    return answers['INVALID_COORD']
                elif not -90 <= lat <= 90:
                    return answers['INVALID_LAT']
                else:
                    return answers['INVALID_LONG']
            except ValueError:
                return answers['FOLLOW_TEMPLATE']
def point_manual ( self , message ) : if len ( message . text ) > 25 : return answers [ 'LONG' ] else : try : lat , long = message . text . lower ( ) . split ( ',' ) lat , long = float ( lat ) , float ( long ) if - 90 <= lat <= 90 and - 180 <= long <= 180 : time = datetime . datetime . now ( ) . strftime ( "%Y-%m-%d %H:%M:%S" ) cursor . execute ( f"update {self.db}features set point = ST_GeomFromText(" f"'POINT({long} {lat})',4326), entr_time = '{time}'" f"where id = (select max(id) from {self.db}features where " f"user_id = {message.from_user.id})" ) connection . commit ( ) return answers [ 'POINT_MEDIA' ] % ( lat , long ) elif not - 90 <= lat <= 90 and not - 180 <= long <= 180 : return answers [ 'INVALID_COORD' ] elif not - 90 <= lat <= 90 : return answers [ 'INVALID_LAT' ] else : return answers [ 'INVALID_LONG' ] except ValueError : return answers [ 'FOLLOW_TEMPLATE' ]
Control the message length.
Control the message length .
"""Control the message length. In the case of the successful text
           input validation, save a point geometry and its creation time
           in the latest feature for a message/call sender.
           Return the proper answer"""
self
message