• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python logging.info函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中psychopy.logging.info函数的典型用法代码示例。如果您正苦于以下问题:Python info函数的具体用法?Python info怎么用?Python info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: apply_mv_remote

 def apply_mv_remote(self, asset, new_path, threaded=False):
     proj = self.proj()
     new_folder, new_name = os.path.split(new_path)
     proj.osf.rename_file(asset, new_path)
     logging.info("Sync.Changes request: Move file remote: {} -> {}"
                  .format(asset['path'], new_path))
     return 1
开发者ID:psychopy,项目名称:pyosf,代码行数:7,代码来源:sync.py


示例2: saveAsWideText

    def saveAsWideText(self, fileName, delim=None,
                       matrixOnly=False,
                       appendFile=False,
                       encoding='utf-8',
                       fileCollisionMethod='rename'):
        """Saves a long, wide-format text file, with one line representing
        the attributes and data for a single trial. Suitable for analysis
        in R and SPSS.

        If `appendFile=True` then the data will be added to the bottom of
        an existing file. Otherwise, if the file exists already it will
        be overwritten

        If `matrixOnly=True` then the file will not contain a header row,
        which can be handy if you want to append data to an existing file
        of the same format.

        encoding:
            The encoding to use when saving a the file. Defaults to `utf-8`.

        fileCollisionMethod:
            Collision method passed to
            :func:`~psychopy.tools.fileerrortools.handleFileCollision`

        """
        # set default delimiter if none given
        if delim is None:
            delim = genDelimiter(fileName)

        # create the file or send to stdout
        f = openOutputFile(
            fileName, append=appendFile, delim=delim,
            fileCollisionMethod=fileCollisionMethod, encoding=encoding)

        names = self._getAllParamNames()
        names.extend(self.dataNames)
        # names from the extraInfo dictionary
        names.extend(self._getExtraInfo()[0])
        # write a header line
        if not matrixOnly:
            for heading in names:
                f.write(u'%s%s' % (heading, delim))
            f.write('\n')
        # write the data for each entry

        for entry in self.entries:
            for name in names:
                if name in entry:
                    ename = str(entry[name])
                    if ',' in ename or '\n' in ename:
                        fmt = u'"%s"%s'
                    else:
                        fmt = u'%s%s'
                    f.write(fmt % (entry[name], delim))
                else:
                    f.write(delim)
            f.write('\n')
        if f != sys.stdout:
            f.close()
        logging.info('saved data to %r' % f.name)
开发者ID:balajisriram,项目名称:psychopy,代码行数:60,代码来源:experiment.py


示例3: setCurrent

    def setCurrent(self, calibration=-1):
        """
        Sets the current calibration for this monitor.
        Note that a single file can hold multiple calibrations each
        stored under a different key (the date it was taken)

        The argument is either a string (naming the calib) or an integer
        **eg**:

            ``myMon.setCurrent'mainCalib')``
            fetches the calibration named mainCalib
            ``calibName = myMon.setCurrent(0)``
            fetches the first calibration (alphabetically) for this monitor
            ``calibName = myMon.setCurrent(-1)``
            fetches the last alphabetical calib for this monitor (this is default)
            If default names are used for calibs (ie date/time stamp) then
            this will import the most recent.
        """
        #find the appropriate file
        #get desired calibration name if necess
        if type(calibration) in [str, unicode] and (calibration in self.calibNames):
            self.currentCalibName = calibration
        elif type(calibration)==int and calibration<=len(self.calibNames):
            self.currentCalibName = self.calibNames[calibration]
        else:
            print "No record of that calibration"
            return False

        self.currentCalib = self.calibs[self.currentCalibName]      #do the import
        if self.autoLog:
            logging.info("Loaded calibration from:%s" %self.currentCalibName)

        return self.currentCalibName
开发者ID:9173860,项目名称:psychopy,代码行数:33,代码来源:calibTools.py


