Update Updater
Bugfix author in opds-feed
This commit is contained in:
		
							parent
							
								
									c1818e8f36
								
							
						
					
					
						commit
						cc7dcfb35a
					
				
							
								
								
									
										7
									
								
								cps/helper.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							
							
						
						
									
										7
									
								
								cps/helper.py
									
									
									
									
									
										
										
										Executable file → Normal file
									
								
							| 
						 | 
					@ -399,15 +399,12 @@ class Updater(threading.Thread):
 | 
				
			||||||
            z.extractall(tmp_dir)
 | 
					            z.extractall(tmp_dir)
 | 
				
			||||||
            self.status = 4
 | 
					            self.status = 4
 | 
				
			||||||
            self.update_source(os.path.join(tmp_dir, os.path.splitext(fname)[0]), ub.config.get_main_dir)
 | 
					            self.update_source(os.path.join(tmp_dir, os.path.splitext(fname)[0]), ub.config.get_main_dir)
 | 
				
			||||||
            self.status = 5
 | 
					 | 
				
			||||||
            db.session.close()
 | 
					 | 
				
			||||||
            db.engine.dispose()
 | 
					 | 
				
			||||||
            ub.session.close()
 | 
					 | 
				
			||||||
            ub.engine.dispose()
 | 
					 | 
				
			||||||
            self.status = 6
 | 
					            self.status = 6
 | 
				
			||||||
 | 
					            time.sleep(2)
 | 
				
			||||||
            server.Server.setRestartTyp(True)
 | 
					            server.Server.setRestartTyp(True)
 | 
				
			||||||
            server.Server.stopServer()
 | 
					            server.Server.stopServer()
 | 
				
			||||||
            self.status = 7
 | 
					            self.status = 7
 | 
				
			||||||
 | 
					            time.sleep(2)
 | 
				
			||||||
        except requests.exceptions.HTTPError as ex:
 | 
					        except requests.exceptions.HTTPError as ex:
 | 
				
			||||||
            logging.getLogger('cps.web').info( u'HTTP Error' + ' ' + str(ex))
 | 
					            logging.getLogger('cps.web').info( u'HTTP Error' + ' ' + str(ex))
 | 
				
			||||||
            self.status = 8
 | 
					            self.status = 8
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,11 +43,12 @@
 | 
				
			||||||
    <title>{{entry.title}}</title>
 | 
					    <title>{{entry.title}}</title>
 | 
				
			||||||
    <id>{{entry.uuid}}</id>
 | 
					    <id>{{entry.uuid}}</id>
 | 
				
			||||||
    <updated>{{entry.atom_timestamp}}</updated>
 | 
					    <updated>{{entry.atom_timestamp}}</updated>
 | 
				
			||||||
    <author>
 | 
					    {% if entry.authors.__len__() > 0 %}
 | 
				
			||||||
      <name>{{entry.authors[0].name}}</name>
 | 
					      <author>
 | 
				
			||||||
    </author>
 | 
					        <name>{{entry.authors[0].name}}</name>
 | 
				
			||||||
 | 
					      </author>
 | 
				
			||||||
    {% if publishers.__len__() > 0 %}
 | 
					    {% endif %}
 | 
				
			||||||
 | 
					    {% if entry.publishers.__len__() > 0 %}
 | 
				
			||||||
      <publisher>
 | 
					      <publisher>
 | 
				
			||||||
        <name>{{entry.publishers[0].name}}</name>
 | 
					        <name>{{entry.publishers[0].name}}</name>
 | 
				
			||||||
      </publisher>
 | 
					      </publisher>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1289,9 +1289,9 @@ def get_updater_status():
 | 
				
			||||||
                "1": _(u'Requesting update package'),
 | 
					                "1": _(u'Requesting update package'),
 | 
				
			||||||
                "2": _(u'Downloading update package'),
 | 
					                "2": _(u'Downloading update package'),
 | 
				
			||||||
                "3": _(u'Unzipping update package'),
 | 
					                "3": _(u'Unzipping update package'),
 | 
				
			||||||
                "4": _(u'Files are replaced'),
 | 
					                "4": _(u'Replacing files'),
 | 
				
			||||||
                "5": _(u'Database connections are closed'),
 | 
					                "5": _(u'Database connections are closed'),
 | 
				
			||||||
                "6": _(u'Server is stopped'),
 | 
					                "6": _(u'Stopping server'),
 | 
				
			||||||
                "7": _(u'Update finished, please press okay and reload page'),
 | 
					                "7": _(u'Update finished, please press okay and reload page'),
 | 
				
			||||||
                "8": _(u'Update failed:') + u' ' + _(u'HTTP Error'),
 | 
					                "8": _(u'Update failed:') + u' ' + _(u'HTTP Error'),
 | 
				
			||||||
                "9": _(u'Update failed:') + u' ' + _(u'Connection error'),
 | 
					                "9": _(u'Update failed:') + u' ' + _(u'Connection error'),
 | 
				
			||||||
| 
						 | 
					@ -1305,8 +1305,9 @@ def get_updater_status():
 | 
				
			||||||
    elif request.method == "GET":
 | 
					    elif request.method == "GET":
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            status['status'] = helper.updater_thread.get_update_status()
 | 
					            status['status'] = helper.updater_thread.get_update_status()
 | 
				
			||||||
        except Exception:
 | 
					        except Exception as e:
 | 
				
			||||||
            status['status'] = 11
 | 
					            app.logger.exception(e)
 | 
				
			||||||
 | 
					            status['status'] = 7
 | 
				
			||||||
    return json.dumps(status)
 | 
					    return json.dumps(status)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user