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

All Samples(106)  |  Call(93)  |  Derive(0)  |  Import(13)
Append data to debug.log file

        def log(data):
    """Append data to debug.log file"""

    if not __debugging():
        return

    filename = os.path.join(__debugDir(), 'debug.log')
    dbfd = open(filename, 'a')
    dbfd.write('%s\n' % data)
    dbfd.close()
        


src/e/n/EnvWatcher-HEAD/python/EnvironmentObjects.py   EnvWatcher(Download)
"""This mudule defines those properties of Envionmnet objects which I believe to be common to all
shells."""
 
from Debug import log
 
    def ApplySwap(self,inv,li):
        if inv[0] not in li or inv[1] not in li:
            log("Couldn't apply swap",linversion=inv,list=li)
            return
        ind1 = li.index(inv[0])

src/e/n/EnvWatcher-HEAD/python/env_manager.py   EnvWatcher(Download)
import pickle
 
from Debug import log
 
# This is that tag-line that the shell-function looks for.
		self.session_dir = os.path.normpath(session_dir)+os.sep
		self.main_dir = os.path.normpath(main_dir)+os.sep
		log("initialized the EnvManager")
 
	# Exceptions:
			if verbose:
				print >>sys.stderr, "Warning: Open session %s exists. Overwriting."%name
			log("removing session %s"%name)
			os.remove(self.SessionName(name))
 
			if verbose:
				print >>sys.stderr, "Warning: Saved state %s exists. Overwriting."%name
			log("removing state %s"%name)
			os.remove(self.StateName(name))
 
				print >>sys.stderr, "Open session %s exists. Do you want to overwrite? "  % name,
				user=raw_input()
				log("Question:","Open session %s exists. Do you want to overwrite? "  % name,"answer:",user)
				if re.match("""y(es?)?""",user):
					print >>sys.stderr," --> Overwriting."

src/e/n/EnvWatcher-HEAD/python/Bash.py   EnvWatcher(Download)
 
from EnvironmentObjects import EnvVariable, LocVariable, LocFunction, Alias, EWObjKey
from Debug import log
 
 
	def ParseAll(self,text):
		log("Now Parsing bash environment",text)
		env_dict = {}
 
		# first get the environment:
			else:
				print >>sys.stderr,"Warning: unknown bash environment line:\n\t=>"+line
				log("unknown bash environment line:\n\t=>",line)
				continue
			#Bash inserts the environment variables into the local variables.
			# Now ready to parse alias
			if not BashAlias.Matches(line):
				log("Warning: unknown bash alias:\n\t=>",line)
				print >>sys.stderr,"Warning: unknown bash alias:\n\t=>"+line
				continue

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
 
        """
        log('Authenticating ...')
        #Am i authed, should be its own function really
        data = self.sirius.getURL(
          'http://www.sirius.com/player/listen/play.action').read()
        if 'NOW PLAYING TITLE:START' in data:
          log('Authenticated')
 
        session = self.sirius.findSessionID()
	log('SESSIONID= %s' % session)
        if not session:
          getURL(
        data = self.sirius.getURL(authurl, poststring=post).read()
        if '<title>SIRIUS Player' in data:
          log("got valid page at: " + authurl + "\n")
          return True
        else:

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
 
        """
        log('Authenticating ...')
        #Am i authed, should be its own function really
        data = self.sirius.getURL(
          'http://www.sirius.com/player/listen/play.action').read()
        if 'NOW PLAYING TITLE:START' in data:
          log('Authenticated')
 
        session = self.sirius.findSessionID()
	log('SESSIONID= %s' % session)
        if not session:
          getURL(
        data = self.sirius.getURL(authurl, poststring=post).read()
        if '<title>SIRIUS Player' in data:
          log("got valid page at: " + authurl + "\n")
          return True
        else:

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
            postdata = poststring
 
        log("POST=%s" % postdata)#DEBUG
        log("url=%s" % url) #DEBUG
 
            stream = self.__stream
 
	log('Validationg stream %s' % stream)
        if len(self.allstreams) < 5:
            self.allstreams = self.getStreams()
        if stream not in self.allstreams:
            log('stream %s invalid' % stream)

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
            postdata = poststring
 
        log("url=%s" % url) #DEBUG
        log("POST=%s" % postdata)#DEBUG
 
            stream = self.__stream
 
	log('Validationg stream %s' % stream)
        if len(self.allstreams) < 5:
            self.allstreams = self.getStreams()
        if stream not in self.allstreams:
            log('stream %s invalid' % stream)

src/p/y/pyxis-HEAD/pyxis/StreamHandler.py   pyxis(Download)
import datetime
from Config import Config
from Debug import log, logfile
 
class StreamHandler(object):
            return
 
        log("Starting mplayer...")
        if self.options.record:
            if self.options.output:
        else:
            mpc = "%s '%s'" % (self.command, url)
        log('mpc = %s' % mpc)
        self.pipeopen(mpc)
 

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
        stream: the station name"""
        try:
            log('Play %s' % stream)
            self.sirius.setStreamByLongName(stream)
        except:

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
        stream: the station name"""
        try:
            log('Play %s' % stream)
            self.sirius.setStreamByLongName(stream)
        except InvalidStream:

  1 | 2  Next