当前位置: 首页>>代码示例>>Python>>正文


Python Utils.getConfig方法代码示例

本文整理汇总了Python中Utils.Utils.getConfig方法的典型用法代码示例。如果您正苦于以下问题:Python Utils.getConfig方法的具体用法?Python Utils.getConfig怎么用?Python Utils.getConfig使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utils.Utils的用法示例。


在下文中一共展示了Utils.getConfig方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import getConfig [as 别名]
    def __init__(self, siteName):
        self.siteName = siteName
        self.rdList = Set()

        self.recordIndicator = Set()
        self.dic = dict()
        self.dicCacheCount = dict()
        self.dicTotalCount = dict()
        self.localtime = time.localtime()
        self.httpsCount = 0
        self.httpsCached = 0
        self.cacheableObjectCount = 0
        self.cacheableObjectsThatAreCached = 0
        self.responseFileString = ""

        self.imageCount = 0
        self.imageCached = 0
        self.imageHttps = 0
        self.imageHttpsCached = 0

        self.textCount = 0
        self.textCached = 0
        self.textHttps = 0
        self.textHttpsCached = 0

        self.scriptCount = 0
        self.scriptCached = 0
        self.scriptHttps = 0
        self.scriptHttpsCached = 0

        self.videoCount = 0
        self.videoCached = 0
        self.videoHttps = 0
        self.videoHttpsCached = 0

        self.iconCount = 0
        self.iconCached = 0
        self.iconHttps = 0
        self.iconHttpsCached = 0

        self.appCount = 0
        self.appCached = 0
        self.appHttps = 0
        self.appHttpsCached = 0

        self.sizeDetailSet = Set()

        self.requestFileRaw = Utils.getConfig("requestFolder") + siteName.rstrip() + ".request_raw"
        self.requestFile = Utils.getConfig("requestFolder") + siteName.rstrip() + ".request"
        self.responseFile = Utils.getConfig("responseFolder") + siteName.rstrip() + ".response"
开发者ID:scubeWasTaken,项目名称:CacheMeter,代码行数:52,代码来源:ResourceDetails.py

示例2: parse_options

# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import getConfig [as 别名]
def parse_options():
    """parse_options() -> opts, args

    Parse any command-line options given returning both
    the parsed options and arguments.
    """

    parser = optparse.OptionParser(usage=USAGE, version=VERSION)

    parser.add_option("-f", "--file",
            action="store", default=Utils.getConfig("defaultFile"), dest="file",
            help="Read the site name from external file")

    parser.add_option("-s", "--site-name",
            action="store", default="", dest="sitename",
            help="Get links for specified url only")

    opts, args = parser.parse_args()

    return opts, args
开发者ID:scubeWasTaken,项目名称:CacheMeter,代码行数:22,代码来源:main.py

示例3: int

# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import getConfig [as 别名]
from Utils import Utils
import threading,Queue,time,sys,traceback
from time import sleep
from sets import Set
import optparse


from ResponseGenerator  import *
from RequestGenerator   import *
from ResourceDetails    import *
from LinkSetGenerator   import Crawler

maximumSites = int(Utils.getConfig("maximumSites"))
threadLimiter = threading.BoundedSemaphore(maximumSites)

#Globals (start with a captial letter)
Qin  = Queue.Queue() 
Qout = Queue.Queue()
Qerr = Queue.Queue()
Pool = []   

def err_msg():
    trace= sys.exc_info()[2]
    try:
        exc_value=str(sys.exc_value)
    except:
        exc_value=''
    return str(traceback.format_tb(trace)),str(sys.exc_type),exc_value

def get_errors():
    try:
开发者ID:scubeWasTaken,项目名称:CacheMeter,代码行数:33,代码来源:main.py

示例4: __init__

# 需要导入模块: from Utils import Utils [as 别名]
# 或者: from Utils.Utils import getConfig [as 别名]
 def __init__(self, profile=Utils.getConfig("profile", "firefox")):
     #1. Add HTTP-Request Logger extension to Firefox
     #2. Set Firefox profile so that HTTP-Request Logger will be available
     self.fp = webdriver.FirefoxProfile(profile)
开发者ID:scubeWasTaken,项目名称:CacheMeter,代码行数:6,代码来源:RequestGenerator.py


注:本文中的Utils.Utils.getConfig方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。