How to import data from a database to Joomla CMS?
I have a database with lots of data I want to use in my new website. An ideal solution for me would be a Python/Perl/PHP API that would know how to do Joomla' basic routines:
adding/removing a section/category/material/menu/module;
changing properties of existing entities
...
I need to write a unit test for a function that returns a dictionary. One of the values in this dictionary is datetime.datetime.now() which of course changes with every test run.
I want to ignore that key completely in my assert. Right now I have a dictionary comparison function but I really want to use assertEqual like this:
def my_fu...
I have created temporary named files, with the tempfile libraries NamedTemporaryFile method.
I have written to them flushed the buffers, and I have not closed them (or else they might go away)
I am trying to use the subprocess module to call some shell commands using these generated files.
subprocess.call('cat %s' % f.name) always fail...
Update: When I use the subprocess.call instead of subprocess.Popen, the problem is solved - does anybody know what's the cause? And there came another problem: I can't seem to find a way to control the output... Is there a way to redirect the output from subprocess.call to a string or something like that? Thanks!
I'm trying to use Deven...
I've been having to do some basic feed processing. So, get a file via ftp, process it (i.e. get the fields I care about), and then update the local database. And similarly the other direction: get data from db, create file, and upload by ftp. The scripts will be called by cron.
I think the idea would be for each type of feed, define the...
Hi folks. I want to add WebDAV to whiff. This would be easy if I could find a simple WSGI component that implements WebDAV. I found http://pyfilesync.berlios.de/pyfileserver.html, but it seems to insist on using an external configuration file. I want to control everything via a Python API. Any ideas?
Thanks!
...
Hi There (this turned out kinda long but i appreciate you reading),
I've been in IT for about 10 yrs. I've had exposure in everything from rolling out server environments, to routing, to security. I've worked quite a bit with web servers and have been exposed to the superficial structure of things like asp.net, css, html, xml, php, my...
I have a file containing lots of data put in a form similar to this:
Group1 {
Entry1 {
Title1 [{Data1:Member1, Data2:Member2}]
Title2 [{Data3:Member3, Data4:Member4}]
}
Entry2 {
...
}
}
Group2 {
DifferentEntry1 {
DiffTitle1 {
...
}
}
}
Thing is...
Hi, what's a good way to check if a package is installed while within a Python script? I know it's easy from the interpreter, but I need to do it within a script.
I guess I could check if there's a directory on the system that's created during the installation but I feel like there's a better way. I'm trying to make sure the Skype4Py p...
What's the Fastest way to get a large number of files (relatively small 10-50kB) from Amazon S3 from Python? (In the order of 200,000 - million files).
At the moment I am using boto to generate Signed URLs, and using PyCURL to get the files one by one.
Would some type of concurrency help? PyCurl.CurlMulti object?
I am open to all s...
I'm using the Twisted framework, and am getting RPCs asynchronously. I have another function which does a task every 2 seconds, and sleeps in between. This is called through reactor.callInThread. These depend on a shared resources, so I need some thread-safe way of accessing them. How does one go about using critical sections / mutexes /...
Any time I use the recipe at http://code.activestate.com/recipes/134892/ I can't seem to get it working. It always throws the following error:
Traceback (most recent call last):
...
old_settings = termios.tcgetattr(fd)
termios.error: (22, 'Invalid argument)
My best thought is that it is because I'm running it in Eclipse so ter...
Alright. I figured it out. transfer.flags needed to be a byte instead of an int. Silly me. Now I'm getting an error code from ioctl, errno 16, which I think means the device is busy. What a workaholic. I've asked on the libusb mailing list.
Below is what I have so far. This isn't really that much code. Most of it is ctypes structures fo...
I am on python 2.6 for Windows.
I use os.walk t read a file tree. Files may have non-7-bit characters (German "ae" for example) in their filenames. These are encoded in Pythons internal string representation.
I am processing these filenames with Python library functions and that fails due to wrong encoding.
How can I convert these fil...
I've been trying to build a fairly simple message box in tkinter,that has an "YES" and "NO" buttons. When I push the "YES" button internally it must go and write to a file YES. Similarly,when "NO" is pushed, file must be written a NO.Any idea of how I could do this ?
...
Hi, I've got a junior starting who's coming from a Java background. As a company we're now focused on Python development(albeit with some legacy systems in Java hanging around).
I'm looking around for tips and resources to help the transition and wondered if you guys here had any useful tips for a newbie.
Cheers.
...
Hello.
I'm using Python and PyGTK. I'm interested in running a certain function, which gets data from a serial port and saves it, every several minutes.
Currently, I'm using the sleep() function in the time library. In order to be able to do processing, I have my system set up like this:
import time
waittime = 300 # 5 minutes
while(1)...
The output of /proc/net/dev on Linux looks like this:
Inter-| Receive | Transmit
face |bytes packets errs drop fifo frame compressed multicast|bytes packets errs drop fifo colls carrier compressed
lo:18748525 129811 0 0 0 0 0 0 18748525 129811 ...
I am writing a daemon program using python 2.5. In the main process an exit handler is registered with atexit module, it seems that the handler gets called when each child process ends, which is not I expected.
I noticed this behavior isn't mentioned in python atexit doc, anybody knows the issue? If this is how it should behave, how c...
hi all,
I'm new to matplotlib. My environment is WinXP, PythonWin 2.6.2, NumPy 1.3.0, matplotlib 0.98.5.3.
>>> import matplotlib.pylab as pylab
Traceback (most recent call last):
File "<interactive input>", line 1, in <module>
File "D:\Python26\lib\site-packages\matplotlib\pylab.py", line 253, in <module>
from matplotlib.pyplot...