Fix whitespace and move config getting into try
This commit is contained in:
parent
5160fc64d7
commit
6e35cfb44b
1 changed files with 6 additions and 7 deletions
|
@ -61,14 +61,13 @@ class PypoFile(Thread):
|
||||||
self.logger.info("copying from %s to local cache %s" % (src, dst))
|
self.logger.info("copying from %s to local cache %s" % (src, dst))
|
||||||
|
|
||||||
CONFIG_SECTION = "general"
|
CONFIG_SECTION = "general"
|
||||||
|
try:
|
||||||
username = self._config.get(CONFIG_SECTION, 'api_key')
|
username = self._config.get(CONFIG_SECTION, 'api_key')
|
||||||
baseurl = self._config.get(CONFIG_SECTION, 'base_url')
|
baseurl = self._config.get(CONFIG_SECTION, 'base_url')
|
||||||
port = self._config.get(CONFIG_SECTION, 'base_port', 80)
|
port = self._config.get(CONFIG_SECTION, 'base_port', 80)
|
||||||
protocol = self._config.get(CONFIG_SECTION, 'protocol', str(("http", "https")[int(port) == 443]))
|
protocol = self._config.get(CONFIG_SECTION, 'protocol', str(("http", "https")[int(port) == 443]))
|
||||||
|
|
||||||
try:
|
|
||||||
host = [protocol, baseurl, port]
|
host = [protocol, baseurl, port]
|
||||||
|
|
||||||
url = "%s://%s:%s/rest/media/%s/download" % (host[0],
|
url = "%s://%s:%s/rest/media/%s/download" % (host[0],
|
||||||
host[1],
|
host[1],
|
||||||
host[2],
|
host[2],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue