Ejecutable en windows

Modificaciones para crear el ejecutable en windows
This commit is contained in:
Intel1
2018-08-14 15:47:35 -05:00
parent 4ac77a3307
commit 9929913a48
6 changed files with 30 additions and 3 deletions
+2
View File
@@ -1,10 +1,12 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import os
import random import random
import re import re
import threading import threading
import time import time
import traceback import traceback
from platformcode import platformtools
from BaseHTTPServer import HTTPServer from BaseHTTPServer import HTTPServer
from HTTPWebSocketsHandler import HTTPWebSocketsHandler from HTTPWebSocketsHandler import HTTPWebSocketsHandler
+2
View File
@@ -8,6 +8,8 @@ import sys
import threading import threading
import time import time
from functools import wraps from functools import wraps
# Requerido para el ejecutable en windows
import SimpleHTTPServer
sys.dont_write_bytecode = True sys.dont_write_bytecode = True
from platformcode import config from platformcode import config
+5
View File
@@ -0,0 +1,5 @@
REM Genera los archivos para el ejecutable en windows de Alfa Mediaserver
python setup.py py2exe -p channels,servers,lib,platformcode
xcopy lib dist\lib /y /s /i
xcopy platformcode dist\platformcode /y /s /i
xcopy resources dist\resources /y /s /i
+1 -1
View File
@@ -14,7 +14,7 @@ settings_dic = {}
adult_setting = {} adult_setting = {}
def get_addon_version(linea_inicio=0, total_lineas=2): def get_addon_version(linea_inicio=0, total_lineas=2, with_fix=False):
''' '''
Devuelve el número de de versión del addon, obtenido desde el archivo addon.xml Devuelve el número de de versión del addon, obtenido desde el archivo addon.xml
''' '''
@@ -7,12 +7,12 @@ import os
from inspect import isclass from inspect import isclass
from controller import Controller from controller import Controller
from platformcode import logger from platformcode import config, logger
def load_controllers(): def load_controllers():
controllers = [] controllers = []
path = os.path.split(__file__)[0] path = os.path.join(config.get_runtime_path(),"platformcode\controllers")
for fname in os.listdir(path): for fname in os.listdir(path):
mod, ext = os.path.splitext(fname) mod, ext = os.path.splitext(fname)
fname = os.path.join(path, fname) fname = os.path.join(path, fname)
+18
View File
@@ -0,0 +1,18 @@
# setup.py
# Para crear el ejecutable de Alfa mediaserver en windows
# Se usa py2exe
# Linea de comandos para la creacion: python setup.py py2exe -p channels,servers,lib,platformcode
from distutils.core import setup
import glob
import py2exe
setup(packages=['channels','servers','lib','platformcode','platformcode/controllers'],
data_files=[("channels",glob.glob("channels\\*.py")),
("channels",glob.glob("channels\\*.json")),
("servers",glob.glob("servers\\*.py")),
("servers",glob.glob("servers\\*.json")),
("",glob.glob("addon.xml")),
],
console=["alfa.py"]
)