summaryrefslogtreecommitdiff
path: root/lib/python2.7/site-packages/django/bin
diff options
context:
space:
mode:
authorttt2017-05-13 00:29:47 +0530
committerttt2017-05-13 00:29:47 +0530
commit4336f5f06f61de30ae3fa54650fce63a9d5ef5be (patch)
tree23b4ee9b8e8f24bf732acf2f7ad22ed50cdd5670 /lib/python2.7/site-packages/django/bin
downloadSBHS-2018-Rpi-4336f5f06f61de30ae3fa54650fce63a9d5ef5be.tar.gz
SBHS-2018-Rpi-4336f5f06f61de30ae3fa54650fce63a9d5ef5be.tar.bz2
SBHS-2018-Rpi-4336f5f06f61de30ae3fa54650fce63a9d5ef5be.zip
added all server files
Diffstat (limited to 'lib/python2.7/site-packages/django/bin')
-rw-r--r--lib/python2.7/site-packages/django/bin/daily_cleanup.py19
-rw-r--r--lib/python2.7/site-packages/django/bin/django-2to3.py10
-rw-r--r--lib/python2.7/site-packages/django/bin/django-admin.py5
-rw-r--r--lib/python2.7/site-packages/django/bin/profiling/__init__.py0
-rw-r--r--lib/python2.7/site-packages/django/bin/profiling/gather_profile_stats.py37
-rw-r--r--lib/python2.7/site-packages/django/bin/unique-messages.py29
6 files changed, 100 insertions, 0 deletions
diff --git a/lib/python2.7/site-packages/django/bin/daily_cleanup.py b/lib/python2.7/site-packages/django/bin/daily_cleanup.py
new file mode 100644
index 0000000..5a2ce21
--- /dev/null
+++ b/lib/python2.7/site-packages/django/bin/daily_cleanup.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+
+"""
+Daily cleanup job.
+
+Can be run as a cronjob to clean out old data from the database (only expired
+sessions at the moment).
+"""
+
+import warnings
+
+from django.core import management
+
+if __name__ == "__main__":
+ warnings.warn(
+ "The `daily_cleanup` script has been deprecated "
+ "in favor of `django-admin.py clearsessions`.",
+ DeprecationWarning)
+ management.call_command('clearsessions')
diff --git a/lib/python2.7/site-packages/django/bin/django-2to3.py b/lib/python2.7/site-packages/django/bin/django-2to3.py
new file mode 100644
index 0000000..35566ab
--- /dev/null
+++ b/lib/python2.7/site-packages/django/bin/django-2to3.py
@@ -0,0 +1,10 @@
+#!/usr/bin/env python
+
+# This works exactly like 2to3, except that it uses Django's fixers rather
+# than 2to3's built-in fixers.
+
+import sys
+from lib2to3.main import main
+
+sys.exit(main("django.utils.2to3_fixes"))
+
diff --git a/lib/python2.7/site-packages/django/bin/django-admin.py b/lib/python2.7/site-packages/django/bin/django-admin.py
new file mode 100644
index 0000000..f518cdc
--- /dev/null
+++ b/lib/python2.7/site-packages/django/bin/django-admin.py
@@ -0,0 +1,5 @@
+#!/usr/bin/env python
+from django.core import management
+
+if __name__ == "__main__":
+ management.execute_from_command_line()
diff --git a/lib/python2.7/site-packages/django/bin/profiling/__init__.py b/lib/python2.7/site-packages/django/bin/profiling/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/lib/python2.7/site-packages/django/bin/profiling/__init__.py
diff --git a/lib/python2.7/site-packages/django/bin/profiling/gather_profile_stats.py b/lib/python2.7/site-packages/django/bin/profiling/gather_profile_stats.py
new file mode 100644
index 0000000..0244eb6
--- /dev/null
+++ b/lib/python2.7/site-packages/django/bin/profiling/gather_profile_stats.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+
+"""
+gather_profile_stats.py /path/to/dir/of/profiles
+
+Note that the aggregated profiles must be read with pstats.Stats, not
+hotshot.stats (the formats are incompatible)
+"""
+
+from hotshot import stats
+import os
+import pstats
+import sys
+
+def gather_stats(p):
+ profiles = {}
+ for f in os.listdir(p):
+ if f.endswith('.agg.prof'):
+ path = f[:-9]
+ prof = pstats.Stats(os.path.join(p, f))
+ elif f.endswith('.prof'):
+ bits = f.split('.')
+ path = ".".join(bits[:-3])
+ prof = stats.load(os.path.join(p, f))
+ else:
+ continue
+ print("Processing %s" % f)
+ if path in profiles:
+ profiles[path].add(prof)
+ else:
+ profiles[path] = prof
+ os.unlink(os.path.join(p, f))
+ for (path, prof) in profiles.items():
+ prof.dump_stats(os.path.join(p, "%s.agg.prof" % path))
+
+if __name__ == '__main__':
+ gather_stats(sys.argv[1])
diff --git a/lib/python2.7/site-packages/django/bin/unique-messages.py b/lib/python2.7/site-packages/django/bin/unique-messages.py
new file mode 100644
index 0000000..d893291
--- /dev/null
+++ b/lib/python2.7/site-packages/django/bin/unique-messages.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+import os
+import sys
+
+def unique_messages():
+ basedir = None
+
+ if os.path.isdir(os.path.join('conf', 'locale')):
+ basedir = os.path.abspath(os.path.join('conf', 'locale'))
+ elif os.path.isdir('locale'):
+ basedir = os.path.abspath('locale')
+ else:
+ print("This script should be run from the Django Git tree or your project or app tree.")
+ sys.exit(1)
+
+ for (dirpath, dirnames, filenames) in os.walk(basedir):
+ for f in filenames:
+ if f.endswith('.po'):
+ sys.stderr.write('processing file %s in %s\n' % (f, dirpath))
+ pf = os.path.splitext(os.path.join(dirpath, f))[0]
+ cmd = 'msguniq "%s.po"' % pf
+ stdout = os.popen(cmd)
+ msg = stdout.read()
+ with open('%s.po' % pf, 'w') as fp:
+ fp.write(msg)
+
+if __name__ == "__main__":
+ unique_messages()