GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — move the src/data validation into the main conditional · plotdevice/plotdevice@07ad3a9

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • plotdevice/gfx
    • image.py
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎plotdevice/gfx/image.py‎

Copy file name to clipboardExpand all lines: plotdevice/gfx/image.py
+3-4Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,6 @@ def __init__(self, *args, **kwargs):
6363
elif args and args[0] is None:
6464
args.pop(0) # make image(None, 10,20, image=...) work properly for compat
6565

66-
# Validate that we have either a source or data
67-
if not (src or data):
68-
raise DeviceError("Image requires either a source (path/url/Image) or image data")
69-
7066
# get an NSImage reference (once way or another)
7167
if data:
7268
self._nsImage = self._lazyload(data=data)
@@ -81,6 +77,9 @@ def __init__(self, *args, **kwargs):
8177
else:
8278
invalid = "Not a valid image source: %r" % type(src)
8379
raise DeviceError(invalid)
80+
else:
81+
undefined = "Image requires either a source (path/url/Image) or image data"
82+
raise DeviceError(undefined)
8483

8584
# set the bounds (in phases)
8685
if isinstance(src, Image):

0 commit comments

Comments
0 (0)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.