Ticket #950 (new defect)

Opened 7 months ago

sort codebase into sectioned blocks

Reported by: ArcRiley Owned by: ArcRiley
Priority: Medium Milestone: beta3
Component: unknown Version: Trunk
Keywords: Cc:

Description

Code should be sorted into the following sections (and possible more):

Python functions Properties General C functions WindowLoop functions TransportLoop functions SceneLoop functions

These should be in order using the same comment blocks found in soy.actions (and elsewhere). One empty line after the class pydocs, two empty lines before each section, one empty line between the section start and first def/cdef/property, two blank lines between all classes.

In most cases these functions/properties should be in alphabetical order within their section, especially when there are many of them.

C functions can usually be tracked to what calls them - if they're called from many things they're General, if they're called only by cdefs in a specific section or from one of the loops they're in that section.

This strict formatting is aimed at making search/replace functions easier and overall more readable.

IE:

cdef class Foo (Bar) :
  '''soy.foos.Foo

    This is the Foo class.  It makes people happy.
  '''

  ############################################################################

  #

  # Python functions

  #



  def __cinit__(self) :
    self._fooID = 0


  ############################################################################

  #

  # Properties
  #



  property size :
    def __get__(self) :
      return (self._width, self._height)


  ############################################################################
  #
  # General C functions
  #

  cdef void _resize(self, _width, _height) :
    self._width  = _width
    self._height = _height
Note: See TracTickets for help on using tickets.