示例4: __init__

    def __init__(self, files, threads=3, verbose=False):
        """Like `Speech2Text()`, but takes a list of sound files or a directory name to search
        for matching sound files, and returns a list of `(filename, response)` tuples.
        `response`'s are described in `Speech2Text.getResponse()`.

        Can use up to 5 concurrent threads. Intended for
        post-experiment processing of multiple files, in which waiting for a slow response
        is not a problem (better to get the data).

        If `files` is a string, it will be used as a directory name for glob
        (matching all `*.wav`, `*.flac`, and `*.spx` files).
        There's currently no re-try on http error."""
        list.__init__(self)  # [ (file1, resp1), (file2, resp2), ...]
        maxThreads = min(threads, 5)  # I get http errors with 6
        self.timeout = 30
        if type(files) == str and os.path.isdir(files):
            f = glob.glob(os.path.join(files, '*.wav'))
            f += glob.glob(os.path.join(files, '*.flac'))
            f += glob.glob(os.path.join(files, '*.spx'))
            fileList = f
        else:
            fileList = list(files)
        web.requireInternetAccess()  # needed to access google's speech API
        for i, filename in enumerate(fileList):
            gs = Speech2Text(filename, level=5)
            self.append((filename, gs.getThread()))  # tuple
            if verbose:
                logging.info("%i %s" % (i, filename))
            while self._activeCount() >= maxThreads:
                core.wait(.1, 0)  # idle at max count
开发者ID:jonathanoroberts,项目名称:psychopy,代码行数:30,代码来源:microphone.py


示例5: timingCheckAndLog

def timingCheckAndLog(ts,trialN):
    #check for timing problems and log them
    #ts is a list of the times of the clock after each frame
    interframeIntervs = np.diff(ts)*1000
    #print '   interframe intervs were ',around(interframeIntervs,1) #DEBUGOFF
    frameTimeTolerance=.3 #proportion longer than refreshRate that will not count as a miss
    longFrameLimit = np.round(1000/refreshRate*(1.0+frameTimeTolerance),2)
    idxsInterframeLong = np.where( interframeIntervs > longFrameLimit ) [0] #frames that exceeded 150% of expected duration
    numCasesInterframeLong = len( idxsInterframeLong )
    if numCasesInterframeLong >0 and (not demo):
       longFramesStr =  'ERROR,'+str(numCasesInterframeLong)+' frames were longer than '+str(longFrameLimit)+' ms'
       if demo: 
         longFramesStr += 'not printing them all because in demo mode'
       else:
           longFramesStr += ' apparently screen refreshes skipped, interframe durs were:'+\
                    str( np.around(  interframeIntervs[idxsInterframeLong] ,1  ) )+ ' and was these frames: '+ str(idxsInterframeLong)
       if longFramesStr != None:
                logging.error( 'trialnum='+str(trialN)+' '+longFramesStr )
                if not demo:
                    flankingAlso=list()
                    for idx in idxsInterframeLong: #also print timing of one before and one after long frame
                        if idx-1>=0:
                            flankingAlso.append(idx-1)
                        else: flankingAlso.append(np.NaN)
                        flankingAlso.append(idx)
                        if idx+1<len(interframeIntervs):  flankingAlso.append(idx+1)
                        else: flankingAlso.append(np.NaN)
                    flankingAlso = np.array(flankingAlso)
                    flankingAlso = flankingAlso[np.negative(np.isnan(flankingAlso))]  #remove nan values
                    flankingAlso = flankingAlso.astype(np.integer) #cast as integers, so can use as subscripts
                    logging.info( 'flankers also='+str( np.around( interframeIntervs[flankingAlso], 1) )  ) #because this is not an essential error message, as previous one already indicates error
                      #As INFO, at least it won't fill up the console when console set to WARNING or higher
    return numCasesInterframeLong
开发者ID:alexholcombe,项目名称:attentional-blink,代码行数:33,代码来源:AB.py


