mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Add note to top of generated ini files
This commit is contained in:
@@ -73,11 +73,16 @@ clean_i18n:
|
||||
UPDATE_FILES := $(wildcard *.update)
|
||||
INIFILES := $(UPDATE_FILES:.update=.ini)
|
||||
|
||||
.PHONY: clean_ini
|
||||
|
||||
ini: $(INIFILES)
|
||||
|
||||
$(INIFILES): %.ini: %.update
|
||||
./updateini.py example.ini $< > $@ || rm $@
|
||||
|
||||
clean_ini:
|
||||
rm $(INIFILES)
|
||||
|
||||
#################### Static Files
|
||||
STATIC_DIR := r2/public/static
|
||||
|
||||
|
||||
@@ -1,3 +1,13 @@
|
||||
# DO NOT EDIT THIS FILE
|
||||
# This is a base template. To apply changes to your
|
||||
# reddit instance, create a "myreddit.update" config
|
||||
# file, then run 'make ini'. 'make ini' will combine
|
||||
# this template with the myreddit.update file and create a
|
||||
# 'myreddit.ini'. ('myreddit.update' is just an example;
|
||||
# any name will do - e.g., 'foo.update' will create
|
||||
# 'foo.ini')
|
||||
|
||||
|
||||
#
|
||||
# r2 - Pylons development environment configuration
|
||||
#
|
||||
|
||||
@@ -4,6 +4,15 @@ from ConfigParser import MissingSectionHeaderError
|
||||
from StringIO import StringIO
|
||||
import sys
|
||||
|
||||
HEADER = '''
|
||||
# YOU DO NOT NEED TO EDIT THIS FILE
|
||||
# This is a generated file. To update the configuration,
|
||||
# edit the *.update file of the same name, and then
|
||||
# run 'make ini'
|
||||
# Configuration settings in the *.update file will override
|
||||
# or be added to the base 'example.ini' file.
|
||||
'''
|
||||
|
||||
def main(source_ini, update_ini):
|
||||
parser = Parser()
|
||||
# By default, the parser is case insensitve and rewrites config
|
||||
@@ -24,6 +33,7 @@ def main(source_ini, update_ini):
|
||||
except MissingSectionHeaderError:
|
||||
updates = "[DEFAULT]\n" + updates
|
||||
parser.readfp(StringIO(updates))
|
||||
print HEADER
|
||||
parser.write(sys.stdout)
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user