Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(102)  |  Call(83)  |  Derive(6)  |  Import(13)

src/p/y/pysyncml-0.2.0/pysyncml/change/tracker.py   pysyncml(Download)
import urllib, hashlib
from .. import constants
from ..common import adict, state2string, ConflictError
 
#------------------------------------------------------------------------------
      isMd5        = True
    if fieldname not in self.current:
      self.current[fieldname] = adict(op   = changeType,
                                      ival = initialValue,
                                      md5  = isMd5)
      initialValue = hashlib.md5(initialValue).hexdigest()
      isMd5        = True
    cur = adict(index = int(listIndex),
                op    = changeType,
                ival  = initialValue,

src/p/y/pysyncml-0.2.0/pysyncml/test_common.py   pysyncml(Download)
 
from . import common, constants
from .common import adict
 
#------------------------------------------------------------------------------
  def test_describeStats(self):
    buf = six.StringIO()
    stats = dict(note=adict(
      mode=constants.SYNCTYPE_TWO_WAY,conflicts=0,merged=0,
      hereAdd=10,hereMod=0,hereDel=0,hereErr=0,
  def test_describeStats_noTotals(self):
    buf = six.StringIO()
    stats = dict(note=adict(
      mode=constants.SYNCTYPE_TWO_WAY,conflicts=0,merged=0,
      hereAdd=10,hereMod=0,hereDel=0,hereErr=0,
  def test_describeStats_title(self):
    buf = six.StringIO()
    stats = dict(note=adict(
      mode=constants.SYNCTYPE_TWO_WAY,conflicts=0,merged=0,
      hereAdd=10,hereMod=0,hereDel=0,hereErr=0,
  def test_describeStats_errors(self):
    buf = six.StringIO()
    stats = dict(note=adict(
      mode=constants.SYNCTYPE_TWO_WAY,conflicts=0,merged=0,
      hereAdd=10,hereMod=0,hereDel=0,hereErr=1,

src/p/y/pysyncml-0.2.0/pysyncml/test_server.py   pysyncml(Download)
 
import pysyncml
from .common import adict, ts, ts_iso, getAddressSize, getMaxMemorySize
from . import codec, test_helpers
from .test_helpers import makestats as stat, setlogging
  def test_auth_none(self):
    request = adict(headers=dict((('content-type', 'application/vnd.syncml+xml'),)),
                    body='<?xml version="1.0" encoding="utf-8"?>'
                    '<SyncML>'
                    '<SyncHdr>'
  def test_auth_basic(self):
    request = adict(headers=dict((('content-type', 'application/vnd.syncml+xml'),)),
                    body='<?xml version="1.0" encoding="utf-8"?>'
                    '<SyncML>'
                    '<SyncHdr>'
    self.assertEqual(
      pysyncml.Context.getAuthInfo(request, None),
      adict(auth=pysyncml.NAMESPACE_AUTH_BASIC,
            username='guest', password='guest'))
    self.assertEqual(pysyncml.Context.getTargetID(request), self.server.devID)
 
  #----------------------------------------------------------------------------
  def test_auth_with_namespace(self):
    request = adict(headers=dict((('content-type', 'application/vnd.syncml+xml'),)),

src/p/y/pysyncml-0.2.0/pysyncml/test_treeclient.py   pysyncml(Download)
 
import pysyncml
from .common import adict, ts, ts_iso, getAddressSize, getMaxMemorySize
from .items.file import FileItem
from .items.folder import FolderItem
    self.client.sync(pysyncml.SYNCTYPE_SLOW_SYNC)
 
    chk = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                body=
                '<SyncML>'
 
    # step 3: server responds, client sets up routes and requests sync
    response = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                     body=
                     '<SyncML>'
    proxy.sendResponse(response)
 
    chk = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                body=
                '<SyncML>'
 
    # step 4: server responds, client sends all of its data (none in this case)
    response = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                     body=
                     '<SyncML>'

src/p/y/pysyncml-0.2.0/pysyncml/test_client.py   pysyncml(Download)
 
import pysyncml
from .common import adict, ts_iso, getAddressSize, getMaxMemorySize
from . import test_helpers
from .items.note import NoteItem
    self.client.sync(pysyncml.SYNCTYPE_SLOW_SYNC)
 
    chk = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                body=
                '<SyncML>'
 
    # step 2: server responds, client sets up routes and requests sync
    response = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                     body=
                     '<SyncML>'
    proxy.sendResponse(response)
 
    chk = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                body=
                '<SyncML>'
 
    # step 3: server responds, client sends all of its data (none in this case)
    response = adict(headers=dict((('content-type', 'application/vnd.syncml+xml; charset=UTF-8'),)),
                     body=
                     '<SyncML>'

src/p/y/pysyncml-0.2.0/pysyncml/state.py   pysyncml(Download)
'''
 
from .common import adict
 
#------------------------------------------------------------------------------
class Session(adict):
class Request(adict): pass
class Response(adict): pass
 
#------------------------------------------------------------------------------
class Command(adict):

src/p/y/pysyncml-0.2.0/pysyncml/change/merger.py   pysyncml(Download)
import urllib, hashlib, difflib
from .. import constants
from ..common import adict, state2string
from .tracker import *
 

src/p/y/pysyncml-0.2.0/pysyncml/ctype.py   pysyncml(Download)
 
import xml.etree.ElementTree as ET
from .common import adict
 
__all__ = 'ContentTypeInfo',
class ContentTypeInfo(adict, ContentTypeInfoMixIn):
  '''
  The ContentTypeInfo class defines a content-type handling capability of
  a pysyncml Agent.
  '''

src/p/y/pysyncml-0.2.0/pysyncml/test_helpers.py   pysyncml(Download)
 
from . import constants, common, state
from .common import adict
 
#------------------------------------------------------------------------------
  def open(self, req, data=None, timeout=None):
    self.peer = self.refresher(self.peer)
    self.log('request', data)
    request = adict(headers=dict(), body=data)
    request.headers['content-type'] = req.headers['Content-type']
    response = state.Request()
    self.peer.handleRequest(self.session, request, response)
    self.log('response', response.body)
    res = six.StringIO(response.body)
    res.info = lambda: adict(headers=['content-type: %s' % (response.contentType,)])

src/p/y/pysyncml-0.2.0/pysyncml/change/test_tracker.py   pysyncml(Download)
 
from .. import common, constants
from ..common import adict, ConflictError
from .tracker import AttributeChangeTracker, ListChangeTracker
 

  1 | 2  Next