Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Issue 114 in pyfilesystem: MultiOpener doesn't has ability to set writefs [patch]
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pyfilesys...@googlecode.com  
View profile  
 More options May 4 2012, 5:53 am
From: pyfilesys...@googlecode.com
Date: Fri, 04 May 2012 09:53:26 +0000
Local: Fri, May 4 2012 5:53 am
Subject: Issue 114 in pyfilesystem: MultiOpener doesn't has ability to set writefs [patch]
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 114 by dubn...@gmail.com: MultiOpener doesn't has ability to set  
writefs [patch]
http://code.google.com/p/pyfilesystem/issues/detail?id=114

To create writable milti://... filesystems, the following patch should be  
applied to fs/opener.py:

      @classmethod
      def get_fs(cls, registry, fs_name, fs_name_params, fs_path, writeable,  
create_dir):

          from fs.multifs import MultiFS
          from ConfigParser import ConfigParser
          cfg = ConfigParser()

          if '#' in fs_path:
              path, section = fs_path.split('#', 1)
          else:
              path = fs_path
              section = 'fs'

          cfg.readfp(registry.open(path))

          multi_fs = MultiFS()
          for name, fs_url in cfg.items(section):
-            multi_fs.addfs(name, registry.opendir(fs_url,  
create_dir=create_dir))
+            multi_fs.addfs(name, registry.opendir(fs_url,  
create_dir=create_dir), name=='writefs')
          return multi_fs, ''


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pyfilesys...@googlecode.com  
View profile   Translate to Translated (View Original)
 More options Aug 16 2012, 5:04 pm
From: pyfilesys...@googlecode.com
Date: Thu, 16 Aug 2012 21:04:29 +0000
Local: Thurs, Aug 16 2012 5:04 pm
Subject: Re: Issue 114 in pyfilesystem: MultiOpener doesn't has ability to set writefs [patch]

Comment #1 on issue 114 by gc...@loowis.durge.org: MultiOpener doesn't has  
ability to set writefs [patch]
http://code.google.com/p/pyfilesystem/issues/detail?id=114

I'm -1 on the suggested patch. MultiFS can only have one writefs, so your  
patch would be constantly switching the writefs to the last-added FS. And  
maybe you don't even want a writefs?! Or maybe you simply don't want to  
have the writefs as the very last line of the ini file.

IMHO a better solution would be to add some kind of extra (optional) syntax  
to the end of the FS URL that you want to be the writefs in the ini file  
used by MultiOpener (I'm not familiar enough with fs.opener to suggest what  
the syntax might be) and then have MultiOpener raise an exception if  
there's more than one writefs specified in the ini file.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »