Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6f7dddc
add .gitignore
wlang42 Oct 26, 2022
52a16d0
remove trailing whitespaces
wlang42 Oct 26, 2022
59f06cf
use Zope4 compatible module imports (do not import Globals)
Oct 26, 2022
4d40d3e
Merge branch 'zope4-integration' of https://github.com/wlang42/ZWiki …
Oct 26, 2022
0fe8211
no more OFS.ObjectManager.customImporters in Zope4
wlang42 Oct 26, 2022
ff253d2
extend gitignore to ignore .pyc files
wlang42 Oct 26, 2022
452b4ce
new Zope4 way to get DateTime SyntaxError
wlang42 Oct 26, 2022
7f09132
different way of getting the Zope version
wlang42 Oct 26, 2022
29c072a
get rid of another Globals import
wlang42 Oct 26, 2022
7f23b60
repr statements are not allowed in tal expressions
wlang42 Oct 26, 2022
b6ae61b
hopefully the last "import Globals" replacement
wlang42 Oct 26, 2022
0986100
__implements__ workaround
wlang42 Oct 27, 2022
da297fb
implemented interfaces are inherited from the base class; no need
wlang42 Oct 28, 2022
f20dc0a
bobobase_modification_time does not exist in zope4 anymore.
Oct 31, 2022
cc2af86
Consumer of last_modified need to pass an argument to
Oct 31, 2022
f254713
reverted the accidental added empty line
gelbi123 Nov 2, 2022
ce79687
self.encoding() is shadowed by an attribute. Therefore
gelbi123 Nov 2, 2022
e48cdbf
Merge pull request #2 from gelbi123/zope4-integration
wlang42 Nov 2, 2022
e0f66e8
Merge branch 'zope4-integration' of https://github.com/gelbi123/ZWiki…
gelbi123 Nov 2, 2022
6b28020
Merge pull request #3 from gelbi123/zope4-integration
wlang42 Nov 2, 2022
a45ca00
make zwiki views handle Chameleon templates correctly
wlang42 Nov 6, 2022
00f4b8e
currently we do not know how to place zwiki templates into the ZODB i…
wlang42 Nov 6, 2022
329904e
adapt to newer (Zope4) DTML engine (which uses an "encoding" argument)
wlang42 Nov 6, 2022
6d13655
be slightly more verbose on *not* loading ZWiki page types
wlang42 Nov 7, 2022
72639a1
no more reStructuredText package in Zope4. use docutils directly
wlang42 Nov 7, 2022
df3368d
Rename README.txt to README.rst
wlang42 Nov 7, 2022
4184032
no more persistent "app.Control_Panel.Products" in Zope4. we use "app…
wlang42 Nov 8, 2022
1fb81b9
oops, forgot some parts in commit 72639a15b563deef2a8c39729d62f87cf9a…
wlang42 Nov 8, 2022
b850f6f
Merge branch 'zope4-integration'. Now Zope4 can import the ZWiki product
wlang42 Nov 11, 2022
97d06ec
move files to the standard zope product directory layout
wlang42 Nov 13, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,028 changes: 514 additions & 514 deletions .doxygen.conf

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.pyc
*~
2 changes: 1 addition & 1 deletion CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Folks who have contributed in ways other than committing code:
- Justin Clift - docs
- Paolo Pumilia - italian translation of ZwikiWithFrames
- Phil Armstrong - LinkColourHack
- Pieter B - often submits bugs in the [ZwikiTracker]s and works on ZwikiMail and the ZwikiFrontend
- Pieter B - often submits bugs in the [ZwikiTracker]s and works on ZwikiMail and the ZwikiFrontend
- Rik Hoekstra - wiki_page_url/virtual hosting suggestions
- Ron Dagostino - RecentChangesBySubjectFeature, DeletePageFeature etc
- tav - PlexNews (early zwiki/ptk combo)
22 changes: 11 additions & 11 deletions DEVELOPERS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Zwiki repository policies
Here are some guidelines for committers to the main Zwiki repository.

