From a250685f1752d9eecb3b032f3b2dc3c7378acd90 Mon Sep 17 00:00:00 2001 From: Filipp Lepalaan Date: Wed, 3 Apr 2013 11:03:21 +0300 Subject: Survive without CLIENT --- gsxws.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gsxws.py') diff --git a/gsxws.py b/gsxws.py index e3b9789..f6c635e 100755 --- a/gsxws.py +++ b/gsxws.py @@ -3,16 +3,17 @@ #coding=utf-8 """ -Copyright (c) 2012, Filipp Lepalaan All rights reserved. +Copyright (c) 2013, Filipp Lepalaan All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: -Redistributions of source code must retain the above copyright notice, +- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. -Redistributions in binary form must reproduce the above copyright notice, +- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -125,8 +126,10 @@ class GsxObject(object): def __init__(self, *args, **kwargs): self.data = kwargs - self.dt = CLIENT.factory.create(self.dt) - self.request_dt = CLIENT.factory.create(self.request_dt) + + if CLIENT is not None: + self.dt = CLIENT.factory.create(self.dt) + self.request_dt = CLIENT.factory.create(self.request_dt) def set_method(self, new_method): self.method = new_method -- cgit v1.2.3