Changing script's search path at install time

2014-12-19 Thread Mitko Haralanov
Hi all, I have a question regarding installation of Python scripts and modules using distutils that I can't find an answer to by searching through Google and the Python website. Hopefully, someone on this list might have ideas? I am writing a Python app, which I would eventually like to install u

Moving subwindows in curses does not seem to work

2009-10-15 Thread Mitko Haralanov
(y,x): 8,159 As you can see, the subwin's coordinates within the parent window do not change before and after the move. I have not been able to find any information why this might be happening so if anyone could help, I'd be thankful. -- Mitko Haralanov -- http://mail.python.org/mailman/

Checking for binary data in a string

2009-06-19 Thread Mitko Haralanov
tring, so I can't use that as a check. The only other check that I can think of is to check every character in the read-in string against string.printable but that will take a long time. Can anyone suggest a better way to handle the check? Thank you in advance. -- Mitko Haralano

Change environment after setreuid

2008-09-30 Thread Mitko Haralanov
u' command? I could use it (the 'su' command) to start the new process but I'd like to avoid external dependencies like that. Thank you -- Mitko Haralanov == The program isn't debugged until the last user is dead. -- http://mail.python.org/mailman/listinfo/python-list

Re: python custom command interpreter?

2008-08-20 Thread Mitko Haralanov
eter #!/usr/bin/myinterpreter > DROP /tmp/directory > DROP /tmp/directory2 You don't need a custom interpreter to do this. Just use shell commands: %post rm -rf /tmp/directory rm -rf /tmp/directory2 will do the trick (if I am understanding correctly). -- Mitko Haralanov

Re: Segfault accessing dictionary in C Python module

2008-04-22 Thread Mitko Haralanov
ted from the dict (since PyDict_GetItem returns a borrowed reference). Once I did that, all was well. Thank you! -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 HSG InfiniBand Engineering http

Segfault accessing dictionary in C Python module

2008-04-21 Thread Mitko Haralanov
I can't seem to figure out where the problem is. Any help would be great? Thank you -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 HSG InfiniBand Engineering http://www.qlogic.com ==

Decrementing of reference count of new objects?

2008-04-01 Thread Mitko Haralanov
help! -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 HSG InfiniBand Engineering http://www.qlogic.com == 11. Any more trouble from you and your account

Re: Import and execfile()

2008-01-11 Thread Mitko Haralanov
arguments. In the load_config function, you could get the directory part of the config file path, appending it to sys.path, load the config, and then remove the newly added directory from sys.path. -- Mitko Haralanov -- http://mail.python.org/mailman/listinfo/python-list

Need help with strange segfault

2007-09-05 Thread Mitko Haralanov
del self.ts self.ts = None self.ts_lock.release () return rs I am getting what appears to be a correct value in rs but as soon as I try to access it from the caller function, Python segfaults. Any help would be appreciated? -- Mitko Haralanov

Some questions about ipath error messages

2007-06-06 Thread Mitko Haralanov
escriptive of the problem (I remember that, at least for the checksum part, it did mention a checksum error, and for HW version, it did mention HW version problem). Am I using the correct debug level? Did the error messages change on purpose? -- Mitko Haralanov

Invalid argument with fcntl.fcntl

2007-06-06 Thread Mitko Haralanov
rrno 22] Invalid argument If I execute the same code in the Python interpreter (replacing self.fd with an open file object), it work. Can anyone shed some light on why this code would produce that error? Thanks -- Mitko Haralanov [EMAIL PROTE

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
ctypes and it might do what I need but I can't figure out a way to convert a Python File object to a C FILE pointer (which is the needed argument for getmntent). Any ideas? -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
On Tue, 05 Jun 2007 20:14:01 +0200 "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > Ah, ok. I recommend to parse /proc/mounts. I was looking for something that reminded me less of Perl and more of C but haven't been able to find such a meth

Re: Getting mount stats for filesystems

2007-06-05 Thread Mitko Haralanov
Ok, let me try to explain: I am on machine A, which has a NFS mounted filesystem hosted on machine B. All I need to find out is whether the NFS filesystem is mounted using tcp or udp. -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer

Getting mount stats for filesystems

2007-06-04 Thread Mitko Haralanov
e, get the output of mount and parse that but I would prefer something more elegant. Thanks for your help! -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 System Interconnect Group

Re: Compiling Python code within a module

2007-05-18 Thread Mitko Haralanov
uot;) In this case, the function 'blah' is nowhere to be found. I've tried looking in 'f', in the class 'Foo', in the module 'Foo' and it's nowhere. -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer

