def set_useragent(app, version, contact=None):
 global _useragent, _client
 if ((not app) or (not version)):
  raise ValueError('App and version can not be empty')
 if (contact is not None):
  _useragent = ('%s/%s python-musicbrainzngs/%s ( %s )' % (app, version, _version, contact))
 else:
  _useragent = ('%s/%s python-musicbrainzngs/%s' % (app, version, _version))
 _client = ('%s-%s' % (app, version))
 _log.debug(('set user-agent to %s' % _useragent))

def set_useragent ( app , version , contact = None ) : global _useragent , _client if ( ( not app ) or ( not version ) ) : raise ValueError ( 'App and version can not be empty' ) if ( contact is not None ) : _useragent = ( '%s/%s python-musicbrainzngs/%s ( %s )' % ( app , version , _version , contact ) ) else : _useragent = ( '%s/%s python-musicbrainzngs/%s' % ( app , version , _version ) ) _client = ( '%s-%s' % ( app , version ) ) _log . debug ( ( 'set user-agent to %s' % _useragent ) )
set the user-agent to be used for requests to the musicbrainz webservice .