示例6: __init__

    def __init__(self, name,
        width=None,
        distance=None,
        gamma=None,
        notes=None,
        useBits=None,
        verbose=True,
        currentCalib={},
         ):
        """
        """

        #make sure that all necessary settings have some value
        self.__type__ = 'psychoMonitor'
        self.name = name
        self.currentCalib = currentCalib
        self.currentCalibName = strFromDate(time.localtime())
        self.calibs = {}
        self.calibNames = []
        self._gammaInterpolator=None
        self._gammaInterpolator2=None
        self._loadAll()
        if len(self.calibNames)>0:
            self.setCurrent(-1) #will fetch previous vals if monitor exists
        else:
            self.newCalib()

        logging.info(self.calibNames)

        #overide current monitor settings with the vals given
        if width: self.setWidth(width)
        if distance: self.setDistance(distance)
        if gamma: self.setGamma(gamma)
        if notes: self.setNotes(notes)
        if useBits!=None: self.setUseBits(useBits)
开发者ID:MattIBall,项目名称:psychopy,代码行数:35,代码来源:calibTools.py


示例7: rush

def rush(value=True):    
    """Raise the priority of the current thread/process 
    Win32 and OS X only so far - on linux use os.nice(niceIncrement)
    
    Set with rush(True) or rush(False)
    
    Beware and don't take priority until after debugging your code
    and ensuring you have a way out (e.g. an escape sequence of
    keys within the display loop). Otherwise you could end up locked
    out and having to reboot!
    """
    if importCtypesFailed: return False
    
    if value:
        bus = getBusFreq()
        extendedPolicy=_timeConstraintThreadPolicy()
        extendedPolicy.period=bus/160 #number of cycles in hz (make higher than frame rate)
        extendedPolicy.computation=bus/320#half of that period
        extendedPolicy.constrain= bus/640#max period that they should be carried out in
        extendedPolicy.preemptible=1
        extendedPolicy=getThreadPolicy(getDefault=True, flavour=THREAD_TIME_CONSTRAINT_POLICY)
        err=cocoa.thread_policy_set(cocoa.mach_thread_self(), THREAD_TIME_CONSTRAINT_POLICY, 
            ctypes.byref(extendedPolicy), #send the address of the struct
            THREAD_TIME_CONSTRAINT_POLICY_COUNT)
        if err!=KERN_SUCCESS:
            logging.error('Failed to set darwin thread policy, with thread_policy_set')
        else:
            logging.info('Successfully set darwin thread to realtime')
    else:
        #revert to default policy
        extendedPolicy=getThreadPolicy(getDefault=True, flavour=THREAD_STANDARD_POLICY)
        err=cocoa.thread_policy_set(cocoa.mach_thread_self(), THREAD_STANDARD_POLICY, 
            ctypes.byref(extendedPolicy), #send the address of the struct
            THREAD_STANDARD_POLICY_COUNT)
    return True
开发者ID:DiogoamCoutinho,项目名称:stimulus.py,代码行数:35,代码来源:darwin.py


示例8: doGammaFits

    def doGammaFits(self, levels, lums):
        linMethod = self.currentMon.getLinearizeMethod()

        if linMethod==4:
            logging.info('Fitting gamma equation (%i) to luminance data' % linMethod)
            currentCal = numpy.ones([4,6],'f')*numpy.nan
            for gun in [0,1,2,3]:
                gamCalc = monitors.GammaCalculator(levels, lums[gun,:], eq=linMethod)
                currentCal[gun,0]=gamCalc.min#min
                currentCal[gun,1]=gamCalc.max#max
                currentCal[gun,2]=gamCalc.gamma#gamma
                currentCal[gun,3]=gamCalc.a#gamma
                currentCal[gun,4]=gamCalc.b#gamma
                currentCal[gun,5]=gamCalc.k#gamma
        else:
            currentCal = numpy.ones([4,3],'f')*numpy.nan
            logging.info('Fitting gamma equation (%i) to luminance data' % linMethod)
            for gun in [0,1,2,3]:
                gamCalc = monitors.GammaCalculator(levels, lums[gun,:], eq=linMethod)
                currentCal[gun,0]=lums[gun,0]#min
                currentCal[gun,1]=lums[gun,-1]#max
                currentCal[gun,2]=gamCalc.gamma#gamma

        self.gammaGrid.setData(currentCal)
        self.currentMon.setGammaGrid(currentCal)
        self.unSavedMonitor=True
开发者ID:NSalem,项目名称:psychopy,代码行数:26,代码来源:MonitorCenter.py


示例9: __init__

    def __init__(self,
                 port=None,
                 sendBreak=False,
                 smoothing=False,
                 bufferSize=262144):
        # if we're trying to send the break signal then presumably the device
        # is sleeping
        if sendBreak:
            checkAwake = False
        else:
            checkAwake = True
        # run initialisation; parity = enable parity checking
        super(BlackBoxToolkit, self).__init__(port,
                                              baudrate=230400, eol="\r\n",
                                              parity='N',
                                              pauseDuration=1.0,  # 1 second pause!! slow device
                                              checkAwake=checkAwake)
        if sendBreak:
            self.sendBreak()
            time.sleep(3.0)  # give time to reset

        if smoothing == False:
            # For use with CRT monitors which require smoothing. LCD monitors do not.
            # Remove smoothing for optos, but keep mic smoothing - refer to BBTK handbook re: mic smoothing latency
            # Important to remove smoothing for optos, as smoothing adds 20ms delay to timing.
            logging.info("Opto sensor smoothing removed.  Mic1 and Mic2 smoothing still active.")
            self.setSmoothing('11000000')
            self.pause()

        try: # set buffer size - can make proportional to size of data (32 bytes per line * events)+1000
            self.com.set_buffer_size(bufferSize)
        except Exception:
            logging.warning("Could not set buffer size. The default buffer size for Windows is 4096 bytes.")
开发者ID:dgfitch,项目名称:psychopy,代码行数:33,代码来源:__init__.py


示例10: upload_file

    def upload_file(self, url, update=False, local_path=None,
                    size=0, threaded=False):
        """Adds the file to the OSF project.
        If containing folder doesn't exist then it will be created recursively

        update is used if the file already exists but needs updating (version
        will be incremented).
        """
        if threaded:
            if self.uploader is None or \
                    self.uploader.status != NOT_STARTED:  # can't re-use
                self.uploader = PushPullThread(
                    session=self, kind='push',
                    finished_callback=self.finished_uploads)
            self.uploader.add_asset(url, local_path, size)
        else:
            with open(local_path, 'rb') as f:
                reply = self.put(url, data=f, timeout=10.0)
            with open(local_path, 'rb') as f:
                local_md5 = hashlib.md5(f.read()).hexdigest()
            if reply.status_code not in [200, 201]:
                raise exceptions.HTTPSError(
                    "URL:{}\nreply:{}"
                    .format(url, json.dumps(reply.json(), indent=2)))
            node = FileNode(self, reply.json()['data'])
            if local_md5 != node.json['attributes']['extra']['hashes']['md5']:
                raise exceptions.OSFError(
                    "Uploaded file did not match existing SHA. "
                    "Maybe it didn't fully upload?")
            logging.info("Uploaded (unthreaded): ".format(local_path))
            return node
开发者ID:psychopy,项目名称:pyosf,代码行数:31,代码来源:remote.py


示例11: __init__

 def __init__(self,
              visible=True,
              newPos=None,
              win=None):
     super(Mouse, self).__init__()
     self.visible = visible
     self.lastPos = None
     self.prevPos = None  # used for motion detection and timing
     if win:
         self.win = win
     else:
         try:
             # to avoid circular imports, core.openWindows is defined
             # by visual.py and updated in core namespace;
             # it's circular to "import visual" here in event
             self.win = psychopy.core.openWindows[0]()
             logging.info('Mouse: using default window')
         except (NameError, IndexError):
             logging.error('Mouse: failed to get a default visual.Window'
                           ' (need to create one first)')
             self.win = None
     # for builder: set status to STARTED, NOT_STARTED etc
     self.status = None
     self.mouseClock = psychopy.core.Clock()
     self.movedistance = 0.0
     # if pygame isn't initialised then we must use pyglet
     global usePygame
     if havePygame and not pygame.display.get_init():
         usePygame = False
     if not usePygame:
         global mouseButtons
         mouseButtons = [0, 0, 0]
     self.setVisible(visible)
     if newPos is not None:
         self.setPos(newPos)
