Commits

Josh VanderLinden committed f10df8f

Trying to get the desktop repo back in sync

  • Participants
  • Parent commits 7ba980e

Comments (0)

Files changed (4)

File clip2zeus/__init__.py

 APP_TITLE = 'Clip2Zeus'
 __author__ = 'Josh VanderLinden'
-__version__ = '1.2a'
+__version__ = '1.3a'
 

File clip2zeus/common.py

 
         if self.last_check is None or now - self.last_check > self.threshold:
             try:
-                urllib2.urlopen('http://2ze.us/')
+                UrlOpener.open('http://2ze.us/')
             except (urllib2.HTTPError, urllib2.URLError):
                 self._has_connection = False
             else:
 
                 try:
                     logger.info(' - %s' % url)
-                    c = urllib2.urlopen('http://2ze.us/generate/', params)
+                    c = UrlOpener.open('http://2ze.us/generate/', params)
                 except (urllib2.HTTPError, urllib2.URLError):
                     # do something?
                     update_data = False

File clip2zeus/globals.py

 from SimpleXMLRPCServer import SimpleXMLRPCServer
 import logging
 import socket
+import urllib2
+
+from clip2zeus import __version__
+
+USER_AGENT = 'Clip2Zeus %s' % __version__
+
+UrlOpener = urllib2.build_opener()
+UrlOpener.addheaders = [
+    ('User-agent', USER_AGENT),
+]
 
 #
 # Utilities
     **extra
 )
 
+