Пример #1
0
	def go(self):
		static = PyffleStatic()
		## FIXME read this from a env var or something
		static.parse("/pyffle/static")
		
		Session = sessionmaker()
		
		##		engine = create_engine('postgresql://*****:*****@localhost/pyffledev', echo=False)
		engine = create_engine(static.options['pyffle.dburl'], echo = False)
		Session.configure(bind=engine)
		
		self.session = Session()
		util = PyffleUtil()
		self.data = PyffleData()
		self.data.LOGLEVEL = self.data.LOGNORMAL;
		self.data.static = static
		self.data.session = self.session
		self.data.util = util
		util.data = self.data
		dispatcher = PyffleDispatch()
		dispatcher.setup(self.data,self.modules,self.modulelist)
		self.data.setDispatcher(dispatcher)
		self.data.stateChange("startup")

		self.words =  util.loadWords("WORDS")		## FIXME should be from static
		self.info =   util.loadWords("INFO")
		self.help =   util.loadWords("HELP")
		self.menus =  util.loadWords("MENUS")
		self.text =   util.loadWords("TEXT")
		self.system = util.loadWords("SYSTEM")
		util.texts["WORDS"] = self.words
		util.texts["INFO"] = self.info
		util.texts["HELP"] = self.help
		util.texts["MENUS"] = self.menus
		util.texts["TEXT"] = self.text
		util.texts["SYSTEM"] = 	self.system	
		self.data.stateChange("wordsloaded")

		mtalist = [["pyffle_mta_uucp","Pyffle UUCP","UUCP MTA for Pyffle"],
				["pyffle_mta_ftn","Pyffle FTN","FTN MTA for Pyffle"]]
		self.data.loadMtaList(mtalist)
		#msg1 = self.data.createMessage("fooble","sampsa","Test from py","Hello earth")
		#msg2 = self.data.createMessage("*****@*****.**","sampsa","Test to outside","Hello sky")
		self.data.stateChange("mtasloaded")

		if self.petsciiSupport:
			choice = self.data.util.prompt("\n[P]ETSCII / [A]SCII?")
			choice = choice.lower().strip()
			if choice == "p":
				self.data.util.petsciiMode = True
				## Enable shift on the remote terminal
				print chr(0x0e)
			
		self.data.stateChange("prelogin")
		self.login()
		
		self.data.stateChange("premainmenu")
		self.mainmenu()
		self.data.stateChange("postmainmenu")
		self.data.stateChange("exit")
Пример #2
0
    def go(self):
        static = PyffleStatic()
        ## FIXME read this from a env var or something
        static.parse("/pyffle/static")

        Session = sessionmaker()

        ##		engine = create_engine('postgresql://*****:*****@localhost/pyffledev', echo=False)
        engine = create_engine(static.options['pyffle.dburl'], echo=False)
        Session.configure(bind=engine)

        self.session = Session()
        util = PyffleUtil()
        self.data = PyffleData()
        self.data.static = static
        self.data.session = self.session
        self.data.util = util
        util.data = self.data
        dispatcher = PyffleDispatch()
        dispatcher.setup(self.data, self.modules, self.modulelist)
        self.data.setDispatcher(dispatcher)
        self.data.stateChange("startup")

        self.words = util.loadWords("WORDS")  ## FIXME should be from static
        self.info = util.loadWords("INFO")
        self.help = util.loadWords("HELP")
        self.menus = util.loadWords("MENUS")
        self.text = util.loadWords("TEXT")
        self.system = util.loadWords("SYSTEM")
        util.texts["WORDS"] = self.words
        util.texts["INFO"] = self.info
        util.texts["HELP"] = self.help
        util.texts["MENUS"] = self.menus
        util.texts["TEXT"] = self.text
        util.texts["SYSTEM"] = self.system
        self.data.stateChange("wordsloaded")

        mtalist = [["pyffle_mta_uucp", "Pyffle UUCP", "UUCP MTA for Pyffle"]]
        self.data.loadMtaList(mtalist)
        #msg1 = self.data.createMessage("fooble","sampsa","Test from py","Hello earth")
        #msg2 = self.data.createMessage("*****@*****.**","sampsa","Test to outside","Hello sky")
        self.data.stateChange("mtasloaded")

        choice = self.data.util.prompt("\n[P]ETSCII / [A]SCII?")
        choice = choice.lower().strip()
        if choice == "p":
            self.data.util.petsciiMode = True
            ## Enable shift on the remote terminal
            print chr(0x0e)

        self.data.stateChange("prelogin")
        self.login()

        self.data.stateChange("premainmenu")
        self.mainmenu()
        self.data.stateChange("postmainmenu")
        self.data.stateChange("exit")
Пример #3
0
	def setupPyffleConnection(self):
		static = PyffleStatic()
		## FIXME read this from a env var or something
		static.parse("/pyffle/static")
	
		Session = sessionmaker()
	
		##		engine = create_engine('postgresql://*****:*****@localhost/pyffledev', echo=False)
		engine = create_engine(static.options['pyffle.dburl'], echo = False)
		Session.configure(bind=engine)
	
		self.session = Session()
		util = PyffleUtil()
		self.data = PyffleData()
		self.data.static = static
		self.data.session = self.session
		self.data.util = util
		util.data = self.data
		dispatcher = PyffleDispatch()
		dispatcher.setup(self.data,{},{})
		self.data.setDispatcher(dispatcher)
		self.data.stateChange("startup")
	
		self.words =  util.loadWords("WORDS")		## FIXME should be from static
		self.info =   util.loadWords("INFO")
		self.help =   util.loadWords("HELP")
		self.menus =  util.loadWords("MENUS")
		self.text =   util.loadWords("TEXT")
		self.system = util.loadWords("SYSTEM")
		util.texts["WORDS"] = self.words
		util.texts["INFO"] = self.info
		util.texts["HELP"] = self.help
		util.texts["MENUS"] = self.menus
		util.texts["TEXT"] = self.text
		util.texts["SYSTEM"] = 	self.system	
		self.data.stateChange("wordsloaded")
	
		mtalist = [["pyffle_mta_uucp","Pyffle UUCP","UUCP MTA for Pyffle"],
			["pyffle_mta_ftn","Pyffle FTN","FTN MTA for Pyffle"]]
		self.data.loadMtaList(mtalist)
		self.data.stateChange("mtasloaded")
		self.lastCheck = datetime.now()