~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/chat.py

  • Committer: Matt Giuca
  • Date: 2009-02-24 02:02:03 UTC
  • mto: This revision was merged to the branch mainline in revision 1119.
  • Revision ID: matt.giuca@gmail.com-20090224020203-aqdcjnsj6y7wl32o
Added a new look to the IVLE header bar. Mmmm... Web 2.0.
Added top-level directory image-source, containing SVG and script files for
    generating the images.
ivle/webapp/coremedia/images: Added 'chrome' directory containing the rendered
    images.
Modified ivle/webapp/base/ivle-headings.html and
    ivle/webapp/coremedia/ivle.css to support the new images.
    Note that the H1 and H2 at the top of the page are no longer displayed
    (and their custom styles have been removed). There is a heading image
    instead.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import cjson
23
23
import cStringIO
24
 
import hashlib
 
24
import md5
25
25
import sys
26
26
import os
27
27
import socket
97
97
            env = cjson.decode(inp)
98
98
            
99
99
            # Check that the message is 
100
 
            digest = hashlib.md5(env['content'] + magic).hexdigest()
 
100
            digest = md5.new(env['content'] + magic).digest().encode('hex')
101
101
            if env['digest'] != digest:
102
102
                conn.close()
103
103
                continue
134
134
    sok = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
135
135
    sok.connect((host, port))
136
136
    content = cjson.encode(msg)
137
 
    digest = hashlib.md5(content + magic).hexdigest()
 
137
    digest = md5.new(content + magic).digest().encode("hex")
138
138
    env = {'digest':digest,'content':content}
139
139
    sok.send(cjson.encode(env))
140
140