fretwork package

Submodules

fretwork.audio module

fretwork.log module

Logging module

Usage

Configure the logger in your launcher:

from fretwork import log

# configure the logger
log.configure('file.log', logging.DEBUG)

Import and use it:

import logging

logger = logging.getLogger(__name__)
fretwork.log.configure(log_filename, log_level=20)

Configure logging.

Parameters:
  • log_filename – name of the file where logs are saved.
  • log_level – level of logs (default: logging.INFO).

fretwork.task module ++++++++++++++++++++-

class fretwork.task.Task
run(ticks)
started()
stopped()
class fretwork.task.TaskEngine(engine)
addTask(task, synced=True)

Add a task

checkTask(task)

Check if a task exists

exit()

Remove all tasks

pauseTask(task)

Pause a task

removeTask(task)

Remove a task

resumeTask(task)

Resume a paused task

run()

Run one cycle of the task scheduler engine

runTask(task, tick=0)

fretwork.timer module

class fretwork.timer.FpsTimer

Bases: fretwork.timer.Timer

delay(fps)

Reimplementation of pygame.time.Clock.tick() delay functionality. Needed for fps limiting

get_fps()

Calculates and return the average fps then resets the counter

tick()

Calculates time delta since last call. Also accumulates the delta and increments frame counter.

class fretwork.timer.Timer
delta_time()

Return time delta since startTime

tick()

Return the delta between the current and previous ticks

time()

Get current time in milliseconds

fretwork.unicode module

Miscellaneous functions for helping us handle Unicode correctly in the face of what we’ve done in the past.

fretwork.unicode.unicodify(s)

Return a unicode string

fretwork.unicode.utf8(s)

Return a valid UTF-8 bytestring

fretwork.version module