Skip to content

Commit

Permalink
perf: add more docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
loonghao committed Mar 13, 2022
1 parent 54d8c32 commit af244a3
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/bumpversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
- name: Create release Version
run: gh release create ${{ steps.cz.outputs.version }} --generate-notes
run: gh release create v${{ steps.cz.outputs.version }} --generate-notes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions photoshop/api/_documents.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

# pylint: disable=too-many-public-methods, too-many-arguments
class Documents(Photoshop):
"""The collection of open documents."""

def __init__(self, parent):
super().__init__(parent=parent)

Expand Down
2 changes: 2 additions & 0 deletions photoshop/api/_layerComp.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class LayerComp(Photoshop):
"""A snapshot of a state of the layers in a document (can be used to view different page layouts or compostions)."""

def __init__(self, parent):
super().__init__(parent=parent)

Expand Down
2 changes: 2 additions & 0 deletions photoshop/api/_layerComps.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@


class LayerComps(Photoshop):
"""The layer comps collection in this document."""

def __init__(self, parent):
super().__init__(parent=parent)

Expand Down
2 changes: 2 additions & 0 deletions photoshop/api/_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# pylint: disable=too-many-public-methods
class Layers(Photoshop):
"""The layers collection in the document."""

def __init__(self, parent):
super().__init__(parent=parent)

Expand Down
2 changes: 2 additions & 0 deletions photoshop/api/_measurement_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class MeasurementLog(Photoshop):
"""The log of measurements taken."""

def __init__(self, parent):
super().__init__(parent=parent)

Expand Down
8 changes: 5 additions & 3 deletions photoshop/api/_text_fonts.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@


class TextFonts(Photoshop):
"""An installed font."""

def __init__(self, parent=None):
super().__init__(parent=parent)

Expand All @@ -24,15 +26,15 @@ def length(self):
"""The number pf elements in the collection."""
return len(self._fonts)

def getByName(self, name):
def getByName(self, name: str) -> TextFont:
"""Gets the font by the font name.
Args:
name (str): The name of the font.
name: The name of the font.
Returns:
Font
font instance.
"""
for font in self.app:
Expand Down
7 changes: 7 additions & 0 deletions photoshop/api/action_descriptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@


class ActionDescriptor(Photoshop):
"""A record of key-value pairs for actions, such as those included on the Adobe Photoshop Actions menu.
The ActionDescriptor class is part of the Action Manager functionality.
For more details on the Action Manager, see the Photoshop Scripting Guide.
"""

object_name = "ActionDescriptor"

def __init__(self):
Expand Down
8 changes: 8 additions & 0 deletions photoshop/api/action_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@


class ActionList(Photoshop):
"""The list of commands that comprise an Action.
(such as an Action created using the Actions palette in the Adobe Photoshop application).
The action list object is part of the Action Manager functionality.
For details on using the Action Manager, see the Photoshop Scripting Guide.
"""

object_name = "ActionList"

def __init__(self, parent=None):
Expand Down
7 changes: 7 additions & 0 deletions photoshop/api/action_reference.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@


class ActionReference(Photoshop):
"""Contains data describing a referenced Action.
The action reference object is part of the Action Manager functionality.
For details on using the Action Manager, see the Photoshop Scripting Guide.
"""

object_name = "ActionReference"

def __init__(self, parent=None):
Expand Down
7 changes: 7 additions & 0 deletions photoshop/api/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,13 @@


class Application(Photoshop):
"""The Adobe Photoshop application object, which contains all other Adobe Photoshop objects.
This is the root of the object model, and provides access to all other objects.
To access the properties and methods, you can use the pre-defined global variable app.
"""

def __init__(self, version=None):
super().__init__(ps_version=version)

Expand Down
2 changes: 2 additions & 0 deletions photoshop/api/event_id.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class EventID(str, Enum):
"""All event ids."""

# Here is a list of JSON CallBack events in Photoshop.
# https://community.adobe.com/t5/get-started/photoshop-json-callback-events-list-up-to-cc2015-ver-16/td-p/4792115?page=1
TDTransform = "TdT "
Expand Down
5 changes: 3 additions & 2 deletions photoshop/api/solid_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
- Used in `Application.backgroundColor` and `foregroundColor` properties, in
`Channel.color`, in `ColorSampler.color`, and in `TextItem.color`
- Passed to `PathItem.fillPath()`, `Selection.fill()`, and
`Selection.stroke()`.
- Passed to `PathItem.fillPath()`, `Selection.fill()`, and `Selection.stroke()`.
"""

Expand All @@ -20,6 +19,8 @@


class SolidColor(Photoshop):
"""A color definition used in the document."""

object_name = "SolidColor"

def __init__(self, parent=None):
Expand Down
2 changes: 2 additions & 0 deletions photoshop/api/text_font.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@


class TextFont(Photoshop):
"""An installed font."""

def __init__(self, parent=None):
super().__init__(parent=parent)

Expand Down
2 changes: 2 additions & 0 deletions photoshop/api/text_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@


class TextItem(Photoshop):
"""The text that is associated with the layer. Valid only when ‘kind’ is text layer."""

object_name = "Application"

def __init__(self, parent):
Expand Down

0 comments on commit af244a3

Please sign in to comment.