本文整理匯總了Python中status.Status方法的典型用法代碼示例。如果您正苦於以下問題:Python status.Status方法的具體用法?Python status.Status怎麽用?Python status.Status使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類status
的用法示例。
在下文中一共展示了status.Status方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: start_up
# 需要導入模塊: import status [as 別名]
# 或者: from status import Status [as 別名]
def start_up(self):
"""
set the initial values of cpu registers
status reg: 000100 (irqs disabled)
x, y, a regs: 0
stack pointer: $FD
$4017: 0 (frame irq disabled)
$4015: 0 (sound channels disabled)
$4000-$400F: 0 (sound registers)
"""
# TODO Hex vs binary
self.pc_reg = np.uint16(0) # 2 byte
self.status_reg = Status()
self.sp_reg = np.uint8(0xFD)
self.x_reg = np.uint8(0)
self.y_reg = np.uint8(0)
self.a_reg = np.uint8(0)
# TODO implement memory sets
示例2: status
# 需要導入模塊: import status [as 別名]
# 或者: from status import Status [as 別名]
def status(self):
return Status()
示例3: parseRequest
# 需要導入模塊: import status [as 別名]
# 或者: from status import Status [as 別名]
def parseRequest(self, URL, artist=None, song=None):
"""Figure out what kind of download option the user wants"""
statusObject = Status()
ytdl_cmd_args = [] # append cmd arguments to this
print("BEING USED")
print("self.download(): parseRequest: YoutubeDLInteface")
self.download(URL, ytdl_cmd_args, statusObject)
#print statusObject.toDict()
return statusObject
#
# Params
# => URL : spotify uri, youtube playlist url, youtube song url
# => ytdl_cmd_args : optional youtube-dl command line arguments
# Returns
# => statusObject : only return if none is provided in function call
#
#
#
#####################
#
#
# ISSUE fix duplicate track error
# youtube-dl error occurs when you download a track with a filename that already exists
#
#####################
示例4: __init__
# 需要導入模塊: import status [as 別名]
# 或者: from status import Status [as 別名]
def __init__(self, ram: RAM, ppu: PPU, apu: APU):
self.ram = ram
self.ppu = ppu
self.apu = apu
self.rom = None
self.memory_owners = [ # type: List[MemoryOwnerMixin]
self.ram,
self.ppu,
self.apu
]
# instruction to execute
self.instruction = None
self.data_bytes = None
self.instruction_byte = None
# status registers: store a single byte
self.status_reg = None # type: Status
# counter registers: store a single byte
self.pc_reg = None # program counter, 2 byte
self.sp_reg = None # stack pointer
self.stack_offset = 0x100
# data registers: store a single byte
self.x_reg = None # x register
self.y_reg = None # y register
self.a_reg = None # a register
# program counter stores current execution point
self.running = True
# create the instructions that the cpu can interpret
instructions_list = self._find_instructions(Instruction)
self.instructions = {}
for instruction in instructions_list:
if instruction.identifier_byte in self.instructions.keys():
raise Exception('Duplicate instruction identifier bytes')
self.instructions[instruction.identifier_byte] = instruction
示例5: parse_status
# 需要導入模塊: import status [as 別名]
# 或者: from status import Status [as 別名]
def parse_status(self, lines):
# A list of status objects.
activity = []
# Keep a list of seen times so we can avoid duplicates in the history
seen_times = set()
for line in lines:
time, fields = line.split("|")
# Only add new times, preferring earlier records in the file. This is probably not optimal since later records seem to be more likely to be LATs, but oh well gotta break a few algorithmic contraints to make a BILLION dollars.
if time not in seen_times:
seen_times.add(time)
status_obj = status.Status(int(float(time)), fields)
activity.append(status_obj)
return activity