- http://zwiki.org/repos/ZWiki is the official Zwiki "trunk" repo,
used for product releases and for running zwiki.org.
used for product releases and for running zwiki.org.
A darcsweb interface is available at
http://joyful.com/darcsweb/darcsweb.cgi?r=ZWiki;a=summary .

Expand Down Expand Up @@ -116,7 +116,7 @@ Wiki docs:
- can organize a large number of documents in a hierarchy

current uses:

- zwiki.org, including
- NextReleaseNewsDraft - unused
- GeneralDiscussion
Expand Down Expand Up @@ -155,7 +155,7 @@ We have the following kinds of in-code documentation:

- a section heading within a file, class or method.

- a short explanatory comment appended to a line of code.
- a short explanatory comment appended to a line of code.

- longer explanatory comments when necessary.

Expand Down Expand Up @@ -209,7 +209,7 @@ output types and whether side effects are expected.

Function/method contracts
-------------------------
We are considering ways to document function and method "contracts".
We are considering ways to document function and method "contracts".
`Here's <http://www.htdp.org/2003-09-26/Book/curriculum-Z-H-5.html#node_sec_2.5>`_
an example. We are most interested in

Expand All @@ -224,7 +224,7 @@ an example. We are most interested in
Understanding statefulness in particular should help us to identify and
gather together the most stateful code, reduce state dependencies, and
increase the proportion of pure and semi-pure functional code, which
will greatly aid testing, debugging and reliability.
will greatly aid testing, debugging and reliability.

Here is a possible convention for now: when you touch a method or
function, review the docstring and code and try add a comment describing
Expand All @@ -241,7 +241,7 @@ some examples::

def handleSubtopicsProperty(self,subtopics,REQUEST=None): # -> none ; modifies: self

def revisionNumberBefore(self, username): # -> revision number | none
def revisionNumberBefore(self, username): # -> revision number | none
# depends on: self, revisions

def expungeEditsEverywhereBy(self, username, REQUEST=None, batch=0): # -> none
Expand All @@ -251,7 +251,7 @@ some examples::
# depends on: wiki
# modifies: wiki (folder, pages, dtml methods, catalog, outline, revisions..)

A few more notes:
A few more notes:

These don't have to be perfectly correct; even a rough guess could be
useful. Do review the contract for correctness every time you change some
Expand Down Expand Up @@ -281,7 +281,7 @@ valuable to see more lines on the screen than to see the full contents of
every line. Keeping lines within 80 characters can obscure the shape of
code constructs, especially with functional coding style, and also means
we are less likely to see the whole method at once. Long lines, even over
80 characters, may sometimes be preferable.
80 characters, may sometimes be preferable.

This assumes you have your editor truncate long lines, not wrap them. I
do this, and maximize the window when I need more visibility on the line
Expand All @@ -291,18 +291,18 @@ ends.
Message passing style, functional programming style, etc.
---------------------------------------------------------

The Zwiki codebase is influenced by Smalltalk. Eg:
The Zwiki codebase is influenced by Smalltalk. Eg:

- we encapsulate state and behaviour as objects when that makes sense

- we break up code into many small methods with intention-revealing names
to form an expressive domain-specific language.

- "tell, don't ask", ie just send messages, ignore what's returned.
- "tell, don't ask", ie just send messages, ignore what's returned.
We haven't used this and I don't know how it applies to us; it's
something to think about.

Recent code is also influenced by functional programming. Eg:
Recent code is also influenced by functional programming. Eg:

