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
3b64fa0a
Commit
3b64fa0a
authored
Aug 14, 1998
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Readded Find support that got overwritten somehow
parent
12d7d6f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
37 additions
and
12 deletions
+37
-12
lib/python/OFS/CopySupport.py
lib/python/OFS/CopySupport.py
+21
-8
lib/python/OFS/FindSupport.py
lib/python/OFS/FindSupport.py
+12
-1
lib/python/OFS/Folder.py
lib/python/OFS/Folder.py
+4
-3
No files found.
lib/python/OFS/CopySupport.py
View file @
3b64fa0a
__doc__
=
"""Copy interface"""
__version__
=
'$Revision: 1.1
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
9
$'
[
11
:
-
2
]
import
sys
,
Globals
,
Moniker
,
rPickle
,
tempfile
from
cPickle
import
loads
,
dumps
import
sys
,
Globals
,
Moniker
,
tempfile
from
marshal
import
loads
,
dumps
from
urllib
import
quote
,
unquote
from
zlib
import
compress
,
decompress
from
App.Dialogs
import
MessageDialog
...
...
@@ -24,7 +25,7 @@ class CopyContainer:
m
=
Moniker
.
Moniker
(
ob
)
oblist
.
append
((
m
.
jar
,
m
.
ids
))
cp
=
(
1
,
oblist
)
cp
=
quote
(
dumps
(
cp
)
)
cp
=
_cb_encode
(
cp
)
if
REQUEST
is
not
None
:
resp
=
REQUEST
[
'RESPONSE'
]
resp
.
setCookie
(
'__cp'
,
cp
,
path
=
'%s'
%
REQUEST
[
'SCRIPT_NAME'
])
...
...
@@ -43,7 +44,7 @@ class CopyContainer:
m
=
Moniker
.
Moniker
(
ob
)
oblist
.
append
((
m
.
jar
,
m
.
ids
))
cp
=
(
0
,
oblist
)
cp
=
quote
(
dumps
(
cp
)
)
cp
=
_cb_encode
(
cp
)
if
REQUEST
is
not
None
:
resp
=
REQUEST
[
'RESPONSE'
]
resp
.
setCookie
(
'__cp'
,
cp
,
path
=
'%s'
%
REQUEST
[
'SCRIPT_NAME'
])
...
...
@@ -64,7 +65,7 @@ class CopyContainer:
if
cp
is
None
:
raise
CopyError
,
eNoData
try
:
cp
=
rPickle
.
loads
(
unquote
(
cp
)
)
try
:
cp
=
_cb_decode
(
cp
)
except
:
raise
CopyError
,
eInvalid
oblist
=
[]
...
...
@@ -176,12 +177,12 @@ class CopyContainer:
def
cb_dataValid
(
self
):
# Return true if clipboard data seems valid.
try
:
data
=
rPickle
.
loads
(
unquote
(
self
.
REQUEST
[
'__cp'
])
)
try
:
cp
=
_cb_decode
(
self
.
REQUEST
[
'__cp'
]
)
except
:
return
0
return
1
def
cb_dataItems
(
self
):
try
:
cp
=
rPickle
.
loads
(
unquote
(
self
.
REQUEST
[
'__cp'
])
)
try
:
cp
=
_cb_decode
(
self
.
REQUEST
[
'__cp'
]
)
except
:
return
[]
oblist
=
[]
m
=
Moniker
.
Moniker
()
...
...
@@ -305,6 +306,15 @@ def _get_id(ob, id):
def
_cb_encode
(
d
):
return
quote
(
compress
(
dumps
(
d
),
9
))
def
_cb_decode
(
s
):
return
loads
(
decompress
(
unquote
(
s
)))
fMessageDialog
=
Globals
.
HTML
(
"""
<HTML>
<HEAD>
...
...
@@ -372,6 +382,9 @@ eNotSupported=fMessageDialog(
##############################################################################
#
# $Log: CopySupport.py,v $
# Revision 1.19 1998/08/14 20:54:44 brian
# Readded Find support that got overwritten somehow
#
# Revision 1.18 1998/08/14 16:46:35 brian
# Added multiple copy, paste, rename
#
...
...
lib/python/OFS/FindSupport.py
View file @
3b64fa0a
__doc__
=
"""Principia Find support"""
__version__
=
'$Revision: 1.
2
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
3
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
time
,
Globals
from
DocumentTemplate.DT_Util
import
Eval
,
expr_globals
from
AccessControl.Permission
import
name_trans
from
Globals
import
HTMLFile
from
cDocumentTemplate
import
*
from
DateTime
import
DateTime
from
string
import
find
...
...
@@ -13,6 +14,13 @@ from string import find
class
FindSupport
:
"""Find support for Principia Folders"""
manage_findFrame
=
HTMLFile
(
'findFrame'
,
globals
())
manage_findForm
=
HTMLFile
(
'findForm'
,
globals
())
manage_findAdv
=
HTMLFile
(
'findAdv'
,
globals
())
manage_findResult
=
HTMLFile
(
'findResult'
,
globals
())
manage_findOpt
=
HTMLFile
(
'findOpt'
,
globals
())
def
PrincipiaFind
(
self
,
obj
,
obj_ids
=
None
,
obj_metatypes
=
None
,
obj_searchterm
=
None
,
obj_expr
=
None
,
obj_mtime
=
None
,
obj_mspec
=
None
,
...
...
@@ -172,6 +180,9 @@ def p_name(name):
##############################################################################
#
# $Log: FindSupport.py,v $
# Revision 1.3 1998/08/14 20:54:44 brian
# Readded Find support that got overwritten somehow
#
# Revision 1.2 1998/08/13 13:48:16 brian
# Added find in all subfolders option
#
lib/python/OFS/Folder.py
View file @
3b64fa0a
"""Folder object
$Id: Folder.py,v 1.5
1 1998/08/14 16:46:35
brian Exp $"""
$Id: Folder.py,v 1.5
2 1998/08/14 20:54:44
brian Exp $"""
__version__
=
'$Revision: 1.5
1
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.5
2
$'
[
11
:
-
2
]
from
Globals
import
HTMLFile
from
ObjectManager
import
ObjectManager
from
CopySupport
import
CopyContainer
from
FindSupport
import
FindSupport
from
Image
import
Image
,
File
from
Document
import
DocumentHandler
from
AccessControl.Role
import
RoleManager
...
...
@@ -36,7 +37,7 @@ def manage_addFolder(self,id,title='',createPublic=0,createUserF=0,
if
REQUEST
is
not
None
:
return
self
.
manage_main
(
self
,
REQUEST
,
update_menu
=
1
)
class
Folder
(
ObjectManager
,
RoleManager
,
DocumentHandler
,
SimpleItem
.
Item
,
CopyContainer
):
SimpleItem
.
Item
,
CopyContainer
,
FindSupport
):
"""
The basic container object in Principia. Folders can hold almost all
other Principia objects.
...
...
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