开发者ID:mmagnuski,项目名称:psychopy,代码行数:35,代码来源:event.py


示例12: create_project

    def create_project(self, title, descr="", tags=[], public=False,
                       category='project'):
        url = "{}/nodes/".format(constants.API_BASE, self.user_id)
        if type(tags) != list:  # given a string so convert to list
            tags = tags.split(",")

        body = {
            'data': {
                'type': 'nodes',
                'attributes': {
                    'title': title,
                    'category': category,
                    'description': descr,
                    'tags': tags,
                    'public': public,
                }
            }
        }
        reply = self.post(
            url,
            data=json.dumps(body),
            headers=self.headers,
            timeout=10.0)
        if reply.status_code not in [200, 201]:
            raise exceptions.OSFError("Failed to create project at:\n  {}"
                                      .format(url))
        project_node = OSFProject(session=self, id=reply.json()['data'])
        logging.info("Successfully created project {}".format(project_node.id))
        return project_node
开发者ID:psychopy,项目名称:pyosf,代码行数:29,代码来源:remote.py


示例13: token

 def token(self, token, save=None):
     """Set the token for this session and check that it works for auth
     """
     self.__dict__['token'] = token
     if token is None:
         headers = {}
     else:
         headers = {
             'Authorization': 'Bearer {}'.format(token),
         }
     self.headers.update(headers)
     # then populate self.userID and self.userName
     resp = self.get(constants.API_BASE+"/users/me/", timeout=10.0)
     if resp.status_code != 200:
         raise exceptions.AuthError("Invalid credentials trying to get "
                                    "user data:\n{}".format(resp.json()))
     else:
         logging.info("Successful authentication with token")
     json_resp = resp.json()
     self.authenticated = True
     data = json_resp['data']
     self.user_id = data['id']
     self.user_full_name = data['attributes']['full_name']
     # update stored tokens
     if save is None:
         save = self.remember_me
     if save and self.username is not None:
         tokens = TokenStorage()
         tokens[self.username] = token
         tokens.save()
开发者ID:psychopy,项目名称:pyosf,代码行数:30,代码来源:remote.py


示例14: __init__

    def __init__(self, port, verbose=None):
        super(PR650, self).__init__()
        if type(port) in (int, float):
            # add one so that port 1=COM1
            self.portNumber = port
            self.portString = 'COM%i' % self.portNumber
        else:
            self.portString = port
            self.portNumber = None
        self.isOpen = 0
        self.lastQual = 0
        self.type = 'PR650'
        self.com = False
        self.OK = True  # until we fail

        self.codes = {'OK': '000\r\n',  # this is returned after measure
                      '18': 'Light Low',  # returned at beginning of data
                      '10': 'Light Low',
                      '00': 'OK'}

        # try to open the port
        _linux = sys.platform.startswith('linux')
        if sys.platform in ('darwin', 'win32') or _linux:
            try:
                self.com = serial.Serial(self.portString)
            except Exception:
                msg = ("Couldn't connect to port %s. Is it being used by"
                       " another program?")
                self._error(msg % self.portString)
        else:
            msg = "I don't know how to handle serial ports on %s"
            self._error(msg % sys.platform)
        # setup the params for PR650 comms
        if self.OK:
            self.com.baudrate = 9600
            self.com.parity = 'N'  # none
            self.com.stopbits = 1
            try:
                # Pyserial >=2.6 throws an exception when trying to open a
                # serial port that is already open. Catching that exception
                # is not an option here because PySerial only defines a
                # single exception type (SerialException)
                if not self.com.isOpen():
                    self.com.open()
            except Exception:
                msg = "Opened serial port %s, but couldn't connect to PR650"
                self._error(msg % self.portString)
            else:
                self.isOpen = 1
        if self.OK:
            logging.info("Successfully opened %s" % self.portString)
            time.sleep(0.1)  # wait while establish connection
            # turn on the backlight as feedback
            reply = self.sendMessage(b'b1\n')
            if reply != self.codes['OK']:
                self._error("PR650 isn't communicating")

        if self.OK:
            # set command to make sure using right units etc...
            reply = self.sendMessage(b's01,,,,,,01,1')
