The file() builtin function was removed in Python 3, see
https://docs.python.org/release/3.0/whatsnew/3.0.html#builtins
Fixes:
| NameError: name 'file' is not defined
-XORG_CONF_HEADER = "# Automatically generated by grml-x."
+XORG_CONF_HEADER = "# Automatically generated by grml-x.\n"
def check_old_xorg_conf(filename, overwrite):
# True: no problem, we can create/overwrite the config file
# False: pre-existing config file, and we are not to overwrite it
if overwrite: return True
if not os.path.exists(filename): return True
try:
def check_old_xorg_conf(filename, overwrite):
# True: no problem, we can create/overwrite the config file
# False: pre-existing config file, and we are not to overwrite it
if overwrite: return True
if not os.path.exists(filename): return True
try:
- f = file(filename, 'r')
+ f = open(filename, 'r')
lines = f.readlines()
f.close()
return (not XORG_CONF_HEADER in lines)
lines = f.readlines()
f.close()
return (not XORG_CONF_HEADER in lines)
if monitor or device or len(screen.data) > 0 or screen.subsect != '':
try:
f = tempfile.NamedTemporaryFile(mode='w+', delete=False)
if monitor or device or len(screen.data) > 0 or screen.subsect != '':
try:
f = tempfile.NamedTemporaryFile(mode='w+', delete=False)
- f.write(XORG_CONF_HEADER + "\n")
+ f.write(XORG_CONF_HEADER)
f.write("# DO NOT MODIFY, YOUR CHANGES WILL BE LOST - OR REMOVE ALL HEADER LINES\n")
f.write("# See man xorg.conf or /etc/X11/xorg.conf.example for more\n")
if monitor: f.write(str(monitor))
f.write("# DO NOT MODIFY, YOUR CHANGES WILL BE LOST - OR REMOVE ALL HEADER LINES\n")
f.write("# See man xorg.conf or /etc/X11/xorg.conf.example for more\n")
if monitor: f.write(str(monitor))