Skip to content
This repository

scrapyd command line #2

Merged
merged 5 commits into from about 1 year ago

2 participants

Jordi Llonch Daniel Graña
Jordi Llonch

No description provided.

Daniel Graña dangra merged commit da698b3 into from
Daniel Graña dangra closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
10  .gitignore
... ...
@@ -0,0 +1,10 @@
  1
+*.pyc
  2
+_trial_temp
  3
+dropin.cache
  4
+docs/build
  5
+*egg-info
  6
+.tox
  7
+venv
  8
+
  9
+dist
  10
+build
1  MANIFEST.in
@@ -7,4 +7,3 @@ recursive-include scrapyd/tests *.egg
7 7
 recursive-include docs *
8 8
 prune docs/build
9 9
 recursive-include extras *
10  
-recursive-include bin *
14  bin/scrapyd
... ...
@@ -1,14 +0,0 @@
1  
-#!/bin/sh
2  
-
3  
-repotac=$(cd $(dirname $0)/../extras; pwd)/scrapyd.tac
4  
-
5  
-if [ -f "$repotac" ]; then
6  
-    tacfile="$repotac"
7  
-elif [ -f "/usr/share/scrapyd/scrapyd.tac" ]; then
8  
-    tacfile="/usr/share/scrapyd/scrapyd.tac"
9  
-else
10  
-    echo "Unable to find scrapy.tac file"
11  
-    exit 1
12  
-fi
13  
-
14  
-twistd -ny "$tacfile"
6  scrapyd/script.py
@@ -9,6 +9,7 @@
9 9
 from twisted.application import app
10 10
 
11 11
 from scrapy.utils.project import project_data_dir
  12
+from scrapy.exceptions import NotConfigured
12 13
 
13 14
 from scrapyd import get_application
14 15
 from scrapyd.config import Config
@@ -35,7 +36,10 @@ def _get_config():
35 36
     return Config(extra_sources=[StringIO(scrapyd_conf)])
36 37
 
37 38
 def execute():
38  
-    config = _get_config()
  39
+    try:
  40
+        config = _get_config()
  41
+    except NotConfigured:
  42
+        config = None
39 43
     log.startLogging(sys.stderr)
40 44
     application = get_application(config)
41 45
     app.startApplication(application, False)
7  setup.py
@@ -114,7 +114,12 @@ def is_not_module(filename):
114 114
         'Topic :: Software Development :: Libraries :: Application Frameworks',
115 115
         'Topic :: Software Development :: Libraries :: Python Modules',
116 116
         'Topic :: Internet :: WWW/HTTP',
117  
-    ]
  117
+    ],
  118
+    'entry_points':{
  119
+        'console_scripts':[
  120
+            'scrapyd = scrapyd.script:execute',
  121
+        ]
  122
+    },
118 123
 }
119 124
 
120 125
 try:
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.