开发者ID:flipphillips,项目名称:psychopy,代码行数:60,代码来源:pr.py


示例15: updatePthFile

    def updatePthFile(self, oldName, newName):
        """Searches site-packages for .pth files and replaces any instance of
        `oldName` with `newName`, where the names likely have the form PsychoPy-1.60.04
        """
        from distutils.sysconfig import get_python_lib

        siteDir = get_python_lib()
        pthFiles = glob.glob(os.path.join(siteDir, "*.pth"))
        enclosingSiteDir = os.path.split(siteDir)[
            0
        ]  # sometimes the site-packages dir isn't where the pth files are kept?
        pthFiles.extend(glob.glob(os.path.join(enclosingSiteDir, "*.pth")))
        nUpdates = 0  # no paths updated
        info = ""
        for filename in pthFiles:
            lines = open(filename, "r").readlines()
            needSave = False
            for lineN, line in enumerate(lines):
                if oldName in line:
                    lines[lineN] = line.replace(oldName, newName)
                    needSave = True
            if needSave:
                try:
                    f = open(filename, "w")
                    f.writelines(lines)
                    f.close()
                    nUpdates += 1
                    logging.info("Updated PsychoPy path in %s" % filename)
                except:
                    info += "Failed to update PsychoPy path in ", filename
                    return -1, info
        return nUpdates, info
开发者ID:harmadillo,项目名称:psychopy,代码行数:32,代码来源:connections.py


示例16: _versionFilter

def _versionFilter(versions, wxVersion):
    """Returns all versions that are compatible with the Python and WX running PsychoPy

    Parameters
    ----------
    versions: list
        All available (valid) selections for the version to be chosen

    Returns
    -------
    list
        All valid selections for the version to be chosen that are compatible with Python version used
    """

    # Get Python 3 Compatibility
    if constants.PY3:
        msg = _translate("Filtering versions of PsychoPy only compatible with Python 3.")
        logging.info(msg)
        versions = [ver for ver in versions if ver == 'latest' or parse_version(ver) >= parse_version('1.90')]

    # Get WX Compatibility
    compatibleWX = '4.0'
    if wxVersion is not None and parse_version(wxVersion) >= parse_version(compatibleWX):
        msg = _translate("wx version: {}. Filtering versions of "
                         "PsychoPy only compatible with wx >= version {}".format(wxVersion,
                                                                              compatibleWX))
        logging.info(msg)
        return [ver for ver in versions if ver == 'latest' or parse_version(ver) > parse_version('1.85.04')]
    return versions
开发者ID:dgfitch,项目名称:psychopy,代码行数:29,代码来源:versionchooser.py


示例17: _checkoutRequested

def _checkoutRequested(requestedVersion):
    """Look for a tag matching the request, return it if found
    or return None for the search.
    """
    # Check tag of repo
    if getCurrentTag() == requestedVersion:  # nothing to do!
        return 1

    # See if the tag already exists in repos (no need for internet)
    cmd = 'git tag'.split()
    versions = subprocess.check_output(cmd, cwd=VERSIONSDIR)
    if requestedVersion not in versions:
        # Grab new tags
        msg = "Couldn't find version %r locally. Trying github..."
        logging.info(msg % requestedVersion)
        cmd = 'git fetch github'.split()
        out = subprocess.check_output(cmd)
        # after fetching from github check if it's there now!
        versions = subprocess.check_output(['git', 'tag'], cwd=VERSIONSDIR)
        if requestedVersion not in versions:
            msg = "%r is not a valid version. Please choose one of:  %r"
            logging.error(msg % (requestedVersion, versions.split()))
            return 0

    # Checkout the requested tag
    cmd = 'git checkout %s' % requestedVersion
    out = subprocess.check_output(cmd.split(), stderr=subprocess.STDOUT,
                                  cwd=VERSIONSDIR)
    logging.debug(out)
    return 1
开发者ID:mry792,项目名称:psychopy,代码行数:30,代码来源:versionchooser.py


