Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(52)  |  Call(52)  |  Derive(0)  |  Import(0)

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/main.py   SynoDLNAtrakt(Download)
def generate_stats():
    logger.debug(u"generating new stats...")
    since = datetime.datetime.now() - datetime.timedelta(days=30)
 
    movies = db.session.query(db.Movies)
        env = EnvironmentContext(alembic_cfg, script)
 
        logger.debug(u"Alembic Config: {0}/alembic.ini".format(config.basedir))
        logger.debug(u"Scripts: {0}/alembic".format(config.basedir))
        logger.debug(u"database: sqlite:////{0}/SynoDLNAtrakt.db".format(config.datadir))
        logger.debug(u"current_rev: {0}\nHead_rev: {1}".format(current_rev, env.get_head_revision()))

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/helper.py   SynoDLNAtrakt(Download)
    dbresult = pgsql.session.query(pgsql.Video).filter(pgsql.Video.id == theid).first()
    if dbresult:
        logger.debug(u"synoindex result for {0} -> {1}".format(dbresult.id, dbresult.path))
        path = dbresult.path
        duration = dbresult.duration
            sys.exit(u"Please enable Debugmode for MediaServer first!")
        else:
            logger.debug(u"MediaServer running in Debugmode")
    except:
        logger.error(u"Can't check if your MeidaServer runs in Debugmode or not...")
        f = open(watched, 'w')
        f.close()
        logger.debug(u"Created watched file: {0}".format(watched))
 
 
                        else:
                            # when its outside the timframe, try to overwrite it with the newer date...
                            logger.debug(u"{0} is more than 6hours after the first access to: {1}".format(thedate, theid))
                            logger.debug(u"Overwriting {0} with new startdate: {1}".format(theid, thedate))
                            thedate = [thedate]

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/boxcar.py   SynoDLNAtrakt(Download)
                    subscribeNote = self._sendBoxcar(msg, title, email, True)
                    if subscribeNote:
                        logger.debug("Subscription send")
                        return True
                    else:
                return False
        else:  # 200
            logger.debug("Boxcar notification successful.")
            return True
 
    def _notifyBoxcar(self, title, message=None, username=None, force=False):
        if not config.use_boxcar and not force:
            logger.debug("Notification for Boxcar not enabled, skipping this notification")
            username = config.boxcar_username
 
        logger.debug("Sending notification for {0}".format(message))
 
        self._sendBoxcar(message, title, username)

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/versioncheck.py   SynoDLNAtrakt(Download)
 
        try:
            logger.debug('Trying to execute: "' + cmd + '" with shell in ' + config.basedir)
            p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, shell=True, cwd=config.basedir)
            output, err = p.communicate()
            logger.debug('Git output: ' + output)
        except OSError:
            logger.debug('Command ' + cmd + ' didn\'t work, couldn\'t find git')
 
        if 'not found' in output or "not recognized as an internal or external command" in output:
            logger.debug('Unable to find git with command ' + cmd)
            output = None
        elif 'fatal:' in output or err:

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/images.py   SynoDLNAtrakt(Download)
    fanartpath = os.path.join(config.cachedir, "fanart/{0}.jpg".format(theid))
 
    logger.debug(u"COVERPATH -> {0}".format(coverpath))
    logger.debug(u"FANARTPATH -> {0}".format(fanartpath))
 
            cover_url = "{0}-300.jpg".format(os.path.splitext(r.json()["images"]["poster"])[0])
            fanart_url = "{0}-940.jpg".format(os.path.splitext(r.json()["images"]["fanart"])[0])
            logger.debug(u"{0}, {1}".format(cover_url, fanart_url))
 
            if not os.path.exists(coverpath):
                        f.write(cover.content)
                        f.close()
                        logger.debug(u"downloaded poster for {0}".format(theid))
                except:
                    logger.debug(u"unable to download poster for {0}".format(theid))

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/trakt.py   SynoDLNAtrakt(Download)
        response = scrobble(mediaelement)
        if not response:
            logger.debug(u"Scrobble failed, trying to mark as seen manually...")
            response = seen(mediaelement)
    return response
        logargs["password"] = "XXXXXXXXXXXXX"
 
    logger.debug(u"Sending infos to trakt: URL: {0}, Data: {1}, Method: {2}".format(url, logargs, method))
 
    if response and debug:
        logger.debug(u"Trakt Response: {0}".format(response.json()))

src/s/y/SynoDLNAtrakt-HEAD/synodlnatrakt/mediaelement.py   SynoDLNAtrakt(Download)
            db.session.merge(insert)
            db.session.commit()
            logger.debug(u"{0} saved to database".format(self.path))
 
    def mediaflags(self):
        dbresult = pgsql.session.query(pgsql.Video).filter(pgsql.Video.id == self.synoindex).first()
        self.acodec = dbresult.audio_codec
        self.vcodec = dbresult.video_codec
        self.vwidth = dbresult.resolutionx
        logger.debug(u"generating mediaflags for {0}: acodec => {1}, vcodec => {2}, vwidth => {3}".format(self.name, self.acodec, self.vcodec, self.vwidth))
 
            if config.add_to_list:
                logger.debug(u"trying to add '{0}' to your trakt.tv list: '{1}'".format(self.name, config.list_name))
                trakt.add_to_list(self, listname=config.list_name)
 
            if config.add_to_collection:
                logger.debug(u"trying to add '{0}' to your trakt.tv collection".format(self.name))
            db.session.merge(insert)
            db.session.commit()
            logger.debug(u"{0} saved to database".format(self.path))
 
    def mediaflags(self):