File tree Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Expand file tree Collapse file tree 4 files changed +17
-5
lines changed Original file line number Diff line number Diff line change @@ -958,10 +958,15 @@ def ask_for_token(json_config):
958958            config_file .write (json .dumps (token_config , indent = False ))
959959            json_config .update (token_config )
960960
961- if   __name__   ==   '__main__' :
961+ def   run () :
962962    json_config  =  {}
963-     with  open ('./config.json' , 'r' ) as  config_file :
963+     config_file  =  os .path .join (
964+         os .path .dirname (os .path .realpath (__file__ )), 'config.json' )
965+     with  open (config_file , 'r' ) as  config_file :
964966        json_config .update (json .load (config_file ))
965967    ask_for_token (json_config )
966968    app  =  App (json_config )
967969    app .start ()
970+ 
971+ if  __name__  ==  '__main__' :
972+     run ()
File renamed without changes.
Original file line number Diff line number Diff line change 1212    author = 'Marcelo Camargo' ,
1313    author_email = 'marcelocamargo@linuxmail.org' ,
1414    url = 'https://github.com/haskellcamargo/sclack' ,
15-     scripts = ["app.py" ],
15+     entry_points = {
16+         'console_scripts' : [
17+             'sclack=sclack.app:run' ,
18+         ],
19+     },
20+     package_data = {
21+         'sclack' : ['config.json' ]
22+     },
1623    packages = find_packages (),
1724    install_requires = [
1825        'asyncio' ,
Original file line number Diff line number Diff line change 11from  sclack .quick_switcher  import  remove_diacritic 
2- from  app  import  ask_for_token 
2+ from  sclack . app  import  ask_for_token 
33
44from  slackclient  import  SlackClient 
55
@@ -58,4 +58,4 @@ def test_get_members_pagination2():
5858            limit = 10 ,  # 1k is max limit 
5959            types = 'public_channel,private_channel,im' )
6060    members  =  client .api_call ('conversations.members' , channel = channels ['channels' ][0 ]['id' ], limit = 1 )
61-     assert  members  !=  None  and  members .get ('response_metadata' , None ) !=  None 
61+     assert  members  !=  None  and  members .get ('response_metadata' , None ) !=  None 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments