mirror of
				https://github.com/janeczku/calibre-web
				synced 2025-10-30 23:03:02 +00:00 
			
		
		
		
	Bugfix start as program
This commit is contained in:
		
							
								
								
									
										13
									
								
								cps.py
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								cps.py
									
									
									
									
									
								
							| @@ -20,16 +20,15 @@ | |||||||
| import os | import os | ||||||
| import sys | import sys | ||||||
|  |  | ||||||
| # Are we running from commandline? |  | ||||||
| if __package__ == '': |  | ||||||
|     # Add local path to sys.path so we can import cps |  | ||||||
|     path = os.path.dirname(os.path.dirname(__file__)) |  | ||||||
|     sys.path.insert(0, path) |  | ||||||
|  |  | ||||||
| from cps.main import main as _main | # Add local path to sys.path so we can import cps | ||||||
|  | path = os.path.dirname(os.path.abspath(__file__)) | ||||||
|  | sys.path.insert(0, path) | ||||||
|  |  | ||||||
|  | from cps.main import main | ||||||
|  |  | ||||||
| if __name__ == '__main__': | if __name__ == '__main__': | ||||||
|     _main() |     main() | ||||||
|  |  | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -19,6 +19,8 @@ | |||||||
| # | # | ||||||
| #  You should have received a copy of the GNU General Public License | #  You should have received a copy of the GNU General Public License | ||||||
| #  along with this program. If not, see <http://www.gnu.org/licenses/>. | #  along with this program. If not, see <http://www.gnu.org/licenses/>. | ||||||
|  | __package__ = "cps" | ||||||
|  |  | ||||||
| import sys | import sys | ||||||
| import os | import os | ||||||
| import mimetypes | import mimetypes | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Ozzie Isaacs
					Ozzie Isaacs