Skip to content

Commit

Permalink
(closes #403) Added all missing __slots__.
Browse files Browse the repository at this point in the history
(Open since August 2014.)
  • Loading branch information
trevorbaca committed Jul 31, 2017
1 parent 3f13347 commit 81b3444
Show file tree
Hide file tree
Showing 139 changed files with 484 additions and 90 deletions.
5 changes: 5 additions & 0 deletions abjad/demos/part/PartCantusScoreTemplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ class PartCantusScoreTemplate(abctools.AbjadObject):
r'''Pärt Cantus score template.
'''

### CLASS VARIABLES ###

__slots__ = (
)

### SPECIAL METHODS ###

def __call__(self):
Expand Down
10 changes: 6 additions & 4 deletions abjad/scr/devel/find-slots-inconsistencies
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@ from __future__ import print_function
import inspect
import os
from abjad.tools import documentationtools
from abjad.tools import lilypondfiletools
from abjad.tools import systemtools
from abjad.tools.abctools import AbjadObject
from abjad.tools.documentationtools import InheritanceGraph


ignored_classes = (
lilypondfiletools.Block,
)

def shorten_class_name(abjad_class):
parts = abjad_class.__module__.split('.')[-2:]
return '{}.{}'.format(parts[0], parts[1])
Expand Down Expand Up @@ -38,7 +43,6 @@ def find_inconsistencies():
child_has_own_slots_def = child_slots_def is child
if parent_has_own_slots_def and not child_has_own_slots_def:
children_without_own_slots_def.append((parent, child))

if bad_arcs:
print('%d bad slots relationships found:' % len(bad_arcs))
generator = sorted(
Expand All @@ -54,7 +58,6 @@ def find_inconsistencies():
))
else:
print('No bad slots relationships found.')

if children_without_own_slots_def:
message = '{} children without own __slots__ definition found:'
message = message.format(len(children_without_own_slots_def))
Expand All @@ -72,11 +75,10 @@ def find_inconsistencies():
))
else:
print('No children without own __slots__ definition found.')

return graph


if __name__ == '__main__':
systemtools.IOManager.clear_terminal()
graph = find_inconsistencies()
print()
print()
3 changes: 3 additions & 0 deletions abjad/tools/abjadbooktools/AbjadBookScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ class AbjadBookScript(commandlinetools.CommandlineScript):

__documentation_section__ = 'Entry Points'

__slots__ = (
)

alias = 'book'
short_description = 'Preprocess LaTeX files with Abjad.'
version = 3.0
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/AbjDevScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class AbjDevScript(CommandlineScript):

short_description = 'Entry-point to Abjad developer scripts catalog.'

__slots__ = (
)

### SPECIAL METHODS ###

def __call__(self, arguments=None):
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/BuildApiScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class BuildApiScript(CommandlineScript):

### CLASS VARIABLES ###

__slots__ = (
)

class ExperimentalDocumentationManager(DocumentationManager):
r'''API generator for the experimental package.
'''
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/CheckClassSections.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ class CheckClassSections(CommandlineScript):

### CLASS VARIABLES ###

__slots__ = (
)

