Re: Creating Import Hooks

2010-02-18 Thread Sreejith K
On Feb 18, 1:57 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Thu, 18 Feb 2010 00:03:51 -0800, Jonathan Gardner wrote: On Feb 17, 10:48 pm, Sreejith K sreejith...@gmail.com wrote: Hi everyone, I need to implement custom import hooks for an application (http

Re: Creating Import Hooks

2010-02-18 Thread Sreejith K
On Feb 18, 3:49 pm, Jean-Michel Pichavant jeanmic...@sequans.com wrote: Sreejith K wrote: On Feb 18, 1:57 pm, Steven D'Aprano ste...@remove.this.cybersource.com.au wrote: On Thu, 18 Feb 2010 00:03:51 -0800, Jonathan Gardner wrote: On Feb 17, 10:48 pm, Sreejith K sreejith...@gmail.com

Changing Python Opcodes

2009-08-18 Thread Sreejith K
Hi, I know this is not the best way to do it. But I have to do it at least to make it *hard* to decompile the python bytecode. I want to distribute a software written in Python without the source. So I compiled Python from source changing some opcode values (Taking care of HAVE_ARGUMENT value)

Re: Changing Python Opcodes

2009-08-18 Thread Sreejith K
On Aug 18, 12:19 pm, Diez B. Roggisch de...@nospam.web.de wrote: Did you try installing the egg *without* pyc-files in there? Because naturally those shouldn't work. They shouldn't crash the interpreter either, but then again - you *did* modify it. Hi Diez, thanks for the immediate reply :)

statvfs clearance

2009-04-04 Thread Sreejith K
Python's statvfs module contains the following indexes to use with os.statvfs() that contains the specified information statvfs.F_BSIZE Preferred file system block size. statvfs.F_FRSIZE Fundamental file system block size. statvfs.F_BLOCKS Total number of blocks in the filesystem.

Re: file.read() doesn't read the whole file

2009-03-24 Thread Sreejith K
On Mar 24, 7:15 am, Gabriel Genellina gagsl-...@yahoo.com.ar wrote: En Mon, 23 Mar 2009 21:37:14 -0300, R. David Murray   rdmur...@bitdance.com escribió: Steve Holden st...@holdenweb.com wrote: Sreejith K wrote: Try and write an example that shows the problem in fifteen lines

Re: file.read() doesn't read the whole file

2009-03-24 Thread Sreejith K
On Mar 24, 2:12 pm, Ant ant...@gmail.com wrote: On Mar 24, 7:59 am, Sreejith K sreejith...@gmail.com wrote: ... data is the whole file, but 'less' gives only the two lines... From this statement (that you are using less), it appears that you are redirecting sys.stdout to a file or similar

Re: file.read() doesn't read the whole file

2009-03-24 Thread Sreejith K
On Mar 24, 4:45 pm, R. David Murray rdmur...@bitdance.com wrote: Sreejith K sreejith...@gmail.com wrote: On Mar 24, 2:12 pm, Ant ant...@gmail.com wrote: On Mar 24, 7:59 am, Sreejith K sreejith...@gmail.com wrote: ... data is the whole file, but 'less' gives only the two lines

Re: file.read() doesn't read the whole file

2009-03-24 Thread Sreejith K
It's not a redirect to a file.  Fuse calls the 'read' function on the class, the read function does a 'return' of the data, and fuse passes the data up through the OS layer to be the result of the 'read' call made by less. By redirection I meant reading the snapshot file instead of the

Re: file.read() doesn't read the whole file

2009-03-23 Thread Sreejith K
Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data =

Re: file.read() doesn't read the whole file

2009-03-23 Thread Sreejith K
Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data =

Re: file.read() doesn't read the whole file

2009-03-23 Thread Sreejith K
Try and write an example that shows the problem in fifteen lines or less. Much easier for us to focus on the issue that way. import os def read(length, offset): os.chdir('/mnt/gfs_local/') snap = open('mango.txt_snaps/snap1/0','r') snap.seek(offset) data =

Re: file.read() doesn't read the whole file

2009-03-21 Thread Sreejith K
On Mar 21, 10:54 am, R. David Murray rdmur...@bitdance.com wrote: Sreejith K sreejith...@gmail.com wrote:                                    tf.writelines(Reading from Base File\n)                                    self.file.seek(block*4096 + off%4096

Re: file.read() doesn't read the whole file

2009-03-21 Thread Sreejith K
The break and continue problem was actually my own mistake. I wrote no_blks = length/4096 + 1, so the loop actually executes twice. Sorry for my idiotic mistake But the read() problem still persists. Thanks.. -- http://mail.python.org/mailman/listinfo/python-list

file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
Hi, snapdir = './mango.txt_snaps' snap_cnt = 1 block = 0 import os os.chdir('/mnt/gfs_local') snap = open(snapdir + '/snap%s/%s' % (repr(snap_cnt), repr(block)),'r') snap.read() 'dfdfdgagdfgdf\ngdgfadgagadg\nagafg\n\nfs\nf\nsadf\n\nsdfsdfsadf\n' snapdir + '/snap%s/%s' % (repr(snap_cnt),

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
On Mar 20, 4:43 pm, R. David Murray rdmur...@bitdance.com wrote: Sreejith K sreejith...@gmail.com wrote: Hi, snapdir = './mango.txt_snaps' snap_cnt = 1 block = 0 import os os.chdir('/mnt/gfs_local') snap = open(snapdir + '/snap%s/%s' % (repr(snap_cnt), repr(block)),'r

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
On Mar 21, 12:58 am, I V ivle...@gmail.com wrote: On Fri, 20 Mar 2009 07:03:35 -0700, Sreejith K wrote: I'm using the above codes in a pthon-fuse's file class's read function. The offset and length are 0 and 4096 respectively for my test inputs. When I open a file and read the 4096 bytes

Re: file.read() doesn't read the whole file

2009-03-20 Thread Sreejith K
class MedusaFile(object): def __init__(self, path, flags, *mode): global METHOD global NORMAL global SNAP global FRESH_SNAP self.path = path

Flags in fuse python

2009-03-16 Thread Sreejith K
Hi, I'm writing a file system under fuse-python. The main problem I'm facing now is that the flags which are provided by the fuse module when r/w are called, are screwing up the situation. I wrote a file class for fuse as shown below. class FlusterFile(object): def

Creating a 256 byte/block filesystem using FUSE in python

2009-03-16 Thread Sreejith K
Anyone got any idea of how to create a 256 byte/block filesystem using FUSE in python ? How to implement block level reads/writes instead of byte level reads/writes in fuse-python ? -- http://mail.python.org/mailman/listinfo/python-list