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

Python mgi_utils.date函数代码示例

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

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



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

示例1: init

def init():
	#
	# requires: 
	#
	# effects: 
	# 1. Processes command line options
	# 2. Initializes global file descriptors/file names
	#
	# returns:
	#
 
    global diagFile, errorFile
 
    db.useOneConnection(1)
 
    try:
	diagFile = open(diagFileName, 'w')
    except:
	exit(1, 'Could not open file %s\n' % diagFileName)
		
    try:
	errorFile = open(errorFileName, 'w')
    except:
	exit(1, 'Could not open file %s\n' % errorFileName)
		
    # Log all SQL
    db.set_sqlLogFunction(db.sqlLogAll)

    # Set Log File Descriptor
    db.set_sqlLogFD(diagFile)

    diagFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
    errorFile.write('Start Date/Time: %s\n\n' % (mgi_utils.date()))
开发者ID:mgijax,项目名称:unistsload,代码行数:33,代码来源:unistsanalysis.py


示例2: init

def init():
	#
	# requires: 
	#
	# effects: 
	# 1. Processes command line options
	# 2. Initializes global file descriptors/file names
	#
	# returns:
	#
 
    global diagFile, errorFile, diagFileName, errorFileName
 
    try:
	diagFile = open(diagFileName, 'w')
    except:
	exit(1, 'Could not open file %s\n' % diagFileName)
		
    try:
	errorFile = open(errorFileName, 'w')
    except:
	exit(1, 'Could not open file %s\n' % errorFileName)
		
    diagFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
    errorFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
开发者ID:mgijax,项目名称:unistsload,代码行数:25,代码来源:unistsparse.py


示例3: exit

def exit(status, message = None):
	'''
	# requires: status, the numeric exit status (integer)
	#           message (string)
	#
	# effects:
	# Print message to stderr and exits
	#
	# returns:
	#
	'''
 
	if message is not None:
		sys.stderr.write('\n' + str(message) + '\n')
 
	try:
		inputFile.close()
		outputFile.close()
		diagFile.write('\n\nEnd Date/Time: %s\n' % (mgi_utils.date()))
		errorFile.write('\n\nEnd Date/Time: %s\n' % (mgi_utils.date()))
		diagFile.close()
		errorFile.close()
	except:
		pass

	db.useOneConnection()
	sys.exit(status)
开发者ID:mgijax,项目名称:translationload,代码行数:27,代码来源:genbankparse.py


示例4: init

def init():
	'''
	# requires: 
	#
	# effects: 
	# 1. Processes command line options
	# 2. Initializes local DBMS parameters
	# 3. Initializes global file descriptors/file names
	# 4. Initializes global keys
	#
	# returns:
	#
	'''
 
	global inputFile, outputFile, diagFile, errorFile, errorFileName, diagFileName
 
	db.useOneConnection(1)
        db.set_sqlUser(user)
        db.set_sqlPasswordFromFile(passwordFileName)
 
	diagFileName = inputFileName + '.diagnostics'
	errorFileName = inputFileName + '.error'
 	outputFileName = inputFileName + '.trans'

	try:
		inputFile = open(inputFileName, 'r')
	except:
		exit(1, 'Could not open file %s\n' % inputFileName)
		
	try:
		diagFile = open(diagFileName, 'w')
	except:
		exit(1, 'Could not open file %s\n' % diagFileName)
		
	try:
		errorFile = open(errorFileName, 'w')
	except:
		exit(1, 'Could not open file %s\n' % errorFileName)
		
	try:
		outputFile = open(outputFileName, 'w')
	except:
		exit(1, 'Could not open file %s\n' % outputFileName)
		
	# Log all SQL
	db.set_sqlLogFunction(db.sqlLogAll)

	# Set Log File Descriptor
	db.set_sqlLogFD(diagFile)

	diagFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
        diagFile.write('Server: %s\n' % (db.get_sqlServer()))
        diagFile.write('Database: %s\n' % (db.get_sqlDatabase()))
	diagFile.write('Input File: %s\n' % (inputFileName))
	diagFile.write('Output File: %s\n' % (outputFileName))

	errorFile.write('Start Date/Time: %s\n\n' % (mgi_utils.date()))
开发者ID:mgijax,项目名称:translationload,代码行数:57,代码来源:genbankparse.py


示例5: init

