2006-07-11T07:54:59  *** irc.freenode.net sets mode: +o ChanServ
2006-07-11T08:35:50  <ThomasWaldmann> moin
2006-07-11T08:58:50  <Kepplar> moin
2006-07-11T11:44:35  <Kepplar> why cant i find any pages on moin wiki with metadata?
2006-07-11T13:17:44  <Kepplar> Right
2006-07-11T13:17:49  <Kepplar> todays design question
2006-07-11T13:17:54  <Kepplar> method design
2006-07-11T13:18:19  <Kepplar> im implementing the set_revision duel function that does both meta and data at the same time and builds it effectively
2006-07-11T13:18:27  <Kepplar> obviously i dont want to do too much code reuse
2006-07-11T13:18:58  <Kepplar> set_metadata and set_data build up the save path each time depending on where its being saved
2006-07-11T13:19:12  <Kepplar> since this SI has them going to the same place
2006-07-11T13:19:15  <Kepplar> i need to run it once
2006-07-11T13:19:25  <Kepplar> so creation of the path is done in this new set_revision
2006-07-11T13:19:50  <Kepplar> BUT i realistically need to call both set_data and set_metadata to deal with the respective parts
2006-07-11T13:20:11  <Kepplar> i need to skip the uri location generation, as im goign to supply them one
2006-07-11T13:20:31  <Kepplar> from the combined function
2006-07-11T13:20:36  <Kepplar> two options really
2006-07-11T13:22:03  <Kepplar> a) i put the location as a keyword argument default to None
2006-07-11T13:22:22  <Kepplar> and check it each time, if its none, generate one, if not use it
2006-07-11T13:22:26  <Kepplar> OR
2006-07-11T13:23:00  <Kepplar> b) split set_metdata/data into two methods
2006-07-11T13:23:15  <Kepplar> one does the work and takes the argument
2006-07-11T13:23:45  <Kepplar> the other is the normal set_data/metadata public method, that generates the location and then calls the first one
2006-07-11T13:24:05  <Kepplar> or
2006-07-11T13:24:07  <Kepplar> actually
2006-07-11T13:24:19  <Kepplar> i could make the keyword argument = the normal generated value.. i can do that?
2006-07-11T13:24:28  <Kepplar> so i can call a function on the keyword argument?
2006-07-11T13:24:53  <Kepplar> def method(self, foo, bar=spam())
2006-07-11T13:24:53  <Kepplar> ?
2006-07-11T13:25:19  <Kepplar> which means i can default it to generate the normal location
2006-07-11T13:25:21  <Kepplar> or override it
2006-07-11T13:25:23  <Kepplar> easily
2006-07-11T13:25:34  <Kepplar> the reason i dont like B btw is that alot of the things are immutable
2006-07-11T13:25:37  <Kepplar> and will just chug
2006-07-11T13:25:46  <Kepplar> speed wise, i should pass the item revision to it and feed of that
2006-07-11T13:25:54  <Kepplar> but i prefer it seperated
2006-07-11T15:06:22  <ThomasWaldmann> what kind of metadata did you search?
2006-07-11T15:06:38  <Kepplar> ?
2006-07-11T15:07:03  <ThomasWaldmann> (11:44) <   Kepplar> why cant i find any pages on moin wiki with metadata?
2006-07-11T15:07:13  <Kepplar> oh sorted that now
2006-07-11T15:07:33  <Kepplar> made a few commits this morning btw
2006-07-11T15:09:21  <ThomasWaldmann> fpletz: on what are you working currently, btw?
2006-07-11T15:15:08  <ThomasWaldmann> Kepplar: for writing longer pieces of docs in the source code, it is easier to use """...""" than lots of # single line comments
2006-07-11T15:19:57  <ThomasWaldmann> This could automatically take
2006-07-11T15:19:58  <ThomasWaldmann> +# changes and save them to disk as a new revision and update the latest
2006-07-11T15:19:58  <ThomasWaldmann> +# revision indicator although it would not allow substantial changes (ie both
2006-07-11T15:19:58  <ThomasWaldmann> +# data and metadata) to occour in the same revision update which is
2006-07-11T15:19:59  <ThomasWaldmann> +# unacceptable.
2006-07-11T15:20:08  <ThomasWaldmann> why should that be unacceptable?
2006-07-11T15:21:49  <Kepplar> two file opening/writing/seekings
2006-07-11T15:22:14  <Kepplar> hence why im combining the methods into set_revision
2006-07-11T15:22:41  <ThomasWaldmann> i guess i cant follow you. we need to be able to do what we need to do.
2006-07-11T15:23:21  <ThomasWaldmann> for example, if you have an item calls "mydocs" of mimetype text/plain in rev 1
2006-07-11T15:24:01  <ThomasWaldmann> it must be possible to upload a rev 2 containing some other content and mimetype text/moin-wiki
2006-07-11T15:24:48  <Kepplar> yea sure
2006-07-11T15:25:02  <Kepplar> which brings me to problem i been keeping my head in the sand from
2006-07-11T15:25:15  <Kepplar> what happens if x revision is a page of y mimetype
2006-07-11T15:25:27  <Kepplar> and then you decide to create a new revision which is a user object
2006-07-11T15:25:35  <Kepplar> it will store it in different places
2006-07-11T15:25:53  <ThomasWaldmann> i guess we dont really have THAT problem
2006-07-11T15:26:21  <Kepplar> well no
2006-07-11T15:26:32  <Kepplar> but technically speaking someone could make the storage implementation do it
2006-07-11T15:28:59  <ThomasWaldmann> further, I am not sure whether we should make the itemrevs immutable on the storage interface level
2006-07-11T15:29:26  <ThomasWaldmann> of course they are immutable for the wiki user, but this is given by the way the wiki works on higher levels
2006-07-11T15:30:14  <Kepplar> they're not now
2006-07-11T15:30:15  <Kepplar> ive solve it :)
2006-07-11T15:30:30  <Kepplar> see how lock() works on item revision
2006-07-11T15:30:33  <ThomasWaldmann> if, for example, some converter script should need to convert any rev to another kind of thing, it needs r/w
2006-07-11T15:30:46  <Kepplar> well
2006-07-11T15:30:53  <Kepplar> it could just clone()
2006-07-11T15:31:11  <Kepplar> which creates a r/w version (without revision number etc)
2006-07-11T15:31:26  <Kepplar> revision number is given to it when it is registered to the item after modifications
2006-07-11T15:31:34  <Kepplar> item revision's commit() or item's add()
2006-07-11T15:32:04  <ThomasWaldmann> # I am yet unsure how alterations to mimetype will update the item revision
2006-07-11T15:32:04  <ThomasWaldmann> +# object, if a new revision object is directly copied from that of another
2006-07-11T15:32:04  <ThomasWaldmann> +# revision. It seems unreasonable to demand a mimetype (should it need to be
2006-07-11T15:32:04  <ThomasWaldmann> +# changed) on the revisions creations.
2006-07-11T15:32:17  <ThomasWaldmann> is this also solved or unclear still?
2006-07-11T15:33:19  <Kepplar> unclear
2006-07-11T15:33:32  <Kepplar> basically thats refering to creating a new revision from a current revision but with a new mimetype
2006-07-11T15:33:57  <Kepplar> thus you would need to have the new object of a different item revision subclass
2006-07-11T15:34:35  <Kepplar> if in an object i assign something to self does it update as i would expect?
2006-07-11T15:34:43  <Kepplar> thus i could have a convert(Class) method
2006-07-11T15:35:02  <Kepplar> that creates a new revision object of the new mimetype class, sends all data across and assigns to self
2006-07-11T15:35:06  <Kepplar> thus transforming it
2006-07-11T15:35:47  <ThomasWaldmann> well, with some proxy kind of code this would work automatically
2006-07-11T15:36:42  <Kepplar> i dont see how that would fit with the object model for this
2006-07-11T15:37:03  <Kepplar> item_revision = Item[-1]
2006-07-11T15:37:14  <Kepplar> which creates locked (eg: readonly) item revision
2006-07-11T15:37:16  <Kepplar> which you then
2006-07-11T15:37:23  <Kepplar> new_revision = item_revision.clone()
2006-07-11T15:37:44  <Kepplar> but you need to be able to access the new_revision just as a proper item revision for updating instead of a proxy object
2006-07-11T15:37:51  <Kepplar> as you dont know if your going to alter the mimetype
2006-07-11T15:37:52  <Kepplar> should
2006-07-11T15:38:04  <Kepplar> new_revision.metadata = newmetadatadictionary
2006-07-11T15:38:12  <Kepplar> then it should scan for a mimetype entry
2006-07-11T15:38:35  <Kepplar> and then.. somehow.. if it results in a change of subclass we need to get a new object out of that type with all the information from it
2006-07-11T15:41:28  <Kepplar> thinking about it there MUST be away to create a new object and change the reference to it
2006-07-11T15:41:32  <Kepplar> to point to it
2006-07-11T15:42:01  <ThomasWaldmann> as we never really want to save the same thing, this clone() thing looks suspicious
2006-07-11T15:42:40  <ThomasWaldmann> it creates an object of a maybe wrong type. maybe we could create the correct object instead.
2006-07-11T15:43:37  <Kepplar> hmm
2006-07-11T15:43:39  <Kepplar> yes
2006-07-11T15:44:04  <Kepplar> which is why in that comment you pasted i mentioned it being prehaps unreasonable to ask for the new metadata (and mimetype) at the point of cloning
2006-07-11T15:44:08  <ThomasWaldmann> we need to give out that stuff in some way to the browser, to edit it
2006-07-11T15:44:29  <ThomasWaldmann> and we will then get it back from the browser - either the same, unmodified stuff, or some modified stuff
2006-07-11T15:44:30  <Kepplar> as it means we cant alter the mimetype later
2006-07-11T15:44:41  <Kepplar> the alternative
2006-07-11T15:44:46  <Kepplar> is keep item revision as an object
2006-07-11T15:44:55  <Kepplar> and a attribute it has is a mimetype-behavoural object
2006-07-11T15:44:59  <Kepplar> which can be set easily
2006-07-11T15:45:03  <Kepplar> and contain custom functions
2006-07-11T15:45:08  <Kepplar> for each mimetype/itemtype
2006-07-11T15:45:37  <Kepplar> inheritance between increasingly specialised types can still be done, but seperate from the item revision - it is no longer root
2006-07-11T15:45:38  <ThomasWaldmann> this sounds like my proxy thing :)
2006-07-11T15:45:43  <Kepplar> ohh
2006-07-11T15:45:43  <Kepplar> :)
2006-07-11T15:46:11  <Kepplar> hmm ok
2006-07-11T15:46:15  <Kepplar> we can do that :)
2006-07-11T15:46:35  <Kepplar> not a problem as specialised types ive yet to implement anyway
2006-07-11T15:46:54  <ThomasWaldmann> maybe think it over in detail. i just have looked at some of your diffs, but not having the big picture about what you implemented already.
2006-07-11T15:47:35  <ThomasWaldmann> btw, i prefer this kind of separator:
2006-07-11T15:48:08  <ThomasWaldmann> # What ever -----------------------(up to col 79) -------
2006-07-11T15:48:14  <Kepplar> (btw i know that theres ident issues atm on some of todays diffs)
2006-07-11T15:48:21  <Kepplar> im sshing home and viming in today
2006-07-11T15:48:34  <ThomasWaldmann> if you use vim, use the python.vim from the wiki
2006-07-11T15:49:57  <ThomasWaldmann> and stop that == None
2006-07-11T15:51:05  <ThomasWaldmann> +            new_item_revision.int_revision_number = /
2006-07-11T15:51:05  <ThomasWaldmann> +         stimp_engine.get_current_revision_number() + 1
2006-07-11T15:51:19  <ThomasWaldmann> i guess you meant \, not /.
2006-07-11T15:51:29  <ThomasWaldmann> but rather put it on 1 line
2006-07-11T15:51:58  <xorAxAx> line continuation with \ is deprecated, brackets are recommended
2006-07-11T15:52:36  <ThomasWaldmann> (this kind of typo is at multiple places)
2006-07-11T15:56:56  <Kepplar> deprecated? really? oh
2006-07-11T19:33:35  <ThomasWaldmann> at least fpletz's irc client stays with us

MoinMoin: MoinMoinChat/Logs/moin-dev/2006-07-11 (last edited 2007-10-29 19:10:03 by localhost)