- we minimise the use of variables and the use of procedural/sequential
code (do this, then that, then the other). Instead, we compose functions
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ epydoc:
# https://translations.launchpad.net/zwiki/trunk/+pots/zwiki/+upload
# wait for upload (https://translations.launchpad.net/zwiki/trunk/+imports)
# 2. download latest translations from launchpad
# https://translations.launchpad.net/zwiki/trunk/+pots/zwiki/+export (everything, partial po format)
# https://translations.launchpad.net/zwiki/trunk/+pots/zwiki/+export (everything, partial po format)
# https://translations.launchpad.net/zwiki/trunk/+pots/zwiki-plone/+export
# wait for mail, unpack download links into i18n/ :
# cd i18n
Expand Down Expand Up @@ -94,7 +94,7 @@ poupload:
for L in $(LANGUAGES); do tar rvf zwiki.tar $$L.po; done; \
tar rvf zwiki.tar zwiki-plone.pot; \
for L in $(LANGUAGES); do tar rvf zwiki.tar plone-$$L.po; done; \
gzip -f zwiki.tar;
gzip -f zwiki.tar;

# unpack po files downloaded from launchpad
po:
Expand Down
6 changes: 3 additions & 3 deletions README.txt → README.rst
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
README
######

A wiki engine for Zope.
A wiki engine for Zope.

For documentation and assistance, please see http://zwiki.org .
All feedback, bug reports and other help appreciated.

(c) 1999-2009 Simon Michael <simon@joyful.com> and contributors.
This product is released under the GNU General Public License.
This product is released under the GNU General Public License.
All rights reserved, all disclaimers apply, etc.

Overview of documentation files::
Expand All @@ -18,7 +18,7 @@ Overview of documentation files::
FILESYSTEM_VS_WIKI_DOCS meta-documentation
LICENSE license text
LINECOUNTS code line counts (generated by make linecount)
REPO_POLICY policy for the main Zwiki repository
REPO_POLICY policy for the main Zwiki repository
STYLE developer style guide
TESTS test notes

Expand Down
30 changes: 0 additions & 30 deletions content/basic/sitemap.xml.dtml

This file was deleted.

26 changes: 3 additions & 23 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,9 @@
classifiers = [],
license = "GPL",
scripts = [],
py_modules = [
"__init__",
"Admin",
"CMF",
"Catalog",
"Comments",
"Defaults",
"Diff",
"Editing",
"History",
"Mail",
"Outline",
"OutlineSupport",
"PageTypes",
"Permissions",
"Regexps",
"Splitter",
"TextFormatter",
"Utils",
"Views",
"ZWikiPage",
],
packages = find_packages(),
packages=find_packages('src'),
package_dir={'': 'src'},
namespace_packages=['Products'],
package_data = {
'':['*.txt'],
},
Expand Down
11 changes: 0 additions & 11 deletions skins/zwiki/sitefooter.pt

This file was deleted.

11 changes: 0 additions & 11 deletions skins/zwiki/siteheader.pt

This file was deleted.

2 changes: 0 additions & 2 deletions skins/zwiki/testtemplate.pt

This file was deleted.

27 changes: 14 additions & 13 deletions Admin.py → src/Products/ZWiki/Admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
from time import clock

from AccessControl import getSecurityManager, ClassSecurityInfo, Unauthorized
from Globals import package_home, InitializeClass
from AccessControl.class_init import InitializeClass
from App.Common import package_home
from OFS.CopySupport import CopyError
from OFS.DTMLMethod import DTMLMethod
from DateTime import DateTime
Expand Down Expand Up @@ -43,7 +44,7 @@ def upgradeAll(self,render=1,batch=0,REQUEST=None): # -> none
Also installs a wiki catalog if not present, re-indexes each
page, validates page parents, and rebuilds the wiki outline
cache. Also installs the index_html and standard_error_message
dtml methods. XXX split ?
dtml methods. XXX split ?

You can set render=0 to skip the page pre-rendering part,
completing much faster on large wikis.
Expand All @@ -59,7 +60,7 @@ def upgradeAll(self,render=1,batch=0,REQUEST=None): # -> none
raise Unauthorized, (
_('You are not authorized to upgrade all pages.') + \
_('(folder -> Manage properties)'))

