From philip.colmer at linaro.org Mon Oct 7 08:48:19 2013 From: philip.colmer at linaro.org (Philip Colmer) Date: Mon, 7 Oct 2013 13:48:19 +0100 Subject: [Moin-user] Suggestions sought to how best to implement this request ... In-Reply-To: References: Message-ID: >> The MoinMoin.action.AttachFile module contains functions to work >> with attachments in a nicer way than manipulating the filesystem directly. Is there any documentation on how to programmatically attach a file to a page? I can only see documentation for checking if an attachment exists and getting the directory path and URL for a page. Thanks. Philip On 27 September 2013 08:45, Philip Colmer wrote: > Thank you, everyone, for the replies sent. They were a great help. > > Management has decided/agreed to drop the multi-column display and opted > for what some might consider to be an older, more traditional approach of > just listing everything in a single column with a TOC at the top and "Back > to top" links at each section. Easier for me to build :-). > > I've managed to make reasonable approximations of the team and individual > pages in MoinMoin wiki markup so I'm reasonably happy with the outcome. > > Thanks again. > > Philip > > > > On 25 September 2013 09:06, Jim Wight wrote: > >> >> On 24 September 2013 16:44, Philip Colmer wrote: >> >>> >>> - The way that the lists are arranged into three columns seems to be >>> some CSS voodoo that I'm trying to unpick. I'm not sure how to mimic that >>> in MoinMoin since calling CSS directly is tricky ... >>> >>> You could try the Columns macro for that part. It was only listed under >> 1.6 in MacroMarket but as it has been brought up to date for 1.9 I've >> updated the 1.9 table. >> >> Jim >> >> >> >> ------------------------------------------------------------------------------ >> October Webinars: Code for Performance >> Free Intel webinars can help you accelerate application performance. >> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >> from >> the latest Intel processors and coprocessors. See abstracts and register > >> >> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >> _______________________________________________ >> Moin-user mailing list >> Moin-user at lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/moin-user >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From philip.colmer at linaro.org Mon Oct 7 09:13:06 2013 From: philip.colmer at linaro.org (Philip Colmer) Date: Mon, 7 Oct 2013 14:13:06 +0100 Subject: [Moin-user] Suggestions sought to how best to implement this request ... In-Reply-To: References: Message-ID: Not to worry - I figured it out: AttachFile.add_attachment(request, 'Internal/meet-the-team/{0}'.format(pnNormalised), "profile.jpg", person.photo, overwrite=1) where "profile.jpg" is the name I want the file to have and "person.photo" is a blob of binary data read from the LDAP server. Nice to see that the moin moin code just handles it - I don't have to do any munging of the blob, etc. Philip On 7 October 2013 13:48, Philip Colmer wrote: > >> The MoinMoin.action.AttachFile module contains functions to work > >> with attachments in a nicer way than manipulating the filesystem > directly. > > Is there any documentation on how to programmatically attach a file to a > page? I can only see documentation for checking if an attachment exists and > getting the directory path and URL for a page. > > Thanks. > > Philip > > > > On 27 September 2013 08:45, Philip Colmer wrote: > >> Thank you, everyone, for the replies sent. They were a great help. >> >> Management has decided/agreed to drop the multi-column display and opted >> for what some might consider to be an older, more traditional approach of >> just listing everything in a single column with a TOC at the top and "Back >> to top" links at each section. Easier for me to build :-). >> >> I've managed to make reasonable approximations of the team and individual >> pages in MoinMoin wiki markup so I'm reasonably happy with the outcome. >> >> Thanks again. >> >> Philip >> >> >> >> On 25 September 2013 09:06, Jim Wight wrote: >> >>> >>> On 24 September 2013 16:44, Philip Colmer wrote: >>> >>>> >>>> - The way that the lists are arranged into three columns seems to >>>> be some CSS voodoo that I'm trying to unpick. I'm not sure how to mimic >>>> that in MoinMoin since calling CSS directly is tricky ... >>>> >>>> You could try the Columns macro for that part. It was only listed under >>> 1.6 in MacroMarket but as it has been brought up to date for 1.9 I've >>> updated the 1.9 table. >>> >>> Jim >>> >>> >>> >>> ------------------------------------------------------------------------------ >>> October Webinars: Code for Performance >>> Free Intel webinars can help you accelerate application performance. >>> Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most >>> from >>> the latest Intel processors and coprocessors. See abstracts and register >>> > >>> >>> http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk >>> _______________________________________________ >>> Moin-user mailing list >>> Moin-user at lists.sourceforge.net >>> https://lists.sourceforge.net/lists/listinfo/moin-user >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Mon Oct 7 09:32:37 2013 From: paul at boddie.org.uk (Paul Boddie) Date: Mon, 7 Oct 2013 15:32:37 +0200 Subject: [Moin-user] Suggestions sought to how best to implement this request ... In-Reply-To: References: Message-ID: <201310071532.37573.paul@boddie.org.uk> On Monday 7. October 2013 14.48.19 Philip Colmer wrote: > >> The MoinMoin.action.AttachFile module contains functions to work > >> with attachments in a nicer way than manipulating the filesystem > >> directly. > > Is there any documentation on how to programmatically attach a file to a > page? I can only see documentation for checking if an attachment exists and > getting the directory path and URL for a page. Having suggested AttachFile as a way of adding attachments, I just looked at some code that I know adds attachments programmatically - the graphviz parser [1] - and it appears that it uses AttachFile only to discover the directory of attachments for a page. Here's what it does (edited slightly): # Use the request to create or obtain the directory for a given page. attach_dir = AttachFile.getAttachDir(request, page_name, create=1) # Obtain the pathname for the given leafname in the directory. pathname = join(attach_dir, leafname).encode(config.charset) After this, the extension just writes to the file with the given pathname (or rather it gets graphviz to do so). Looking inside the MoinMoin.action.AttachFile module, I see that the add_attachment function does more or less the same thing, but it also adds an entry to the history which might not be something the graphviz parser would want to do (since it is just using the attachments as temporary storage for generated images that can be shown conveniently by Moin). So, maybe add_attachment is what you want unless you don't want to add history entries to the edit log, in which case doing only some of what that function does (as described above) is probably satisfactory. And if you're doing this kind of thing from outside Moin and are just looking to import attachments in "batch" mode, you could instead use the page package infrastructure [2], but I'll leave that for another message if you're interested in that. Paul [1] http://moinmo.in/ParserMarket/graphviz [2] http://moinmo.in/HelpOnPackageInstaller From a.kuntzagk at science-computing.de Wed Oct 30 08:30:56 2013 From: a.kuntzagk at science-computing.de (=?utf-8?Q?Andreas_Kuntzagk?=) Date: Wed, 30 Oct 2013 13:30:56 +0100 Subject: [Moin-user] Creating a Wiki-Page Message-ID: Hi, I want to create a wiki page from a python Program. Following the documentation I managed to do that as the user running the webserver. However I want to run this program as a different user. Whenever I do this I get a permissions error: ==== >>> request = ScriptContext() Traceback (most recent call last): File "", line 1, in File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/web/contexts.py", line 439, in __init__ wsgiapp.init(self) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/wsgiapp.py", line 51, in init context.lang = setup_i18n_preauth(context) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/wsgiapp.py", line 233, in setup_i18n_preauth i18n.i18n_init(context) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/i18n/__init__.py", line 72, in i18n_init meta_cache = caching.CacheEntry(request, 'i18n', 'meta', scope='wiki', use_pickle=True) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/caching.py", line 71, in __init__ self.arena_dir = get_arena_dir(request, arena, scope) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/caching.py", line 32, in get_arena_dir return os.path.join(request.cfg.cache_dir, request.cfg.siteid, arena) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/web/contexts.py", line 56, in get res = obj.environ.setdefault(self.name, factory(obj)) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/web/contexts.py", line 128, in cfg cfg = multiconfig.getConfig(self.request.url) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/config/multiconfig.py", line 193, in getConfig cfg = _makeConfig(cfgName) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/config/multiconfig.py", line 125, in _makeConfig cfg = configClass(name) File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/config/multiconfig.py", line 277, in __init__ self._check_directories() File "/share/cc_wiki/moin_cc/lib/python2.6/site-packages/MoinMoin/config/multiconfig.py", line 604, in _check_directories raise error.ConfigurationError(msg) MoinMoin.error.ConfigurationError: data_dir "/share/cc_wiki/moin_cc/share/moin/data" does not exist, or has incorrect ownership or permissions. Make sure the directory and the subdirectory "pages" are owned by the web server and are readable, writable and executable by the web server user and group. It is recommended to use absolute paths and not relative paths. Check also the spelling of the directory name. ==== /share/cc_wiki/moin_cc/share/moin/data exists and is writable by the apache user but not by the user running the script. Version is 1.9.4 regards, Andreas -- Vorstandsvorsitzender/Chairman of the board of management: Gerd-Lothar Leonhart Vorstand/Board of Management: Dr. Bernd Finkbeiner, Michael Heinrichs, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Philippe Miltin Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 -------------- next part -------------- An HTML attachment was scrubbed... URL: From paul at boddie.org.uk Wed Oct 30 08:57:39 2013 From: paul at boddie.org.uk (Paul Boddie) Date: Wed, 30 Oct 2013 13:57:39 +0100 Subject: [Moin-user] Creating a Wiki-Page In-Reply-To: References: Message-ID: <201310301357.40181.paul@boddie.org.uk> On Wednesday 30. October 2013 13.30.56 Andreas Kuntzagk wrote: > Hi, > > I want to create a wiki page from a python Program. Following the > documentation I managed to do that as the user running the webserver. > However I want to run this program as a different user. > Whenever I do this I get a permissions error: [...] > /share/cc_wiki/moin_cc/share/moin/data exists and is writable by the apache > user but not by the user running the script. > > Version is 1.9.4 I tend to run scripts against a wiki by using sudo with the -u option to indicate the Web server user. It is also possible to use filesystem ACLs that allow unrelated users to write to the wiki's files (sharing the group assigned to files is the "low tech" equivalent when you don't have ACLs). For example: setfacl -m u:youruser:rw somefile setfacl -m u:youruser:rwx somedir (You can combine this with find to do this to many files, and I generate a script to do this in moinsetup.) However, if files are created by Moin, it can be tricky to get the ACLs to stick to these new files, although I'm sure that if I checked the documentation I'd find a reasonable solution for that, too. If anyone has any better ideas, please let us know. ;-) Paul