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

All Samples(30)  |  Call(20)  |  Derive(0)  |  Import(10)
Log data to file

        def logfile(file, data):
    """Log data to file"""

    if not __debugging():
        return

    filename = os.path.join(__debugDir(), file)
    dbfd = open(filename, 'w')
    dbfd.write(data)
    dbfd.close()
        


src/p/y/pyxis-0.2.1/pyxis/ProviderUSA.py   pyxis(Download)
import re
import time
from Debug import log, logfile
from Config import Config, toBool
from Exceptions import AuthError, LoginError, InvalidStream
            hd.close()
        if data.find('unable to log you in') <> -1:  #IF FOUND
            logfile('login-error.html', data)  #DEBUG 0
            print 'LoginError, expired account?' #DEBUG 0
            raise LoginError
        if data.find('Sorry_Pg3.gif') <> -1:  #IF FOUND
            print '\nLoginError: to many logins today?'
            logfile('login-error.html', data)  #DEBUG 0
        if len(allstreams) < 5:
            log("ERROR getting streams, see streams-DEBUG.html") # DEBUG
            logfile('streams-DEBUG.html',data)  # DEBUG
            raise AuthError
        else:
	    logfile('streams.log', repr(allstreams))

src/p/y/pyxis-HEAD/pyxis/ProviderUSA.py   pyxis(Download)
import re
import time
from Debug import log, logfile
from Config import Config, toBool
from Exceptions import AuthError, LoginError, InvalidStream
            hd.close()
        if data.find('unable to log you in') <> -1:  #IF FOUND
            logfile('login-error.html', data)  #DEBUG 0
            print 'LoginError, expired account?' #DEBUG 0
            raise LoginError
        if data.find('Sorry_Pg3.gif') <> -1:  #IF FOUND
            print '\nLoginError: to many logins today?'
            logfile('login-error.html', data)  #DEBUG 0
        if len(allstreams) < 5:
            log("ERROR getting streams, see streams-DEBUG.html") # DEBUG
            logfile('streams-DEBUG.html',data)  # DEBUG
            raise AuthError
        else:
	    logfile('streams.log', repr(allstreams))

src/p/y/pyxis-0.2.1/pyxis/ProviderCanada.py   pyxis(Download)
from Config import Config, toBool
from Exceptions import AuthError, LoginError, InvalidStream
from Debug import log, logfile
from BeautifulSoup import BeautifulSoup
 
            hd.close()
        if data.find('unable to log you in') <> -1:  #IF FOUND
            logfile('login-error.html', data)  #DEBUG 0
            print 'LoginError, expired account??, see login-error.html' #DEBUG 0
            raise LoginError
        if data.find('Sorry_Pg3.gif') <> -1:  #IF FOUND
            #DEBUG 0
            print '\nLoginError: to many logins today? see login-error.html'
            logfile('login-error.html', data)  #DEBUG 0
            print "Login Error: to many logins today?"
            print "     see getasxurl-DEBUG.html"
            logfile('getasxurl-DEBUG.html', data)  #DEBUG 0
            raise LoginError
      #self.printcookies() #DEBUG
            asxURL = soup.find('param', {'name': 'FileName'})['value']
        except:
            logfile("getasuxurl-ERROR.html",data) #DEBUG
            print "\nAuth Error:, see getasuxurl-ERROR.html\n" #DEBUG
            raise AuthError

src/p/y/pyxis-HEAD/pyxis/ProviderCanada.py   pyxis(Download)
from Config import Config, toBool
from Exceptions import AuthError, LoginError, InvalidStream
from Debug import log, logfile
from BeautifulSoup import BeautifulSoup
 
            hd.close()
        if data.find('unable to log you in') <> -1:  #IF FOUND
            logfile('login-error.html', data)  #DEBUG 0
            print 'LoginError, expired account??, see login-error.html' #DEBUG 0
            raise LoginError
        if data.find('Sorry_Pg3.gif') <> -1:  #IF FOUND
            #DEBUG 0
            print '\nLoginError: to many logins today? see login-error.html'
            logfile('login-error.html', data)  #DEBUG 0
            print "Login Error: to many logins today?"
            print "     see getasxurl-DEBUG.html"
            logfile('getasxurl-DEBUG.html', data)  #DEBUG 0
            raise LoginError
      #self.printcookies() #DEBUG
            asxURL = soup.find('param', {'name': 'FileName'})['value']
        except:
            logfile("getasuxurl-ERROR.html",data) #DEBUG
            print "\nAuth Error:, see getasuxurl-ERROR.html\n" #DEBUG
            raise AuthError

src/p/y/pyxis-0.2.1/pyxis/Sirius.py   pyxis(Download)
from ProviderCanada import ProviderCanada
from Exceptions import AuthError, LoginError, InvalidStream
from Debug import log, logfile
from xml.dom.minidom import parse
import htmlfixes
            data = re.sub(sub[0], sub[1], data)
 
        logfile('sanitize.html', data) #DEBUG
 
        return data

src/p/y/pyxis-HEAD/pyxis/Sirius.py   pyxis(Download)
from ProviderCanada import ProviderCanada
from Exceptions import AuthError, LoginError, InvalidStream
from Debug import log, logfile
from xml.dom.minidom import parse
import htmlfixes
            data = re.sub(sub[0], sub[1], data)
 
        logfile('sanitize.html', data) #DEBUG
 
        return data

src/p/y/pyxis-0.2.1/pyxis/Interface.py   pyxis(Download)
from Player import Player
from Sirius import Sirius
from Debug import cleanDebug, log, logfile
import sys
import os

src/p/y/pyxis-HEAD/pyxis/Interface.py   pyxis(Download)
from Player import Player
from Sirius import Sirius
from Debug import cleanDebug, log, logfile
from Exceptions import AuthError, LoginError, InvalidStream
import sys

src/p/y/pyxis-0.2.1/pyxis/StreamHandler.py   pyxis(Download)
import datetime
from Config import Config
from Debug import log, logfile
 
class StreamHandler(object):

src/p/y/pyxis-HEAD/pyxis/StreamHandler.py   pyxis(Download)
import datetime
from Config import Config
from Debug import log, logfile
 
class StreamHandler(object):