batch = int(batch)
if render: BLATHER('upgrading/reindexing/pre-rendering all pages:')
else: BLATHER('upgrading/reindexing all pages:')
Expand Down Expand Up @@ -149,7 +150,7 @@ def upgrade(self,REQUEST=None):

Called on every page view (set AUTO_UPGRADE=0 in Default.py to
prevent this). You could also call this on every page in your
wiki to do a batch upgrade. Affects bobobase_modification_time. If
wiki to do a batch upgrade. Affects last_modified. If
you later downgrade zwiki, the upgraded pages may not work so
well.
"""
Expand Down Expand Up @@ -194,16 +195,16 @@ def upgrade(self,REQUEST=None):
# Pre-0.9.10, creation_time has been a string in custom format and
# last_edit_time has been a DateTime. Now both are kept as
# ISO 8601-format strings. Might not be strictly necessary to upgrade
# in all cases.. will cause a lot of bobobase_mod_time
# in all cases.. will cause a lot of last_modified
# updates.. do it anyway.
if not self.last_edit_time:
self.last_edit_time = self.bobobase_modification_time().ISO8601()
self.last_edit_time = DateTime(self.last_modified(self)).ISO8601()
changed = 1
elif type(self.last_edit_time) is not StringType:
self.last_edit_time = self.last_edit_time.ISO8601()
changed = 1
elif len(self.last_edit_time) != 25:
try:
try:
if len(self.last_edit_time) == 19: # older "ISO()" format
# we're using the behaviour that was standard in
# Zope <= 2.9, where a timestamp without timezone
Expand All @@ -228,7 +229,7 @@ def upgrade(self,REQUEST=None):
self.creation_time = self.creation_time.ISO8601()
changed = 1
elif len(self.creation_time) != 25:
try:
try:
if len(self.creation_time) == 19: # older "ISO()" format
self.creation_time = \
DateTime(self.creation_time+' GMT+0').ISO8601()
Expand All @@ -246,10 +247,10 @@ def upgrade(self,REQUEST=None):
'_links',
'_prelinked',
):
if safe_hasattr(self.aq_base,a):
if safe_hasattr(self.aq_base,a):
delattr(self,a)
self.clearCache()
changed = 1
changed = 1

# update _properties
# keep in sync with _properties above. Better if we used that as
Expand Down Expand Up @@ -292,14 +293,14 @@ def upgrade(self,REQUEST=None):

if changed:
# do a commit now so the current render will have the correct
# bobobase_modification_time for display (many headers/footers
# last_modified for display (many headers/footers
# still show it)
# XXX I don't think we need to dick around with commits any more
#get_transaction().commit()
BLATHER('upgraded '+self.id())

self.upgradeComments(REQUEST)

# PageMailSupport does a bit more (merge here ?)
self._upgradeSubscribers()

Expand Down Expand Up @@ -475,7 +476,7 @@ class Extra:
BLATHER('indexing complete, %d pages processed' % n)
if REQUEST:
REQUEST.RESPONSE.redirect(self.pageUrl())

def ensureCatalog(self):
"""
Ensure this wiki has a zcatalog, for fast standardized searching.
Expand Down
5 changes: 3 additions & 2 deletions Archive.py → src/Products/ZWiki/Archive.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import AccessControl.Permissions
try: from Products.BTreeFolder2.BTreeFolder2 import BTreeFolder2 as Folder
except ImportError: from OFS.Folder import Folder # zope 2.7
from Globals import InitializeClass
from AccessControl.class_init import InitializeClass

from OutlineSupport import PersistentOutline
import Permissions
from Utils import safe_hasattr, sorted, registerSupportFolderId, BLATHER
Expand Down Expand Up @@ -42,7 +43,7 @@ def archiveFolder(self):
if f.isPrincipiaFolderish:
return f
return None

security.declareProtected(AccessControl.Permissions.delete_objects, 'archive')
def archive(self, REQUEST=None, pagename=None):
"""Move this page, and all offspring solely parented under this
Expand Down
Loading