https://github.com/allejo/bzelectron
A quick BZFlag group perms compiler
https://github.com/allejo/bzelectron
Last synced: 3 months ago
JSON representation
A quick BZFlag group perms compiler
- Host: GitHub
- URL: https://github.com/allejo/bzelectron
- Owner: allejo
- Created: 2015-09-17T01:25:56.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-02-22T00:28:05.000Z (over 9 years ago)
- Last Synced: 2025-01-15T03:05:20.983Z (5 months ago)
- Language: Python
- Size: 13.7 KB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# bzelectron
Meet bzelectron, the first successful child of my [/dev/null](https://github.com/allejo/dev-null) repository. Maintaining several different BZFlag servers requires some form of automation especially when a lot of the servers require different group permission files; e.g. you're running public servers, league servers, private servers.
I noticed that a lot of my permission files shared a lot of similarities, so I thought of a way to "compile" partial group permission files into a single one. Inspired by Sass, the syntax for bzelectron is very similar as well.
This is one of my first few real projects in Python so it may not be the most amazing script but it works as long as you're not dumb enough to mess up the syntax.
## Author
Vladimir "allejo" Jimenez
## Syntax
So what's the syntax look like? Well it's similar to [Sass](http://sass-lang.com) and [YAML](http://yaml.org) combined.
**partials/everyone.pgrp**
```
EVERYONE
+SPAWN
+TALK
````**public.pgrp**
```
$prefix = "ALLEJO"@include partials/everyone.pgrp
VERIFIED
@extend EVERYONE
+REPORT$prefix.COP
+KICK$prefix.ADMIN
@extend $prefix.COP+BAN
```**public_match.pgrp**
```
@include public.pgrp# Public FMs are allowed, so let everyone /countdown but still keep
# the same permissions as my public servers
EVERYONE
+COUNTDOWN
```## Usage
Ok. You may have sold me on this, but how do I use it?
```
python bzelectron.py -i public_match.pgrp
```The `-i` flag tells bzelectron which file to compile. There is an optional `-o` flag specifies the output file; if this is not set, then it will take the same file name and an append an ".groupdb" extension. **Warning:** Do not name your partial bzelectron files with a ".groupdb" extension as bzelectron uses that extension for compiled files.
## License
MIT