This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@deconstructible | |
class RandomFileName(object): | |
def __init__(self, path): | |
self.path = os.path.join(path, "%s%s") | |
def __call__(self, _, filename): | |
extension = os.path.splitext(filename)[1] | |
return self.path % (uuid.uuid4(), extension) | |
image = models.ImageField(verbose_name=_('Image'), upload_to=RandomFileName('backgrounds'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
from subprocess import Popen | |
from os import path | |
from platform import system | |
from uuid import uuid4 | |
def run_game(game_path, game_data, main_class, version, uuid=str(uuid4()), xmx=1024, max_perm_size=128, more=list()): | |
""" |
NewerOlder