コード例 #1
0
 def get_tweepy(self, twconfig=None):
     if twconfig is None:
         if "Twython" in self.config.sections():
             twconfig = karma.get_section(self.config, "Twython")
     tweep = twastras.get_tweepy(twconfig, logger=self.logger)
     if "tweepy" not in self.astras.keys():
         self.add_astra("tweepy", tweep)
     return tweep
コード例 #2
0
 def get_googledriver(self,gdconfig=None):
     if gdconfig==None:
         if "Pygsheets" in self.config.sections():
             gdconfig=karma.get_section(self.config,"Pygsheets")
     gd=gdastras.get_googledriver(gdconfig,logger=self.logger)
     if "pygsheet" not in self.astras.keys():
         self.add_astra('pygsheet',gd)
     return gd
コード例 #3
0
 def get_fb_browser(self,fbconfig=None):
     if fbconfig==None:
         if "Facebook" in self.config.sections():
             fbconfig=karma.get_section(self.config,"Facebook",logger=self.logger)
             fbbrowser=astra.get_browser(logger=self.logger)
     fbkarmas.fb_login(fbbrowser,fbconfig,logger=self.logger)
     if "fbbrowser" not in self.astras.keys():
         self.add_astra('fbbrowser',fbbrowser)
     return fbbrowser
コード例 #4
0
 def get_twython(self, twconfig=None):
     if twconfig is None:
         if "Twython" in self.config.sections():
             twconfig = karma.get_section(self.config, "Twython")
     tw = twastras.get_twython(twconfig, logger=self.logger)
     twkarmas.twython_check_auth(tw, logger=self.logger)
     tw.verify_credentials()
     if "twython" not in self.astras.keys():
         self.add_astra('twython', tw)
     return tw
コード例 #5
0
 def get_twython_streamer(self,twconfig=None,ofilename=None):
     if twconfig==None:
         if "Twython" in self.config.sections():
             twconfig=karma.get_section(self.config,"Twython")
     if ofilename==None:
        ofilename=os.path.join(self.sessionpath,"TwythonStreamer.json")
     tw=twastras.get_twython_streamer(twconfig,ofilename,logger=self.logger)
     if "twythonstreamer" not in self.astras.keys():
         self.add_astra('twythonstreamer',tw)
     return tw
コード例 #6
0
 def get_sms_astra(self, smsconfig=None):
     if smsconfig is None:
         if "SMSAstra" in self.config.sections():
             smsconfig = karma.get_section(self.config, "SMSAstra")
         else:
             self.logger.error("SMSAstra config section missing")
             return None
     sms = smsastras.get_sms_astra(smsconfig, self.logger)
     if "sms" not in self.astras.keys():
         self.add_astra("sms", sms)
     return sms
コード例 #7
0
 def get_googledriver(self, gdconfig=None):
     if gdconfig is None:
         if "Pygsheets" in self.config.sections():
             gdconfig = karma.get_section(self.config, "Pygsheets")
         else:
             self.logger.error("Pyugsheets config missing")
             return None
     gd = gdastras.get_googledriver(gdconfig, logger=self.logger)
     if "pygsheet" not in self.astras.keys():
         self.add_astra('pygsheet', gd)
     return gd