alias = 'check-class-sections'
short_description = (
'Check the order and contents of class sections in a path or file.'
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/CleanScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ class CleanScript(CommandlineScript):

### CLASS VARIABLES ###

__slots__ = (
)

alias = 'clean'
short_description = (
'Clean *.pyc, *.swp, .cache, __pycache__ and tmp* '
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/DoctestScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class DoctestScript(CommandlineScript):

### CLASS VARIABLES ###

__slots__ = (
)

_module_names_for_globs = (
'abjad',
'experimental',
Expand Down
9 changes: 9 additions & 0 deletions abjad/tools/commandlinetools/ManageBuildTargetScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ class ManageBuildTargetScript(ScorePackageScript):

### CLASS VARIABLES ###

__slots__ = (
'_build_path',
'_materials_path',
'_root_parent_path',
'_score_package_path',
'_score_repository_path',
'_segments_path',
)

alias = 'build'
short_description = 'Manage score package build targets.'

Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/ManageMaterialScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class ManageMaterialScript(ScorePackageScript):

### CLASS VARIABLES ###

__slots__ = (
)

alias = 'material'
short_description = 'Manage score package materials.'

Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/ManageScoreScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ class ManageScoreScript(ScorePackageScript):

### CLASS VARIABLES ###

__slots__ = (
)

alias = 'score'
short_description = 'Manage score packages.'

Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/ManageSegmentScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class ManageSegmentScript(ScorePackageScript):

### CLASS VARIABLES ###

__slots__ = (
)

alias = 'segment'
short_description = 'Manage score package segments.'

Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/ReplaceScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ class ReplaceScript(CommandlineScript):

### CLASS VARIABLES ###

__slots__ = (
)

alias = 'replace'
short_description = 'Replace text.'

Expand Down
11 changes: 11 additions & 0 deletions abjad/tools/commandlinetools/ScorePackageScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,17 @@ class ScorePackageScript(CommandlineScript):

### CLASS VARIABLES ###

__slots__ = (
'_build_path',
'_cwd',
'_distribution_path',
'_materials_path',
'_root_parent_path',
'_score_package_path',
'_score_repository_path',
'_segments_path',
)

_name_re = re.compile('^[a-z][a-z0-9_]*$')

### INITIALIZER ###
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/commandlinetools/StatsScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ class StatsScript(CommandlineScript):

### CLASS VARIABLES ###

__slots__ = (
)

alias = 'stats'
short_description = 'Build statistics about Python modules in PATH.'

Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/DocumentationManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ class DocumentationManager(abctools.AbjadObject):

__documentation_section__ = 'Documenters'

__slots__ = (
)

api_directory_name = 'api'

api_title = 'Abjad API'
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTAutodocDirective.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ class ReSTAutodocDirective(ReSTDirective):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### INITIALIZER ###

def __init__(
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTAutosummaryDirective.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class ReSTAutosummaryDirective(ReSTDirective):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### SPECIAL METHODS ###

def __setitem__(self, i, argument):
Expand Down
7 changes: 6 additions & 1 deletion abjad/tools/documentationtools/ReSTAutosummaryItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ class ReSTAutosummaryItem(TreeNode):

__documentation_section__ = 'reStructuredText'

__slots__ = (
'_text',
)

### INITIALIZER ###

def __init__(self, name=None, text='foo'):
TreeNode.__init__(self, name)
self.text = text
#self.text = text
self._text = text

### PRIVATE PROPERTIES ###

Expand Down
6 changes: 6 additions & 0 deletions abjad/tools/documentationtools/ReSTDirective.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ class ReSTDirective(TreeContainer):

__documentation_section__ = 'reStructuredText'

__slots__ = (
'_argument',
'_directive',
'_options',
)

### INITIALIZER ###

def __init__(
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTDocument.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ class ReSTDocument(TreeContainer):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### PRIVATE PROPERTIES ###

@property
Expand Down
4 changes: 4 additions & 0 deletions abjad/tools/documentationtools/ReSTGraphvizDirective.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ class ReSTGraphvizDirective(ReSTDirective):

__documentation_section__ = 'reStructuredText'

__slots__ = (
'_graph',
)

### INITIALIZER ###

def __init__(
Expand Down
11 changes: 9 additions & 2 deletions abjad/tools/documentationtools/ReSTHeading.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,19 @@ class ReSTHeading(TreeNode):

__documentation_section__ = 'reStructuredText'

__slots__ = (
'_level',
'_text',
)

### INITIALIZER ###

def __init__(self, level=0, name=None, text='foo'):
TreeNode.__init__(self, name=name)
self.level = level
self.text = text
#self.level = level
#self.text = text
self._level = level
self._text = text

### PRIVATE PROPERTIES ###

Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTHorizontalRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ class ReSTHorizontalRule(TreeNode):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### PRIVATE PROPERTIES ###

@property
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTInheritanceDiagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ class ReSTInheritanceDiagram(ReSTDirective):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### INITIALIZER ###

def __init__(self, argument=None, children=None, name=None, options=None):
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTLineageDirective.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class ReSTLineageDirective(ReSTDirective):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### INITIALIZER ###

def __init__(self, argument=None, children=None, name=None, options=None):
Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTOnlyDirective.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ class ReSTOnlyDirective(ReSTDirective):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### INITIALIZER ###

def __init__(self, argument=None, children=None, name=None):
Expand Down
11 changes: 9 additions & 2 deletions abjad/tools/documentationtools/ReSTParagraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,19 @@ class ReSTParagraph(TreeNode):

__documentation_section__ = 'reStructuredText'

__slots__ = (
'_text',
'_wrap',
)

### INITIALIZER ###

def __init__(self, name=None, text='foo', wrap=True):
TreeNode.__init__(self, name=name)
self.text = text
self.wrap = wrap
#self.text = text
#self.wrap = wrap
self._text = text
self._wrap = wrap

### PRIVATE PROPERTIES ###

Expand Down
3 changes: 3 additions & 0 deletions abjad/tools/documentationtools/ReSTTOCDirective.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,9 @@ class ReSTTOCDirective(ReSTDirective):

__documentation_section__ = 'reStructuredText'

__slots__ = (
)

### SPECIAL METHODS ###

def __setitem__(self, i, argument):
Expand Down
7 changes: 6 additions & 1 deletion abjad/tools/documentationtools/ReSTTOCItem.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ class ReSTTOCItem(TreeNode):

__documentation_section__ = 'reStructuredText'

__slots__ = (
'_text',
)

### INITIALIZER ###

def __init__(self, name=None, text='foo'):
TreeNode.__init__(self, name)
self.text = text
#self.text = text
self._text = text

### PRIVATE PROPERTIES ###

Expand Down
Loading

0 comments on commit 81b3444

Please sign in to comment.