def init():
        # requires: 
        #
        # effects: 
        # 1. Processes command line options
        # 2. Initializes local DBMS parameters
        # 3. Initializes global file descriptors/file names
        # 4. Initializes global keys
        #
        # returns:
        #

    global diagFile, errorFile, inputFile, errorFileName, diagFileName
    global strainFile
 
    db.useOneConnection(1)
    db.set_sqlUser(user)
    db.set_sqlPasswordFromFile(passwordFileName)
 
    fdate = mgi_utils.date('%m%d%Y')	# current date
    head, tail = os.path.split(inputFileName) 
    diagFileName = tail + '.' + fdate + '.diagnostics'
    errorFileName = tail + '.' + fdate + '.error'

    try:
        diagFile = open(diagFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % diagFileName)
		
    try:
        errorFile = open(errorFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % errorFileName)
		
    try:
        inputFile = open(inputFileName, 'r')
    except:
        exit(1, 'Could not open file %s\n' % inputFileName)

    try:
        strainFile = open(strainFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % strainFileName)

    # Log all SQL
    db.set_sqlLogFunction(db.sqlLogAll)

    # Set Log File Descriptor
    db.set_sqlLogFD(diagFile)

    diagFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
    diagFile.write('Server: %s\n' % (db.get_sqlServer()))
    diagFile.write('Database: %s\n' % (db.get_sqlDatabase()))

    errorFile.write('Start Date/Time: %s\n\n' % (mgi_utils.date()))

    return
开发者ID:mgijax,项目名称:strainload,代码行数:57,代码来源:strainalleleload.py


示例6: init

def init():
    global bcpCommand
    global diagFile, errorFile, inputFile, errorFileName, diagFileName
    global markerFile, refFile, aliasFile
 
    db.useOneConnection(1)
    db.set_sqlUser(user)
    db.set_sqlPasswordFromFile(passwordFileName)
 
    bcpCommand = bcpCommand + db.get_sqlServer() + ' ' + db.get_sqlDatabase() + ' %s ' + currentDir + ' %s "\\t" "\\n" mgd'

    head, tail = os.path.split(inputFileName) 

    diagFileName = outputDir + '/' + tail + '.diagnostics'
    errorFileName = outputDir + '/' + tail + '.error'

    try:
        diagFile = open(diagFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % diagFileName)
		
    try:
        errorFile = open(errorFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % errorFileName)
		
    try:
        inputFile = open(inputFileName, 'r')
    except:
        exit(1, 'Could not open file %s\n' % inputFileName)

    try:
        markerFile = open(markerFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % markerFileName)

    try:
        refFile = open(refFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % refFileName)

    try:
        aliasFile = open(aliasFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % aliasFileName)

    # Log all SQL
    db.set_sqlLogFunction(db.sqlLogAll)

    diagFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
    diagFile.write('Server: %s\n' % (db.get_sqlServer()))
    diagFile.write('Database: %s\n' % (db.get_sqlDatabase()))

    errorFile.write('Start Date/Time: %s\n\n' % (mgi_utils.date()))

    return
开发者ID:mgijax,项目名称:probeload,代码行数:56,代码来源:probeextras.py


示例7: createExcluded

def createExcluded():

    excludeNote = 'The source of the material used to create this cDNA probe was different than that used to create the GenBank sequence record.'

    print 'excluded begin...%s' % (mgi_utils.date())
    db.sql('''select _Probe_key INTO TEMPORARY TABLE excluded from PRB_Notes 
	where note like 'The source of the material used to create this cDNA probe was different%'
	''', None)
    db.sql('create index idx1 on excluded(_Probe_key)', None)
    print 'excluded end...%s' % (mgi_utils.date())
开发者ID:mgijax,项目名称:seqcacheload,代码行数:10,代码来源:seqprobe.py


示例8: init

def init():
    '''
    # requires: 
    #
    # effects: 
    # 1. Processes command line options
    # 2. Initializes local DBMS parameters
    # 3. Initializes global file descriptors/file names
    #
    # returns:
    #
    '''

    global inputFile, outputFile, diagFile, errorFile
    global inputFileName, errorFileName, diagFileName, outputFileName

    try:
	inputFile = open(inputFileName, 'r')
    except:
	exit(1, 'Could not open file %s\n' % inputFileName)
	    
    try:
	diagFile = open(diagFileName, 'w+')
    except:
	exit(1, 'Could not open file %s\n' % diagFileName)
	    
    try:
	errorFile = open(errorFileName, 'w')
    except:
	exit(1, 'Could not open file %s\n' % errorFileName)
	    
    try:
	outputFile = open(outputFileName, 'w')
    except:
	exit(1, 'Could not open file %s\n' % outputFileName)
	    
    # Log all SQL 
    db.set_sqlLogFunction(db.sqlLogAll)

    # Set Log File Descriptor
    db.set_commandLogFile(diagFileName)

    # Set Log File Descriptor
    diagFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
    diagFile.write('Server: %s\n' % (db.get_sqlServer()))
    diagFile.write('Database: %s\n' % (db.get_sqlDatabase()))
    diagFile.write('Input File: %s\n' % (inputFileName))
    errorFile.write('\nStart file: %s\n\n' % (mgi_utils.date()))
