Re: [BangPypers] How to dynamically load modules in Django/Python

2014-12-17 Thread Amit Sethi
Mithun a suggestion, checkout how settings.py file is imported in your manage.py Thanks Amit ___ BangPypers mailing list BangPypers@python.org https://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] Mock json_request unit testing.

2014-06-25 Thread Amit Sethi
Well it will be more clear if you specify what exactly do you need but you can use python mock for your mocking needs in python code https://pypi.python.org/pypi/mock http://www.toptal.com/python/an-introduction-to-mocking-in-python On Wed, Jun 25, 2014 at 9:21 PM, VIMAL K vima...@ieee.org

Re: [BangPypers] Restart when python script hangs

2014-06-02 Thread Amit Sethi
If by any chance you are trying to write a deamon, you could monitor it using http://supervisord.org/ On Mon, Jun 2, 2014 at 6:56 PM, Sateesh Kumar sateeshpy...@gmail.com wrote: On Mon, Jun 2, 2014 at 3:14 PM, Rahul Gopan rahulpce...@gmail.com wrote: Hello, When I run a python script it

Re: [BangPypers] Empty element in xml

2013-11-04 Thread Amit Sethi
, Gora Mohanty g...@mimirtech.com wrote: On 4 November 2013 03:00, Amit Sethi amit.pureene...@gmail.com wrote: Hi All, I am stuck with wierd problem . I am dealing with a legacy system(written in C) that deals with using some xml. The xml is created with python. Now the trouble is that the legacy

Re: [BangPypers] Empty element in xml

2013-11-04 Thread Amit Sethi
I would not do that at all. There are subtle differences between HTML and XML, e.g., HTML allows tags that are not explicitly closed with /tag. Try a sub-element with the img or input tag. In general, valid HTML is not necessarily valid XML, and vice versa. The bugs Hmm that is good point. I

[BangPypers] Getting a random record from Database . The best strategy.

2013-10-03 Thread Amit Sethi
Hi , I am not sure if this question will be considered sufficiently python related. If its not than I am sorry I will take this somewhere else I am setting up some smoke tests for which I am fetching some records from the db. I am using sqlalchemy for this right now. My real question when

Re: [BangPypers] File upload to Server using FTP in Django?

2013-09-24 Thread Amit Sethi
Hi Sameerkatti , First of all , My first recommendation would be not to possibly to do what you are trying to . If you have to an open ftp connection to upload a file in a web application. I am also most certain that there is something wrong in your application by design . 2. Wether you like it

[BangPypers] Functional testing wih headless browser framework

2013-09-16 Thread Amit Sethi
Hi , I am looking to add some functional testing to my application. I have seen a couple of tools via google search but the reason I am a little circumspect is that last time, I did something similar using selenium and it seemed lack some requirements of mine.(It was not exacty headless) Any

Re: [BangPypers] Favorite tips/techniques

2013-09-11 Thread Amit Sethi
1. I do like the accessing dict attributes as keys and specifically where they make more sense as structure by itselfI do use class ABC(object): a = '' def __init__(self, **kwargs): self.__dict__.update(**kwargs) 2. When creating a dictionary of constants create it

[BangPypers] Running a trigger with sqlalchemy that works with session.execute

2013-05-06 Thread Amit Sethi
Anyone who can help out with sqlalchemy related problem Running a trigger with sqlalchemy that works with session.execute I have a app which using sqlalchemy as the orm. As the app is one in transition some of the update query's run through a session.execute . However I need to create a trigger

[BangPypers] Any standard way in which i can share contacts

2012-07-24 Thread Amit Sethi
Has anybody here worked with phonebook contacts. Is there a standard which major number of phone manufacturers support for electronic business card . Vcard seems to be not supported by Android/blackberry etc .. -- A-M-I-T S|S ___ BangPypers mailing

Re: [BangPypers] Any standard way in which i can share contacts

2012-07-24 Thread Amit Sethi
On Tue, Jul 24, 2012 at 10:30 PM, Sriram Karra karra@gmail.com wrote: On Tue, Jul 24, 2012 at 7:35 PM, Amit Sethi amit.pureene...@gmail.comwrote: Has anybody here worked with phonebook contacts. Yes, I have. Is there a standard which major number of phone manufacturers support

[BangPypers] Django porting app to multiple databases

2012-03-02 Thread Amit Sethi
Hi all , My app has started breaking after moving to django 1.3 . I don't really understand why? I am working using site framework and given model definition through app_label. The only major change as I can see is that I use UUID Fields rather than AutoField. Now somehow i see that my app is

Re: [BangPypers] something similar to file command for python

2012-02-29 Thread Amit Sethi
python-magic works like a charm ... However I am still curious as to how other mail servers and clients deducing the name of the original file. Thanks Amit -- A-M-I-T S|S ___ BangPypers mailing list BangPypers@python.org

Re: [BangPypers] something similar to file command for python

2012-02-29 Thread Amit Sethi
Well interestingly in case of blackberry devices the header is Content-Type: application/octet-stream; name==?utf-8?B?UFVSQ0hBU0UgT1JERVJfUmVsaWFuY2UuZG9j?= Content-Disposition: attachment so obviously thats not how it is happening ___ BangPypers

Re: [BangPypers] something similar to file command for python

2012-02-29 Thread Amit Sethi
@ Balachandran Sivakumar The name parameter itself is base64 encoded , I did not notice that . I think that solves so many of my problems. Thanks -- A-M-I-T S|S ___ BangPypers mailing list BangPypers@python.org

[BangPypers] something similar to file command for python

2012-02-28 Thread Amit Sethi
Hi All , I am trying to read some file attachments being sent from blackberrys . However blackberry compresses the document into base64 . Now I am able to get the document by converting it back. However I wish to know the file extension of the original document. Now I know file command reads the

[BangPypers] Https and http difference in behaviour urllib2

2012-02-22 Thread Amit Sethi
Hi all , Can someone explain to me why things are implemented the following in urllib2. When I pass encoded url using http it again encodes the parameters whereas in case of https it does not urlencode again so lets say the (http) call is http//:example.com?email=amit%40sethi.comthe request is

[BangPypers] Binary blobs inside a mysql data base

2012-01-31 Thread Amit Sethi
Hi all , Is it a good idea to keep binary blobs inside a mysql database . They will not actually be served through http later on. And they are of more than 500 kb usually . I have searched all over stackoverflow and the reactions are mixed . I would like to know what are the views of people on

[BangPypers] procmail and python

2011-12-21 Thread Amit Sethi
Has anybody here used some kind of python script with procmail . I want to set up a script that looks at a certain words in a mail and forwards it to users. However I am not able to understand how can I read the message in python script. The documentation suggests something like this should send

Re: [BangPypers] procmail and python

2011-12-21 Thread Amit Sethi
I think I should mention that i am fetching mail from gmail. Is there an encryption that google uses . Also the mails are being received fine on mutt. -- A-M-I-T S|S ___ BangPypers mailing list BangPypers@python.org

Re: [BangPypers] procmail and python

2011-12-21 Thread Amit Sethi
Well I am fairly sure the script is running i am simply writing the message in stdin to a log and that part works fine . Just looking at it again I think its an encoding because in the gibbrish message I have found some kind of dkim message thing : (PST)#012DKIM-Signature: v=1; a=rsa-sha256;

[BangPypers] Python's stdin buffer size

2011-12-21 Thread Amit Sethi
Hi , I am trying to read in a large message piped to a python script. The message would have something like 1000 words . How can one increase the buffer size of sys.stdin in python. -- A-M-I-T S|S ___ BangPypers mailing list BangPypers@python.org

Re: [BangPypers] UML diagrams from python source code

2011-12-15 Thread Amit Sethi
Try Lumpy a reverse engineering tool for python. http://allendowney.com/swampy/lumpy.html -- A-M-I-T S|S ___ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers

Re: [BangPypers] seantis questionnaire - Django App

2011-11-23 Thread Amit Sethi
Hi Asif , Sorry if the message seems harsh in any way. As has been pointed to you earlier on the thread it is unlikely that people will know about an obscure django app. It is unlikely that even one of the developers will be able to give a direct support question kind of an answer. You will have

[BangPypers] Using Facebook graph api in a page tab application

2011-10-03 Thread Amit Sethi
Hi all , I have a feeling that the answer to this might be very simple but some how i am not able to find it even after reading and re-reading the facebook documentation This is somewhat of generic problem and may not necessarily have a python solution. This is a page tab application running

[BangPypers] setuptools and distutils confusion

2011-08-24 Thread Amit Sethi
Hi all, I am really confused as to how setuptools and distutils work. Basically what i want to achieve is be able to install packages in my local environment and not globally ( just a preference ) . I know I can use virtualenv and distribute but i just want to do some simple testing and don't

Re: [BangPypers] two dropdowns dependents on each other

2011-08-16 Thread Amit Sethi
[..] without ajax: 1. override __init__ on your modelform, pass the value of the first dropdown to __init__ and populate the second dropdown depending on that value. If the value is None, the second dropdown will not be populated. 2. in your template, refresh the page when the value of the

