Thursday, February 14, 2013

How to change Skype default browser

xdg-mime default opera.desktop x-scheme-handler/http
xdg-mime default opera.desktop x-scheme-handler/https

Monday, November 22, 2010

Snaked 0.4

Next big Snaked's release. It features:

Also some minor improvements:

  • Hide tab bar on <Alt>F11.
  • Switch tabs on additional "standard" <Ctrl>PageUp/PageDown keys.
  • Automatic character encoding detection.
  • Highlight selection on <Ctrl>H.
  • All search dialogs allow activate the one item by Enter key in search entry.
  • Hints config format changed. Now it is ordinary python module.
  • Show cursor column on <Ctrl><Alt>O
  • Editor's line spacing option.
  • Hints for re.RegexObject and re.MatchObject.
  • Auto remove trailing space on file save.
  • Disable left mouse button click in text view window.
  • Rewrap text on right margin with <Alt>F.

What will be in next version?

  • Multiple snippet contexts.
  • Variable autocomplete in Django/Jinja templates.
  • Editing capabilities improving.

You can install:

sudo pip install snaked

Upgrade:

sudo pip install -U snaked

Or download package directly from PyPI. Also check install instructions.

Thursday, November 4, 2010

Bad servers, chunked encoding and IncompleteRead

Have you ever got IncompleteRead exception on trying to fetch chunked data with urllib2? I did. Look at the snippet:

import urllib2, httplib

try:
    data = urllib2.urlopen('http://some.url/address').read()
except httplib.IncompleteRead:
    # Ahtung! At this point you lose any fetched data except last chunk.

IRL most bad servers transmit all data, but due implementation errors they wrongly close session and urllib raise error and bury your precious bytes.

What you have to do to handle such situation?

I don't like any solutions which involve manual data reading loop, so I prefer to patch read function.

import httplib

def patch_http_response_read(func):
    def inner(*args):
        try:
            return func(*args)
        except httplib.IncompleteRead, e:
            return e.partial

    return inner
httplib.HTTPResponse.read = patch_http_response_read(httplib.HTTPResponse.read)

It allows you to deal with defective http servers.

Friday, October 22, 2010

First Snaked release

I'm glad to announce first realease of Snaked -- minimalist editor for python developers. Some features:
  • Python code navigation (goto definition and quick outline) and completion based on Rope refactoring library. Also Snaked can provide additional type information for rope static object infer system to allow you to complete every object in the project.
  • Light UI without unnecessary widgets.
  • Keyboard oriented control.
  • Tabbed or windowed interface on your choice.

Installing

sudo pip install snaked

Documentation

You can find detailed editor documentation in the folowing page: Snaked user manual

Feel free to post any issues, ideas and suggestions on Github page or in comments.