开发者ID:mgijax,项目名称:genemodelload,代码行数:48,代码来源:biotypemapping.py


示例9: init

def init():
    global inFile, provider, bcpFilePath, bcpFile

    print '%s' % mgi_utils.date()
    print 'Initializing'

    inFile = sys.stdin
    if len(sys.argv) != 2:
            print Usage
            sys.exit(1)

    provider = sys.argv[1]
    try:
        bcpFilePath = os.environ['BCP_FILE_PATH']
        bcpFile = open(bcpFilePath, 'w')
    except:
        'Could not open file for writing %s\n' % bcpFilePath
        sys.exit(1)

    if provider == 'ensembl':
        loadEnsemblRawBioTypeByGMIDLookup()

    elif provider == 'ncbi':
        loadNCBIRawBioTypeByGMIDLookup()

    else:
        'Provider not recognized: %s' % provider
        sys.exit(1)
    loadSequenceKeyLookup()
    loadMarkerTypeKeyLookup()
开发者ID:mgijax,项目名称:genemodelload,代码行数:30,代码来源:seqgenemodelload.py


示例10: init

def init():
    # Purpose: initialize file descriptors, create connection to
    #  the database and load lookups
    # Returns: nothing
    # Assumes: nothing
    # Effects: gives SQL commands to the database
    # Throws: nothing
    global inFile, outFile, nextKey

    print '%s' % mgi_utils.date()
    print 'Initializing'
   
    db.useOneConnection(1)
    db.set_sqlLogin(user, password, mgdServer, mgdDB)
 
    results = db.sql('''select max(_Assoc_key) + 1 as nextKey from %s''' % table, 'auto')
    nextKey = results[0]['nextKey']
    if nextKey == None:
	nextKey = 1001

    inFilePath = os.environ['INFILE_NAME']
    try:
	inFile = open(inFilePath, 'r')
    except:
	exit('Could not open file for reading %s\n' % inFilePath)

    outFilePath = '%s/%s.bcp' % (os.environ['OUTPUTDIR'],  table)
    try:
	outFile = open(outFilePath, 'w')
    except:
        exit('Could not open file for writing %s\n' % outFilePath)

    loadLookups()
开发者ID:mgijax,项目名称:seqseqassocload,代码行数:33,代码来源:seqseqassocload.py


示例11: run

def run():
    # Purpose: iterate through the input file, resolving to keys
    #  and writing to a bcp file
    # Returns: nothing
    # Assumes: inFile and outFile are valid file descriptors
    # Effects: writes to the file system
    # Throws: nothing

    global nextKey
    print '%s' % mgi_utils.date()
    print 'Creating bcp file'
    for line in inFile.readlines():
        (seqId1, qualifier, seqId2) = string.split(line, TAB)
	seqId1 = string.strip(seqId1)
	qualifier = string.strip(qualifier)
	seqId2 = string.strip(seqId2)
        if seq1Lookup.has_key(seqId1):
	    seqKey1 = seq1Lookup[seqId1]
	else:
	    print 'SeqId1 %s is not in the database' % seqId1
	    continue
	if qualLookup.has_key(qualifier):
	    qualKey = qualLookup[qualifier]
	else:
	    print 'Qualifier %s is not in the database' % qualifier
	    continue 
 	if seq2Lookup.has_key(seqId2):
	    seqKey2 = seq2Lookup[seqId2]
	else:
            print 'SeqId2 %s is not in the database' % seqId2
	    continue
	outFile.write('%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s' % \
	    (nextKey, TAB, seqKey1, TAB, qualKey, TAB, seqKey2, \
		TAB, CREATEDBY_KEY, TAB, CREATEDBY_KEY, TAB, cdate, TAB, cdate, CRT))
	nextKey = nextKey + 1
开发者ID:mgijax,项目名称:seqseqassocload,代码行数:35,代码来源:seqseqassocload.py


