http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py File MoinMoin/items/__init__.py (right): http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py#newcode17 MoinMoin/items/__init__.py:17: Each class correspond to an itemtype value. On 2012/07/22 ...
12 years, 8 months ago
(2012-07-22 15:59:59 UTC)
#2
some comments I try a practical test http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py File MoinMoin/items/__init__.py (right): http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py#newcode466 MoinMoin/items/__init__.py:466: data = ...
12 years, 8 months ago
(2012-07-23 06:55:08 UTC)
#3
some comments
I try a practical test
http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py
File MoinMoin/items/__init__.py (right):
http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py#newco...
MoinMoin/items/__init__.py:466: data = data.encode(charset) # XXX wrong! if
contenttype gives a coding, we MUST use THAT.
On 2012/07/22 15:59:59, xiaq wrote:
> On 2012/07/22 12:32:42, ThomasJWaldmann wrote:
> > where is charset defined?
>
> it was in MoinMoin.config, but i change the import to
>
> from MoinMoin.constants.contenttypes import charset, CONTENTTYPE_GROUPS
hmm, in the past we needed it in config because we hadn't utf-8 but iso-xxxx-x
or cpc or whatever
There it was with one config option possible to setup the encoding the editor
uses.
Having it in contenttypes only makes it impossible to modify it for one wiki
instance.
So is utf-8 now a constant or did someone want to change it?
http://codereview.appspot.com/6432058/diff/5003/MoinMoin/items/__init__.py
File MoinMoin/items/__init__.py (right):
http://codereview.appspot.com/6432058/diff/5003/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:786: def internal_representation(self,
converters=['smiley']):
This is the smiley convertor usage?
While internal of that method explicitly smiley_conv is used
the converters variable sounds like it could be variable
http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py File MoinMoin/items/__init__.py (right): http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py#newcode466 MoinMoin/items/__init__.py:466: data = data.encode(charset) # XXX wrong! if contenttype gives ...
12 years, 8 months ago
(2012-07-23 15:34:05 UTC)
#4
http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py
File MoinMoin/items/__init__.py (right):
http://codereview.appspot.com/6432058/diff/1/MoinMoin/items/__init__.py#newco...
MoinMoin/items/__init__.py:466: data = data.encode(charset) # XXX wrong! if
contenttype gives a coding, we MUST use THAT.
On 2012/07/23 06:55:08, Reimar Bauer wrote:
> On 2012/07/22 15:59:59, xiaq wrote:
> > On 2012/07/22 12:32:42, ThomasJWaldmann wrote:
> > > where is charset defined?
> >
> > it was in MoinMoin.config, but i change the import to
> >
> > from MoinMoin.constants.contenttypes import charset, CONTENTTYPE_GROUPS
>
> hmm, in the past we needed it in config because we hadn't utf-8 but iso-xxxx-x
> or cpc or whatever
> There it was with one config option possible to setup the encoding the editor
> uses.
>
> Having it in contenttypes only makes it impossible to modify it for one wiki
> instance.
>
> So is utf-8 now a constant or did someone want to change it?
Citing config/__init__.py:
# provide compatibility for stuff not using MoinMoin.constants yet
Judging from the content of config/__init__.py (it consists of a series of
imports only) it seems that is the sole purpose of the it now. So I followed
Thomas's suggestion and changed the import from MoinMoin.config to
MoinMoin.constants.contenttypes.
BTW, user configuration is kept in the app.config variable, rather than in the
config module.
http://codereview.appspot.com/6432058/diff/5003/MoinMoin/items/__init__.py
File MoinMoin/items/__init__.py (right):
http://codereview.appspot.com/6432058/diff/5003/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:786: def internal_representation(self,
converters=['smiley']):
On 2012/07/23 06:55:08, Reimar Bauer wrote:
> This is the smiley convertor usage?
>
> While internal of that method explicitly smiley_conv is used
> the converters variable sounds like it could be variable
>
didn't change the code, just moved around.
12 years, 8 months ago
(2012-07-23 17:16:51 UTC)
#6
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/apps/frontend/views.py
File MoinMoin/apps/frontend/views.py (right):
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/apps/frontend/views....
MoinMoin/apps/frontend/views.py:57: #from MoinMoin.items.content import
ROWS_DATA
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> remove it at the end
After separating contenttype codes __init__.py this line will be uncommented,
and the ROWS_DATA import on the previous line be removed.
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py
File MoinMoin/items/__init__.py (right):
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:63: #from .content import content_registry
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> remove it at the end
It is needed after splitting the file into __init__.py and content.py. So I'll
remove the leading # at the end. :)
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:167: return cls(name, **kw)
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> what is this needed for?
For item_registry.
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:553:
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> did you change anything of the stuff above?
almost nothing, except for some necessities to keep things working (eg.
self._render_data -> self.content._render.data).
> hard to review if lots of stuff gets moved around...
yeah, sorry :(
but this is basically a "move-things-around" patch set, i try not to add new
stuff. maybe codereview needs a more intelligent diffing algorithm that can
follow code moving :-P (btw, seriously, is there a way to make it easier to
review while moving code around?)
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:561: class Contentful(Item):
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> wut? :) sounds strange somehow.
Yeah i couldn't resist to name it so :-P
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:563: Base class for Item subclasses that have a
content.
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> ... have content.
fixing
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:601: # XXX
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> is that XXX from you? means what?
means "the same XXX as the previous XXX"...
http://codereview.appspot.com/6432058/diff/1013/MoinMoin/items/__init__.py#ne...
MoinMoin/items/__init__.py:1195: # no PIL, we can't do anything, we just output
the revision data as is
On 2012/07/23 16:51:44, ThomasJWaldmann wrote:
> I already commented on this, but you lost it by moving stuff around...
>
> You already checked the PIL import, so use "if PIL is None:".
>
> Also please re-check if you lost other feedback while moving stuff here.
(after double checking) nothing apart from the PIL comment.
btw, after putting content.py back to __init__.py the above line is actually not
in the patch anymore.
some more comments http://codereview.appspot.com/6432058/diff/26/MoinMoin/templates/modify_binary.html File MoinMoin/templates/modify_binary.html (left): http://codereview.appspot.com/6432058/diff/26/MoinMoin/templates/modify_binary.html#oldcode6 MoinMoin/templates/modify_binary.html:6: {{ forms.render_textcha(gen, form) }} where is ...
12 years, 8 months ago
(2012-07-23 21:46:17 UTC)
#8
new patch set 7, featuring nice comments about code being moved around, please review! :) ...
12 years, 8 months ago
(2012-07-24 02:55:03 UTC)
#10
new patch set 7, featuring nice comments about code being moved around, please
review! :)
i also rearranged the code a bit to look more similar to the original revision,
therefore you might want to looking at the patch set directly instead of a delta
from a previous patch set (which are more different from the original revision).
btw. issues brought up by dreimark in comments for patch set 5 and 6 hasn't been
addressed, doing that in the next patch set.
Shiny new patch set! :) I tried to include a summary in the patch set ...
12 years, 8 months ago
(2012-07-24 07:34:31 UTC)
#11
Shiny new patch set! :) I tried to include a summary in the patch set title, but
it gets trimmed in the web interface.
* a substitution (item|content)_type -> \1type [1] in items/__init__.py.
* removed template_name from arguments of Item.do_modify.
Previously it was filled with the value of `request.values.get('template')` by
the +modify handler and passed to do_modify. This made sense since the creation
of all contenttypes had a template selection step, but with the introduction of
itemtypes it is now up to the Item subclass to decide whether there will be a
template selection step. So passing template_name doesn't always make sense -
it's already useless to NonExistent. Moreover, a specific Item subclass may also
decide to look at other (arbitrary) entries in request.values, in which case
passing template_name only make things asymmetric.
I thought about introducing the removal of template_name argument in a
follow-up changeset, but with the introduction of itemtypes the do_modify
methods are already being extensively restructured, so I think it's ok to
include it in this changeset.
In patch set 11 i've adapted all test cases so there is no additional failures ...
12 years, 8 months ago
(2012-07-27 05:22:06 UTC)
#12
In patch set 11 i've adapted all test cases so there is no additional failures
introduced. There are also several random cleanups and fixes.
Also the patch set is rebased off latest revision of main repo, which includes
spy's blog codes. The rebase is smooth with no conflicts.
http://codereview.appspot.com/6432058/diff/30003/MoinMoin/apps/frontend/views.py File MoinMoin/apps/frontend/views.py (right): http://codereview.appspot.com/6432058/diff/30003/MoinMoin/apps/frontend/views.py#newcode445 MoinMoin/apps/frontend/views.py:445: # TODO implement Content.create and use it Content.create here ...
12 years, 8 months ago
(2012-07-28 01:41:28 UTC)
#17
Issue 6432058: Implementing experimental itemtype
(Closed)
Created 12 years, 8 months ago by xiaq
Modified 12 years, 8 months ago
Reviewers: thomas.j.waldmann_googlemail.com, Reimar Bauer, spy
Base URL:
Comments: 88