📜 ⬆️ ⬇️

Script import historical qutIM from Kopete

I first read about the new ICQ client for linux, qutIM , right here . Almost immediately switched to this client, because under ubuntu (and under the linux in general) IMHO is very much lacking a normal ICQ-client. In Windows for about 2 years I used R & Q , and under linux I used Kopete for about 4 months (I didn’t like Pidgin very much, I sat in it for a long time under Windows).

It didn't work right away to switch to a new client - it didn’t work very stably, it collected the latest versions from the repository trunk. And since ICQ is almost always needed, I had to return to Kopete from time to time. Now, like the kutim is more or less stabilized, it rarely takes off, therefore now it has completely switched to it. But some rather important conversations remained broken between the historical Kutima and the Copete. Plus, a lot of logs just left in the cope. Therefore, I wrote the utility of merge histori from cope to kutim.


')
At first I thought about what language to implement the import utility. My main language is PHP, but this is somehow not interesting. I also have a little C # /. NET and JAVA, but writing on the first one under linux is somehow not aha, and on the second one, although interesting (for me), it would be rather cumbersome. Although I may be wrong.

As a result, my choice fell on a python, which I have been studying for a long time, but somehow my hands did not reach. And here is a very real and not very difficult task - which is not a reason to start mastering a new programming language, praised by many reputable comrades.

No sooner said than done. It took about 8 hours to write the script, but I really liked the result, as well as the process itself =)

The script provides for both copying histories for contacts that have not yet conducted histories, and merzh of existing histories, while respecting the chronology of the dialogues.

When developing for working with XML, DOM, not SAX, was used, so the script is quite demanding on resources to parse very thick logs. But since Since the script will rarely run more than once, this is not so critical.

From the known script bugs - dom parser to fall on incorrect characters. I have from 2.5 meters of logs such characters were in 3 logs. For now, this can only be treated by manually editing the logs (the error indicates the number of the line and column with the incorrect character) and the restart of the script. If someone offers a treatment option for incorrect characters, I will be very grateful.

The script itself can be taken here ifolder.ru/7235826
I'm not sure that this is the best place for laying out scripts, but I could not think of another one. Again, I would be grateful if you tell me services that specialize in simply laying out open source.

ZYZH next step is to write a script to import the history from R & Q, because since Windows I have about 25 meters of logs left, most of which I do not want to lose.

UPD : now you can just look at the script with highlighting here http://paste.org.ru/?vfzraa (thanks to derZelle derZelle)

Source: https://habr.com/ru/post/28581/


All Articles