示例12: exit

def exit(
    status,          # numeric exit status (integer)
    message = None   # exit message (string)
    ):

    # Purpose:
    # Returns: nothing
    # Assumes: nothing
    # Effects: nothing
    # Throws: nothing

    if message is not None:
        sys.stderr.write('\n' + str(message) + '\n')
 
    try:
        diagFile.write('\n\nEnd Date/Time: %s\n' % (mgi_utils.date()))
        diagFile.close()
    except:
        pass

    try:
        reportlib.finish_nonps(reportFile)
    except:
	pass

    db.useOneConnection(0)
    sys.exit(status)
开发者ID:mgijax,项目名称:vocload,代码行数:27,代码来源:GOremoveannot.py


示例13: exit

def exit(status, message = None):
	'''
	# requires: status, the numeric exit status (integer)
	#           message (string)
	#
	# effects:
	# Print message to stderr and exits
	#
	# returns:
	#
	'''
 
	if message is not None:
		sys.stderr.write('\n' + str(message) + '\n')
 
	try:
                diagFile.write('\n\nEnd Date/Time: %s\n' % (mgi_utils.date()))
		diagFile.close()
		accFile.close()
		accrefFile.close()
		markerFile.close()
	except:
		pass

	sys.exit(status)
开发者ID:mgijax,项目名称:entrezgeneload,代码行数:25,代码来源:accids.py


示例14: exit

def exit(
    status,          # numeric exit status (integer)
    message = None   # exit message (string)
    ):

    if message is not None:
        sys.stderr.write('\n' + str(message) + '\n')
 
    try:
        diagFile.write('\n\nEnd Date/Time: %s\n' % (mgi_utils.date()))
        errorFile.write('\n\nEnd Date/Time: %s\n' % (mgi_utils.date()))
        diagFile.close()
        errorFile.close()
    except:
        pass

    db.useOneConnection(0)
    sys.exit(status)
开发者ID:mgijax,项目名称:setload,代码行数:18,代码来源:setload.py


示例15: deleteByUser

def deleteByUser():
    # Purpose: delete records created by current load
    # Returns: nothing
    # Assumes: a connection has been made to the database
    # Effects: deletes records from a database
    # Throws: nothing

    print '%s' % mgi_utils.date()
    print 'Deleting records for this user'
    db.sql('''delete from %s where _CreatedBy_key = %s''' % (table, CREATEDBY_KEY), None)
    db.commit()
开发者ID:mgijax,项目名称:seqseqassocload,代码行数:11,代码来源:seqseqassocload.py


示例16: createBCP

def createBCP():

	outBCP = open('%s/%s.bcp' % (datadir, table), 'w')

	print 'sequences1 begin...%s' % (mgi_utils.date())
	db.sql('''select s._Object_key as sequenceKey, p._Object_key as probeKey, p._Accession_key 
		INTO TEMPORARY TABLE sequences1 
		from ACC_Accession s, ACC_Accession p 
		where s._MGIType_key = 19 
		and lower(s.accID) = lower(p.accID) 
		and p._MGIType_key = 3 
		and s._LogicalDB_key = p._LogicalDB_key
		''', None)
	db.sql('create index idx2 on sequences1 (sequenceKey)', None)
	db.sql('create index idx3 on sequences1 (probeKey)', None)
	db.sql('create index idx4 on sequences1 (_Accession_key)', None)
	print 'sequences1 end...%s' % (mgi_utils.date())

	print 'deletion begin...%s' % (mgi_utils.date())
	db.sql('delete from sequences1 using excluded e where sequences1.probeKey = e._Probe_key', None)
	print 'deletion end...%s' % (mgi_utils.date())
	db.commit()

	print 'sequences2 begin...%s' % (mgi_utils.date())
	db.sql('''select s.sequenceKey, s.probeKey, ar._Refs_key as refskey, 
			ar._ModifiedBy_key as userKey, ar.modification_date as mdate 
		INTO TEMPORARY TABLE sequences2 
		from sequences1 s, ACC_AccessionReference ar 
		where s._Accession_key = ar._Accession_key
		''', None)
	db.sql('create index idx5 on sequences2 (sequenceKey, probeKey, refsKey, userKey, mdate)', None)
	db.sql('create index idx6 on sequences2 (userKey)', None)
	db.sql('create index idx7 on sequences2 (mdate)', None)
	print 'sequences2 end...%s' % (mgi_utils.date())

	print 'final begin...%s' % (mgi_utils.date())
	results = db.sql('''select distinct sequenceKey, probeKey, refsKey, 
		max(userKey) as userKey, max(mdate) as mdate 
		from sequences2 
		group by sequenceKey, probeKey, refsKey
		''', 'auto')
	print 'final end...%s' % (mgi_utils.date())

	for r in results:
		outBCP.write(mgi_utils.prvalue(r['sequenceKey']) + DL + \
		       	mgi_utils.prvalue(r['probeKey']) + DL + \
		       	mgi_utils.prvalue(r['refsKey']) + DL + \
			r['mdate'] + DL + \
        		mgi_utils.prvalue(r['userKey']) + DL + mgi_utils.prvalue(r['userKey']) + DL + \
			loaddate + DL + loaddate + NL)
	outBCP.close()
