Skip to content

Commit

Permalink
Fixes line endings and adds some INFO and TODO comments
Browse files Browse the repository at this point in the history
  • Loading branch information
zooba committed Feb 9, 2016
1 parent b2987d3 commit 4d75912
Show file tree
Hide file tree
Showing 13 changed files with 353 additions and 343 deletions.
26 changes: 13 additions & 13 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Set the default behavior (used when a rule below doesn't match)
* text=auto

*.sln -text
*.ico -text
*.bmp -text
*.png -text
*.snk -text
*.mht -text
*.pickle -text

# Some Windows-specific files should always be CRLF
*.bat eol=crlf
# Set the default behavior (used when a rule below doesn't match)
* text=auto

*.sln -text
*.ico -text
*.bmp -text
*.png -text
*.snk -text
*.mht -text
*.pickle -text

# Some Windows-specific files should always be CRLF
*.bat eol=crlf
122 changes: 61 additions & 61 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,61 +1,61 @@
# Python cache
__pycache__/
*.pyc

# Virtual environment
env/

# PTVS analysis
.ptvs/

# Build results
bin/
obj/
dist/
MANIFEST

# Result of running python setup.py install/pip install -e
RECORD.txt
build/
*.egg-info/

# Test results
TestResults/

# Credentials
credentials_real.json
testsettings_local.json
servicebus_settings_real.py
storage_settings_real.py
legacy_mgmt_settings_real.py
mgmt_settings_real.py
app_creds_real.py

# User-specific files
*.suo
*.user
*.sln.docstates
.vs/

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

.idea
src/build
*.iml
/doc/_build
/.vs/config/applicationhost.config

# Azure deployment credentials
*.pubxml

# Python cache
__pycache__/
*.pyc

# Virtual environment
env/

# PTVS analysis
.ptvs/

# Build results
bin/
obj/
dist/
MANIFEST

# Result of running python setup.py install/pip install -e
RECORD.txt
build/
*.egg-info/

# Test results
TestResults/

# Credentials
credentials_real.json
testsettings_local.json
servicebus_settings_real.py
storage_settings_real.py
legacy_mgmt_settings_real.py
mgmt_settings_real.py
app_creds_real.py

# User-specific files
*.suo
*.user
*.sln.docstates
.vs/

# Windows image file caches
Thumbs.db
ehthumbs.db

# Folder config file
Desktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Mac desktop service store files
.DS_Store

.idea
src/build
*.iml
/doc/_build
/.vs/config/applicationhost.config

# Azure deployment credentials
*.pubxml

2 changes: 1 addition & 1 deletion src/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__import__('pkg_resources').declare_namespace(__name__)
8 changes: 4 additions & 4 deletions src/azure/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import sys

import azure.cli.main
sys.exit(azure.cli.main.main(sys.argv[1:]))
import sys

import azure.cli.main
sys.exit(azure.cli.main.main(sys.argv[1:]))
12 changes: 6 additions & 6 deletions src/azure/cli/_argparse.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import argparse

class ArgumentParser(argparse.ArgumentParser):
# TODO: Improve help appearance
pass
import argparse

class ArgumentParser(argparse.ArgumentParser):
# TODO: Improve help appearance
pass

35 changes: 20 additions & 15 deletions src/azure/cli/_config.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
import os

try:
import configparser
except ImportError:
import ConfigParser as configparser

_loaded_config = None
def get_config():
global _loaded_config
if _loaded_config is None:
cfg = configparser.RawConfigParser()
cfg.read(os.path.expanduser('~/azure.ini'))
_loaded_config = cfg
return _loaded_config
import os

try:
import configparser
except ImportError:
import ConfigParser as configparser

_loaded_config = None
def get_config():
'''Loads the user's azure.ini file and returns its contents.
The file is only read once and the results cached. Modifications to
the file during execution will not be seen.
'''
global _loaded_config
if _loaded_config is None:
cfg = configparser.RawConfigParser()
cfg.read(os.path.expanduser('~/azure.ini'))
_loaded_config = cfg
return _loaded_config
50 changes: 25 additions & 25 deletions src/azure/cli/_logging.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import logging

# These arguments will be removed
STRIP_ARGS = frozenset([
'-v',
'--verbose',
'--debug',
])

def configure_logging(argv):
# TODO: Configure logging handler to log messages to .py file
# Thinking here:
# INFO messages as Python code
# DEBUG messages (if -v) as comments
# WARNING/ERROR messages as clearly marked comments

# Currently we just use the default format
level = logging.WARNING
if '-v' in argv or '--verbose' in argv:
level = logging.INFO
if '--debug' in argv:
level = logging.DEBUG

logging.basicConfig(level=level)

import logging

# These arguments will be removed
STRIP_ARGS = frozenset([
'-v',
'--verbose',
'--debug',
])

def configure_logging(argv):
# TODO: Configure logging handler to log messages to .py file
# Thinking here:
# INFO messages as Python code
# DEBUG messages (if -v) as comments
# WARNING/ERROR messages as clearly marked comments

# Currently we just use the default format
level = logging.WARNING
if '-v' in argv or '--verbose' in argv:
level = logging.INFO
if '--debug' in argv:
level = logging.DEBUG

logging.basicConfig(level=level)

return [a for a in argv if a not in STRIP_ARGS]
22 changes: 11 additions & 11 deletions src/azure/cli/_util.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import logging
import types

try:
from importlib import import_module
except ImportError:
def import_module(mod):
m = __import__(mod)
for b in mod.split('.'):
m = gettatr(m, b)
return m
import logging
import types

try:
from importlib import import_module
except ImportError:
def import_module(mod):
m = __import__(mod)
for b in mod.split('.'):
m = gettatr(m, b)
return m
Loading

0 comments on commit 4d75912

Please sign in to comment.