示例18: add_file

 def add_file(self, asset, update=False, new_path=None, threaded=False):
     """Adds the file to the OSF project.
     If containing folder doesn't exist then it will be created recursively
     update is used if the file already exists but needs updating (version
     will be incremented).
     """
     # get the url and local path
     local_path = asset['full_path']
     if new_path is None:
         new_path = asset['path']
     if update:
         url_upload = asset['links']['upload']
         logging.info("Updating file : {}".format(asset['path']))
     else:
         container, name = os.path.split(new_path)
         folder_asset = self.add_container(container)
         url_upload = folder_asset['links']['upload']
         if not url_upload.endswith("?kind=file"):
             url_upload += "?kind=file"
         url_upload += "&name={}".format(name)
         # do the upload
         logging.info("Uploading file {} to container:{}"
                      .format(name, folder_asset['path']))
     if 'size' in asset:
         size = asset['size']
     else:
         size = 0
     self.session.upload_file(url=url_upload, local_path=local_path,
                              size=size, threaded=threaded)
开发者ID:psychopy,项目名称:pyosf,代码行数:29,代码来源:remote.py


示例19: _checkout

def _checkout(requestedVersion):
    """Look for a Maj.min.patch requested version, download (fetch) if needed.
    """
    # Check tag of repo
    if currentTag() == requestedVersion:
        return requestedVersion

    # See if the tag already exists in repos
    if requestedVersion not in _localVersions(forceCheck=True):
        # Grab new tags
        msg = _translate("Couldn't find version {} locally. Trying github...")
        logging.info(msg.format(requestedVersion))
        subprocess.check_output('git fetch github'.split())
        # is requested here now? forceCheck to refresh cache
        if requestedVersion not in _localVersions(forceCheck=True):
            msg = _translate("{} is not currently available.")
            logging.error(msg.format(requestedVersion))
            return ''

    # Checkout the requested tag
    cmd = ['git', 'checkout', requestedVersion]
    out = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
                                  cwd=VERSIONSDIR)
    logging.debug(out)
    logging.exp('Success:  ' + ' '.join(cmd))
    return requestedVersion
开发者ID:DennisEckmeier,项目名称:psychopy,代码行数:26,代码来源:versionchooser.py


示例20: mode

 def mode(self, value):
     if value in [None, '']:
         self.__dict__['mode'] = ''
     elif ('mode' in self.__dict__) and value==self.mode:
         return #nothing to do here. Move along please
     elif value=='status':
         self.sendMessage('$statusScreen\r')
         self.__dict__['mode'] = 'status'
     elif 'storage' in value.lower():
         self.sendMessage('$USB_massStorage\r')
         self.__dict__['mode'] = 'massStorage'
         logging.info('Switched %s to %s mode' %(self.info['ProductType'], self.__dict__['mode']))
     elif value.startswith('bits'):
         self.sendMessage('$BitsPlusPlus\r')
         self.__dict__['mode'] = 'bits++'
         self.setLUT()
         logging.info('Switched %s to %s mode' %(self.info['ProductType'], self.__dict__['mode']))
     elif value.startswith('mono'):
         self.sendMessage('$monoPlusPlus\r')
         self.__dict__['mode'] = 'mono++'
         logging.info('Switched %s to %s mode' %(self.info['ProductType'], self.__dict__['mode']))
     elif value.startswith('colo'):
         self.sendMessage('$colorPlusPlus\r')
         self.__dict__['mode'] = 'color++'
         logging.info('Switched %s to %s mode' %(self.info['ProductType'], self.__dict__['mode']))
     elif value.startswith('auto'):
         self.sendMessage('$autoPlusPlus\r')
         self.__dict__['mode'] = 'auto++'
         logging.info('Switched %s to %s mode' %(self.info['ProductType'], self.__dict__['mode']))
开发者ID:alexholcombe,项目名称:psychopy,代码行数:29,代码来源:bits.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python logging.warn函数代码示例发布时间:2022-05-25
下一篇:
Python logging.flush函数代码示例发布时间:2022-05-25
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap