~sp00n1na70r/quickly/quickly

« back to all changes in this revision

Viewing changes to quickly/api.py

  • Committer: Didier Roche
  • Date: 2012-07-16 08:58:25 UTC
  • mfrom: (675.3.1 quickly)
  • Revision ID: didrocks@ubuntu.com-20120716085825-3hz7vje1gjfp9fg2
Add get_current_name() func to quickly api.
To get project name from path.

by Denis Kovalskiy

Show diffs side-by-side

added added

removed removed

Lines of Context:
90
90
        return configurationhandler.project_config['template']
91
91
    except KeyError:
92
92
        return None
 
93
        
 
94
def get_current_name(path=None):
 
95
    '''return project name if we are in a project'''
 
96
    configurationhandler.loadConfig(can_stop=False, config_file_path=path)
 
97
    try:
 
98
        return configurationhandler.project_config['project']
 
99
    except KeyError:
 
100
        return None            
93
101
 
94
102
def list_template_for_command(command_name):
95
103
    '''from the command_name, return all templates containing it'''