commands: pylib: remove error during screens generation at install time

self.engine could be undefined by the time we call getSession() if
there is no DB connection. This patch fixes this.