Commits

Gregory Petukhov committed 3904d63

Write setup file

Comments (0)

Files changed (3)

 *.swp
 *.swo
 *.orig
+*.egg-info
 
 # Project specific
 pip-log.txt
+#!/usr/bin/env python
+from setuptools import setup, find_packages
+
+setup(
+    name = 'typhoon',
+    description = 'Private seo-tool for bulk linking',
+    version = '0.0.1',
+    author = 'Grigoriy Petukhov',
+    author_email = 'lorien@lorien.name',
+    url = 'http://bitbucket.org/lorien/typhoon/',
+
+    packages = find_packages(),
+    include_package_data = True,
+
+    license = "BSD",
+    keywords = "django filter seo development",
+    classifiers=[
+        'Development Status :: 4 - Beta',
+        'Environment :: Web Environment',
+        'Framework :: Django',
+        'Intended Audience :: Developers',
+        'License :: OSI Approved :: BSD License',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python',
+        'Topic :: Software Development :: Libraries :: Python Modules',
+    ],
+)

typhoon/templatetags/typhoon_tags.py

         try:
             item = dbpage[urlhash]
         except KeyError:
-            # Avoid multithreaded access to page database
-            lock = open(LOCK_FILE, 'w')
-            flock(lock.fileno(), LOCK_EX)
 
             text1 = dbtext[str(randint(0, dbtext_size - 1))] 
             text2 = dbtext[str(randint(0, dbtext_size - 1))] 
             target = dbtarget[str(randint(0, dbtarget_size - 1))]
             url, key = target.split('|', 1)
             item = ' %s <a href="%s">%s</a> %s. ' % (text1, url, key, text2)
+
+            # Avoid multithreaded access to page database
+            lock = open(LOCK_FILE, 'w')
+            flock(lock.fileno(), LOCK_EX)
+
             dbpage[urlhash] = item
 
             # Release the lock