From 052625af165e23743ed29f5eb779d565df3f3f51 Mon Sep 17 00:00:00 2001 From: j <0x006A@0x2620.org> Date: Fri, 24 Feb 2012 20:54:49 +0530 Subject: [PATCH] site config --- bin/pandora_client | 2 +- pandora_client/__init__.py | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/pandora_client b/bin/pandora_client index 31830f2..d330f8d 100755 --- a/bin/pandora_client +++ b/bin/pandora_client @@ -22,7 +22,7 @@ if __name__ == '__main__': (opts, args) = parser.parse_args() opts.config = os.path.expanduser(opts.config) - if None in (opts.config, ) or (args[0] != 'config' and not os.path.exists(opts.config)): + if None in (opts.config, ) or (args and args[0] != 'config' and not os.path.exists(opts.config)): parser.print_help() sys.exit() diff --git a/pandora_client/__init__.py b/pandora_client/__init__.py index 21f1b07..2fce2fc 100644 --- a/pandora_client/__init__.py +++ b/pandora_client/__init__.py @@ -156,7 +156,7 @@ class Client(object): self.api = API(self._config['url'], media_cache=self.media_cache()) self.api.DEBUG = DEBUG self.signin() - self.profile = "%sp.webm" % max(self.api._config['video']['resolutions']) + self.profile = "%sp.webm" % max(self.site['video']['resolutions']) def signin(self): if 'username' in self._config: @@ -169,7 +169,7 @@ class Client(object): sys.exit() r = self.api.init() if r['status']['code'] == 200: - self.api._config = r['data']['site'] + self.site = r['data']['site'] return True def set_encodes(self, site, files): @@ -336,7 +336,7 @@ class Client(object): info = self.info(oshash) #print path.encode('utf-8') i = encode(path, self.media_cache(), self.profile, info, - self._config['media'].get('importFrames')) + self.site['media'].get('importFrames')) break def sync(self, args): @@ -517,13 +517,13 @@ class API(ox.API): def uploadVideo(self, filename, data, profile, info=None): i = encode(filename, self.media_cache, profile, info, - self._config['media'].get('importFrames')) + self.site['media'].get('importFrames')) if not i: print "failed" return #upload frames - if self._config['media'].get('importFrames'): + if self.site['media'].get('importFrames'): form = ox.MultiPartForm() form.add_field('action', 'upload') form.add_field('id', i['oshash'])