added framebuffer open script; changed README to markdown
This commit is contained in:
parent
94df562b51
commit
398d9f224e
|
@ -0,0 +1,47 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
import os
|
||||||
|
from os import environ, execvp, chdir, getcwd
|
||||||
|
from os.path import exists, join, dirname
|
||||||
|
from sys import version_info, argv
|
||||||
|
|
||||||
|
def can_import(module_name):
|
||||||
|
try:
|
||||||
|
__import__(module_name)
|
||||||
|
except ImportError:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
|
return True
|
||||||
|
|
||||||
|
def is_python_3():
|
||||||
|
return version_info[0] >= 3
|
||||||
|
|
||||||
|
def is_current_version(file_name):
|
||||||
|
version = map(int, file_name.replace("python", "").split("."))
|
||||||
|
return version == list(version_info)[:2]
|
||||||
|
|
||||||
|
def launch_alternative(alternatives):
|
||||||
|
for alternative in alternatives:
|
||||||
|
if not is_current_version(alternative):
|
||||||
|
for root in environ["PATH"].split(":"):
|
||||||
|
if exists(join(root, alternative)):
|
||||||
|
execvp(alternative, [alternative] + argv)
|
||||||
|
|
||||||
|
def move_to_executable():
|
||||||
|
chdir(dirname(argv[0]))
|
||||||
|
|
||||||
|
if is_python_3():
|
||||||
|
launch_alternative(["python2", "python2.7", "python2.6"])
|
||||||
|
|
||||||
|
if not can_import("pygame"):
|
||||||
|
launch_alternative(["python2.7", "python2.6"])
|
||||||
|
|
||||||
|
if "--go-to-dir" in argv:
|
||||||
|
move_to_executable()
|
||||||
|
|
||||||
|
from electric_sieve.ElectricSieve import ElectricSieve
|
||||||
|
|
||||||
|
os.putenv("SDL_FBDEV", "/dev/fb0")
|
||||||
|
os.putenv("SDL_VIDEODRIVER", "fbcon")
|
||||||
|
os.putenv("SDL_NOMOUSE", "1")
|
||||||
|
ElectricSieve().run()
|
|
@ -1,22 +1,23 @@
|
||||||
==============
|
|
||||||
Electric Sieve
|
Electric Sieve
|
||||||
==============
|
==============
|
||||||
|
|
||||||
Avoid touching the triangles with the rods. Chain successes to send
|
Avoid touching the triangles with the rods. Chain successes to send acid deeper into the Earth.
|
||||||
acid deeper into the Earth.
|
|
||||||
|
|
||||||
Controls
|
Controls
|
||||||
````````
|
--------
|
||||||
|
|
||||||
L/R --- Scroll sieve
|
L/R --- Scroll sieve
|
||||||
Down -- Increase fall speed
|
Down -- Increase fall speed
|
||||||
F11 --- Full screen
|
F11 --- Full screen
|
||||||
|
|
||||||
Requirements
|
Requirements
|
||||||
````````````
|
------------
|
||||||
|
|
||||||
Windows ---- none
|
Windows ---- none
|
||||||
Linux/Mac -- Python 2.6+, Pygame 1.8.1+
|
Linux/Mac -- Python 2.6+, Pygame 1.8.1+
|
||||||
|
|
||||||
Running
|
Running
|
||||||
```````
|
-------
|
||||||
|
|
||||||
Windows ---- double-click "scale-sieve" EXE
|
Windows ---- double-click "scale-sieve" EXE
|
||||||
Linux/Mac -- run "./scale-sieve" on the command line
|
Linux/Mac -- run "./scale-sieve" on the command line
|
|
@ -118,3 +118,4 @@
|
||||||
1522825023.01 199 HI-
|
1522825023.01 199 HI-
|
||||||
1523576335.0 34 ---
|
1523576335.0 34 ---
|
||||||
1529983381.92 171 BUG
|
1529983381.92 171 BUG
|
||||||
|
1586137469.11 247 NUT
|
||||||
|
|
Loading…
Reference in New Issue