Compiling Python code within a module

2007-05-18 Thread Mitko Haralanov
. I would appreciate any help that you guys might be able to offer? Thanks -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 System Interconnect Group http://www.

Re: Question about details of __import__

2007-03-29 Thread Mitko Haralanov
nk is happening). Once the log module became a top level module in sys.modules, everything worked. -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 System Interconnect Group http://www.qlogic.

Re: Question about details of __import__

2007-03-29 Thread Mitko Haralanov
> module = getattr(resources, name) > self.rs = module.Resource() Since the ./resources/__init__.py does not actually import any of the modules below it, this trick won't work but just for an experiment, I'll change the code and try it. -- Mitko Haralanov

Question about details of __import__

2007-03-29 Thread Mitko Haralanov
t I want? It seems like, the guts of the import/__import__ code are creating two different namespaces for the log.py module. (if you are wondering why I am using __import__ in my class constructor, it is because the name of the module that should be imported is read out of a configuration fil

Python's freeze.py utility

2007-02-15 Thread Mitko Haralanov
n-devel, python-tools, etc) and the script is neither in /usr/lib/python-2.4/Tools or /usr/lib/python-2.4/Demos Thanks for your help! -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 System Int

Re: Python with MPI enable C-module

2006-10-20 Thread Mitko Haralanov
never really have to be aware of MPI, only the C++ module that has > already been written. Haven't done it but from what I know about MPI and Python, it is possible. -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer

Re: Getting method name from within the class method

2006-10-19 Thread Mitko Haralanov
most useful one I've gotten so far!! -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 System Interconnect Group http://www.qlogic.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting method name from within the class method

2006-10-19 Thread Mitko Haralanov
explain the design and internals of my work. -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 System Interconnect Group http://www.qlogic.com -- http://mail.python.org/mailman/listinfo/python-list

Re: Getting method name from within the class method

2006-10-18 Thread Mitko Haralanov
atement (the ".a_method." part). Imagine having about 100 of the above print statements in the function and then you change the name of the function. I want all 100 of the print statements to work without having to change every one of them to reflect the new fu

Getting method name from within the class method

2006-10-18 Thread Mitko Haralanov
<__name__> a = A () a.a_method() 'a_method' Thanx for your help! -- Mitko Haralanov [EMAIL PROTECTED] Senior Software Engineer 650.934.8064 System Interconnect Group http://www.qlogic.com -- http:/

Re: Signals and threads again

2006-10-13 Thread Mitko Haralanov
On Fri, 13 Oct 2006 11:37:46 -0700 Mitko Haralanov <[EMAIL PROTECTED]> wrote: > The problem that I am experiencing is that when SIGINT is sent to the > program, it gets delivered to the child processes (the fork'ed ones) > but the main thread's signal handler is never

Signals and threads again

2006-10-13 Thread Mitko Haralanov
Hi everyone, First off, I know that this has been discussed before and I did a search but could not find anything that helped my situation. Here is the problem: I have a Python program that uses threads, forked processes, and signals and I can't seem to understand where the signals go. When the

Re: Newbie question - leading zeros

2006-10-13 Thread Mitko Haralanov
e stripped. Any > pointers would be appreciated. Thanks I assume that the values are string representations of numbers? If that is the case, you could do 'str (int ())'. It's ugly but it works. -- Mitko Haralanov [EMAIL PR