Re: [BangPypers] [Error] AttributeError: Document instance has no attribute

2011-08-05 Thread Amit Sethi
On Fri, Aug 5, 2011 at 3:48 PM, Subhodip Biswas subhodipbis...@gmail.com wrote: Hi all, I am using suds as a WSDL Consumption client. I get proper response in suds.sax.document format. I am not exactly sure what you are trying to do but isn't sax supposed to be read on the fly , I do not

[BangPypers] Reseting contenttype for dumpdata/loaddata

2011-07-19 Thread Amit Sethi
Hi All, I am having trouble loading Django fixtures into my database because of contenttypes conflicts. Some of the data i need has foreignkey elements in the contenttypes model. Apparently the problem is that django dynamically tries to populate the content-types table. But if we put data into

Re: [BangPypers] [Small Hitch]Minidom and xml parsing.

2011-07-12 Thread Amit Sethi
[..] I am fairly new to python and i am stuck with a problem. What I am  trying to do is parse a xml file using minidom. My xml file as almost a structure like this : someparentabove       parent              child1              /child1              child2              /child2      

[BangPypers] Writing extendable django views

2011-07-06 Thread Amit Sethi
Hi all , This is just a thought The question is very abstract , how do you write extendable django views . In particular while working on a certain problem . I realized that i was changing my views just to add certain context variables to the standard views provided by an external django app. I

[BangPypers] Error loading fixtures after adding a contenttype relation

2011-06-13 Thread Amit Sethi
Hi all , While doing some experiments to extend some features of my project . I added an app and tried to create a generic relation using the contenttype framework as described here https://docs.djangoproject.com/en/dev/ref/contrib/contenttypes/ However when run syncdb again . The fixtures fail

[BangPypers] Using south for migration for a django project

2011-05-19 Thread Amit Sethi
Hi all , I have been trying to use south(0.7) for migrating a django(1.2.5) project (db backend - postgres but have also tried using with sqlite3) Essentially I wish to rename a field in one of my apps. I am also using mezzanine cms (0.10) . The first problem I run into is that mezzanine apps

[BangPypers] Broken pipe error

2011-04-14 Thread Amit Sethi
Many times on making request to a the django development server I get this error File /usr/lib/python2.6/socket.py, line 286, in flush self._sock.sendall(buffer) error: [Errno 32] Broken pipe However usually it is momentary. But I have been getting this error continuously. Thus I am

Re: [BangPypers] Fwd: Help with Python IDE's

2011-03-28 Thread Amit Sethi
I think you might be looking for pydev for eclipse http://pydev.blogspot.com/2006/09/configuring-pydev-to-work-with-django.html On emacs you could use python-mode for autocomplete and https://github.com/gregnewman/django-mode if you want snippets, the later is based on yasnippet.

Re: [BangPypers] Python for mobile apps Deveopment

2011-01-25 Thread Amit Sethi
On Tue, Jan 25, 2011 at 1:57 PM, Neha Jain neha.hbti...@gmail.com wrote: There are many apps written for the maemo platform in pyqt, these are portable to android and iphone(may be with a bit of difficulty). I am not too sure about that. The architecture of the three platforms is quite

Re: [BangPypers] How to do RSA encryption in python

2010-11-30 Thread Amit Sethi
On Wed, Dec 1, 2010 at 12:30 PM, sarath babu runsarat...@gmail.com wrote: Dear all, I am searching for doing rsa encryption in python. Please give me a method to do RSA key generation, encryption and decryption. I think you might like to look at pycrypto[1] or sagemath[2] . There is also a toy

[BangPypers] regex euivalent of literal block in Rest Document structure

2010-11-28 Thread Amit Sethi
Hi all, Can somebody tell me what is the regex equivalent of literal block of reST. After a bit of google search.I could get something like r'::\n\n(\s+.+)+\n' but it does not seem to be right. -- A-M-I-T S|S ___ BangPypers mailing list

Re: [BangPypers] Hello:

2009-11-08 Thread Amit Sethi
I don't exactly understand what you mean by code checker? but if you require some thing that can do context free grammar conversion you can use nltk. -- A-M-I-T S|S ___ BangPypers mailing list BangPypers@python.org

Re: [BangPypers] python zlib problem

2009-10-31 Thread Amit Sethi
That is a very dangerous option ... tried it but uninstalls a lot of packages practically the whole ubuntu-desktop. On Sat, Oct 31, 2009 at 12:25 PM, Kenneth Gonsalves law...@thenilgiris.comwrote: On Saturday 31 Oct 2009 12:24:24 pm Amit Sethi wrote: How do you force install a package ?? I