<commit_before>from setuptools import setup
from subprocess import call
import os
import sys
from glob import glob

install_args = ['install', 'install_data', 'develop']

# XXX Definitely not the best way of doing this...
if sys.argv[1] in install_args and "--no-init-script" not in sys.argv:
    data_files = [('/etc/default', ['install/conf/airtime-celery']),
                  ('/etc/init.d', ['install/initd/airtime-celery'])]
else:
    data_files = []


def postinst():
    print "Reloading initctl configuration"
    call(['initctl', 'reload-configuration'])
    # Make /etc/init.d file executable and set proper
    # permissions for the defaults config file
    os.chmod('/etc/init.d/airtime-celery', 0755)
    os.chmod('/etc/default/airtime-celery', 0640)
    # print "Setting Celery to start on boot"
    call(['update-rc.d', 'airtime-celery', 'defaults'])
    print "Run \"sudo service airtime-celery restart\" now."

setup(name='airtime-celery',
      version='0.1',
      description='Airtime Celery service',
      url='http://github.com/sourcefabric/Airtime',
      author='Sourcefabric',
      author_email='<EMAIL>',
      license='MIT',
      packages=['airtime-celery'],
      install_requires=[
          'soundcloud',
          'celery',
          'kombu'
      ],
      zip_safe=False,
      data_files=data_files)
<commit_msg>Run initctl and update rc.d when using --no-init-script<commit_after>from setuptools import setup
from subprocess import call
import os
import sys
from glob import glob

install_args = ['install', 'install_data', 'develop']

# XXX Definitely not the best way of doing this...
if sys.argv[1] in install_args and "--no-init-script" not in sys.argv:
    data_files = [('/etc/default', ['install/conf/airtime-celery']),
                  ('/etc/init.d', ['install/initd/airtime-celery'])]
else:
    data_files = []


def postinst():
    # Make /etc/init.d file executable and set proper
    # permissions for the defaults config file
    os.chmod('/etc/init.d/airtime-celery', 0755)
    os.chmod('/etc/default/airtime-celery', 0640)
    print "Run \"sudo service airtime-celery restart\" now."

setup(name='airtime-celery',
      version='0.1',
      description='Airtime Celery service',
      url='http://github.com/sourcefabric/Airtime',
      author='Sourcefabric',
      author_email='<EMAIL>',
      license='MIT',
      packages=['airtime-celery'],
      install_requires=[
          'soundcloud',
          'celery',
          'kombu'
      ],
      zip_safe=False,
      data_files=data_files)

print "Reloading initctl configuration"
call(['initctl', 'reload-configuration'])
print "Setting Celery to start on boot"
call(['update-rc.d', 'airtime-celery', 'defaults'])

{'fraction_non_alphanumeric': 0.144693352919574, 'fraction_numerical': 0.008079324274697026, 'mean_word_length': 3.2102009273570324, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6797208', 'n_tokens_mistral': 872, 'n_tokens_neox': 845, 'n_words': 213}