Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
1d06b682
Commit
1d06b682
authored
Dec 17, 1997
by
Jim Fulton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
3f433001
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
lib/python/ImageFile.py
lib/python/ImageFile.py
+33
-0
lib/python/Setup
lib/python/Setup
+1
-0
No files found.
lib/python/ImageFile.py
0 → 100755
View file @
1d06b682
"""Image object that is stored in a file"""
__version__
=
'$Revision: 1.1 $'
[
11
:
-
2
]
from
string
import
rfind
from
Globals
import
package_home
class
ImageFile
:
"""Image object stored in an external file"""
def
__init__
(
self
,
path
,
_prefix
=
None
):
if
_prefix
is
None
:
_prefix
=
SOFTWARE_HOME
+
'/lib/python'
elif
type
(
_prefix
)
is
not
type
(
''
):
_prefix
=
package_home
(
_prefix
)
path
=
'%s/%s'
%
(
_prefix
,
path
)
self
.
path
=
path
self
.
content_type
=
'image/%s'
%
path
[
rfind
(
path
,
'.'
)
+
1
:]
self
.
__name__
=
path
[
rfind
(
path
,
'/'
)
+
1
:]
def
index_html
(
self
,
RESPONSE
):
"""Default document"""
RESPONSE
[
'content-type'
]
=
self
.
content_type
f
=
open
(
self
.
path
)
data
=
f
.
read
()
f
.
close
()
return
data
def
__len__
(
self
):
# This is bogus and needed because of the way Python tests truth.
return
1
def
__str__
(
self
):
return
'<IMG SRC="%s" ALT="%s">'
%
(
self
.
__name__
,
self
.
title_or_id
())
lib/python/Setup
View file @
1d06b682
*shared*
# install Main.py
# install Globals.py
# install ImageFile.py
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment