Skip to content

Commit 3822593

Browse files
committed
Remove hipster f-strings so lower python version is supported
1 parent fd2aed9 commit 3822593

File tree

13 files changed

+23
-28
lines changed

13 files changed

+23
-28
lines changed

README.rst

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -35,22 +35,15 @@ worst thing that can happen is that we or you might learn something.
3535
This is supposed to be a fun project.
3636

3737
Also check out the `TODO list <TODO.md>`__. Take a stab on what of the
38-
features or documentation or suggest new entires.
38+
features or documentation or suggest new entries.
3939

4040
Running the damned thing
4141
------------------------
4242

43-
- First of all install the latest python 3.6 package (or later) from python.org
43+
- First of all make sure you have python3 installed
4444
- Install GLFW binaries for your OS from your favorite package manger or download it from http://www.glfw.org/
4545
- If you want working music you will also need to install SDL
46-
- Make a virtualenv and install the package: ``pip install demosys-py``.
47-
- Run the default test effect: ``demosys_test runeffect demosys_test.cube``
4846

49-
50-
Running from source
51-
-------------------
52-
53-
Again, make sure you have python 3.6 or later before proceeding.
5447
Let's clone the testdemo project.
5548

5649
::
@@ -143,7 +136,8 @@ There you go.
143136
look at shaders in the testdemo_.
144137
- You currently define vertex,
145138
fragment and geometry shader in one glsl file separated by
146-
preprocessors. - Effects not defined in the ``settings.py`` module will not run.
139+
preprocessors.
140+
- Effects not defined in the ``settings.py`` module will not run.
147141

148142
That should give you an idea..
149143

@@ -186,8 +180,8 @@ Some babble about the current state of the project:
186180
This will return a lazy object that will be populated after the loading
187181
stage is done.
188182
- Resources shared between effects can be put outside effect packages
189-
inside your project directory. For example in ``testproject/resources/shaders``
190-
and ``testproject/resources/textures``. Make sure you add those paths in the
183+
inside your project directory. For example in ``testdemo/resources/shaders``
184+
and ``testdemo/resources/textures``. Make sure you add those paths in the
191185
settings file.
192186
- We don't have any scene/mesh loaders. You can hack something in yourself
193187
for now or just stick to or extend the ``geometry`` module. - We try to

demosys/conf/settingsfile.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ def create(settings):
1616
data += "%s = {\n%s\n}\n\n" % (name, value)
1717
elif isinstance(value, tuple):
1818
value = ",\n".join(" {}".format(to_s(v)) for v in value)
19-
data += f"{name} = (\n{value})\n\n"
19+
data += "{} = (\n{})\n\n".format(name, value)
2020
elif value is None:
21-
data += f"{name} = {value}\n\n"
21+
data += "{} = {}\n\n".format(name, value)
2222

2323
return data
2424

2525

2626
def to_s(t):
2727
if isinstance(t, str):
28-
return f'"{t}"'
28+
return '"{}"'.format(t)
2929
else:
3030
return str(t)

demosys/core/management/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def local_command_dir():
2020

2121

2222
def load_command_class(app_name, name):
23-
module = import_module(f'{app_name}.management.commands.{name}')
23+
module = import_module('{}.management.commands.{}'.format(app_name, name))
2424
return module.Command()
2525

2626

@@ -41,4 +41,4 @@ def execute_from_command_line(argv=None):
4141
else:
4242
print("Available commands:")
4343
for c in commands:
44-
print(f" - {c}")
44+
print(" - {}".format(c))

demosys/core/management/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def validate_name(self, name):
5252

5353
# Can the name be used as an identifier in python (module or package name)
5454
if not name.isidentifier():
55-
raise ValueError(f"{name} is not a valid identifier")
55+
raise ValueError("{} is not a valid identifier".format(name))
5656

5757
def try_import(self, name):
5858
"""Attemt to import the name"""
@@ -61,4 +61,4 @@ def try_import(self, name):
6161
except ImportError:
6262
pass
6363
else:
64-
raise ValueError(f"{name} conflicts with an existing python module")
64+
raise ValueError("{} conflicts with an existing python module".format(name))

demosys/core/management/commands/createeffect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def handle(self, *args, **options):
1919

2020
# Make sure we don't mess with existing directories
2121
if os.path.exists(name):
22-
print(f"Directory {name} already exist. Aborting.")
22+
print("Directory {} already exist. Aborting.".format(name))
2323
return
2424

2525
os.mkdir(name)

demosys/core/management/commands/createproject.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ def handle(self, *args, **options):
1919

2020
# Make sure we don't mess with existing directories
2121
if os.path.exists(name):
22-
print(f"Directory {name} already exist. Aborting.")
22+
print("Directory {} already exist. Aborting.".format(name))
2323
return
2424

2525
manage_file = 'manage.py'

demosys/core/shaderfiles/finders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ def get_finders():
4444
def get_finder(import_path):
4545
Finder = import_string(import_path)
4646
if not issubclass(Finder, finders.FileSystemFinder):
47-
raise ImproperlyConfigured(f'Finder {import_path} is not a subclass of core.finders.FileSystemFinder')
47+
raise ImproperlyConfigured('Finder {} is not a subclass of core.finders.FileSystemFinder'.format(import_path))
4848
return Finder()

demosys/core/texturefiles/finders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ def get_finders():
4444
def get_finder(import_path):
4545
Finder = import_string(import_path)
4646
if not issubclass(Finder, finders.FileSystemFinder):
47-
raise ImproperlyConfigured(f'Finder {import_path} is not a subclass of core.finders.FileSystemFinder')
47+
raise ImproperlyConfigured('Finder {} is not a subclass of core.finders.FileSystemFinder'.format(import_path))
4848
return Finder()

demosys/effects/registry.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ def get_dirs(self):
3535
def polulate(self, effect_list):
3636
"""Find all effects"""
3737
for effect in effect_list:
38-
name = f'{effect}.{EFFECT_MODULE}'
38+
name = '{}.{}'.format(effect, EFFECT_MODULE)
3939
module, cls = self.get_effect_cls(name)
4040
if cls:
4141
cls.name = effect
4242
self.effects[module.__name__] = EffectConfig(module=module, cls=cls)
4343
else:
44-
raise EffectError(f"Effect '{effect}' has no effect class")
44+
raise EffectError("Effect '{}' has no effect class".format(effect))
4545

4646
def get_effect_cls(self, module_name):
4747
"""Find and return an effect class in a module

demosys/resources/shaders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def load(self):
3131
shader.prepare()
3232
break
3333
else:
34-
raise ImproperlyConfigured(f"Cannot find shader {name}")
34+
raise ImproperlyConfigured("Cannot find shader {}".format(name))
3535

3636

3737
shaders = Shaders()

demosys/resources/textures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def load(self):
3232
texture.set_image(image)
3333
break
3434
else:
35-
raise ImproperlyConfigured(f"Cannot find texture {name}")
35+
raise ImproperlyConfigured("Cannot find texture {name}")
3636

3737

3838
textures = Textures()

demosys/view/controller.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def run(manager=None):
4343

4444
# Load resources
4545
num_resources = resources.count()
46-
print(f"Loading {num_resources } resources")
46+
print("Loading {} resources".format(num_resources))
4747
resources.load()
4848

4949
# Post-Load actions for effects

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
'Intended Audience :: Developers',
2121
'Topic :: Multimedia :: Graphics',
2222
'License :: OSI Approved :: MIT License',
23+
'Programming Language :: Python :: 3',
2324
'Programming Language :: Python :: 3.6',
2425
'Topic :: Software Development :: Libraries :: Application Frameworks',
2526
],

0 commit comments

Comments
 (0)