开发者ID:mgijax,项目名称:seqcacheload,代码行数:51,代码来源:seqprobe.py


示例17: priority2

def priority2():

	# allele names

        print 'processing priority 2...%s' % mgi_utils.date()

	cmd = '''select distinct a._Allele_key, a.name as label 
		 from ALL_Allele a where a.isWildType = 0 
	      '''

	if alleleKey is not None:
		cmd = cmd + 'and a._Allele_key = %s\n' % alleleKey

	writeRecord(db.sql(cmd, 'auto'), 1, 2, 'AN', 'allele name')
开发者ID:mgijax,项目名称:allcacheload,代码行数:14,代码来源:alllabel.py


示例18: init

def init():
    global diagFile, errorFile, inputFile, errorFileName, diagFileName
 
    db.useOneConnection(1)
    db.set_sqlUser(user)
    db.set_sqlPasswordFromFile(passwordFileName)
 
    head, tail = os.path.split(inputFileName) 

    diagFileName = outputDir + '/' + tail + '.diagnostics'
    errorFileName = outputDir + '/' + tail + '.error'

    try:
        diagFile = open(diagFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % diagFileName)
		
    try:
        errorFile = open(errorFileName, 'w')
    except:
        exit(1, 'Could not open file %s\n' % errorFileName)
		
    try:
        inputFile = open(inputFileName, 'r')
    except:
        exit(1, 'Could not open file %s\n' % inputFileName)

    # Log all SQL
    db.set_sqlLogFunction(db.sqlLogAll)

    diagFile.write('Start Date/Time: %s\n' % (mgi_utils.date()))
    diagFile.write('Server: %s\n' % (db.get_sqlServer()))
    diagFile.write('Database: %s\n' % (db.get_sqlDatabase()))

    errorFile.write('Start Date/Time: %s\n\n' % (mgi_utils.date()))

    return
开发者ID:mgijax,项目名称:probeload,代码行数:37,代码来源:probedelete.py


示例19: priority3

def priority3():

	# synonyms

        print 'processing priority 3...%s' % mgi_utils.date()

	cmd = '''select distinct s._Object_key as _Allele_key, s.synonym as label
		from MGI_SynonymType st, MGI_Synonym s 
		where st._MGIType_key = 11 
		and st._SynonymType_key = s._SynonymType_key 
		'''

	if alleleKey is not None:
		cmd = cmd + 'and s._Object_key = %s\n' % alleleKey

	writeRecord(db.sql(cmd, 'auto'), 1, 3, 'AY', 'synonym')
开发者ID:mgijax,项目名称:allcacheload,代码行数:16,代码来源:alllabel.py


示例20: writeRecord

def writeRecord(results, labelStatusKey, priority, labelType, labelTypeName):

    for r in results:

	if labelTypeName is None:
	    labelTypeName = r['labelTypeName']

        outBCP.write(mgi_utils.prvalue(r['_Allele_key']) + COLDL + \
        	mgi_utils.prvalue(labelStatusKey) + COLDL + \
        	mgi_utils.prvalue(priority) + COLDL + \
        	mgi_utils.prvalue(r['label']) + COLDL + \
        	mgi_utils.prvalue(labelType) + COLDL + \
        	mgi_utils.prvalue(labelTypeName) + COLDL + \
        	loaddate + COLDL + \
        	loaddate + LINEDL)

    print 'processed (%d) records...%s' % (len(results), mgi_utils.date())
开发者ID:mgijax,项目名称:allcacheload,代码行数:17,代码来源:alllabel.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python gui.InputFormDescr类代码示例发布时间:2022-05-27
下一篇:
Python tests.DataHandler类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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