This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from argparse import ArgumentParser | |
from configparser import ConfigParser | |
import pprint | |
def main(): | |
# Read file config | |
fparser = ConfigParser() | |
fparser.read('config.conf') | |
config = {'some.key': 'some_value'} # Hard-coded default |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
branch_mapping = [('default', 'master')] | |
target = "git+ssh://[email protected]/haard/test" | |
repo = hgapi.Repo(path) | |
for hgb, gb in branch_mapping: | |
repo.hg_command('bookmark', '-r', hgb, gb) | |
repo.hg_command("--config", "paths.default=" + target, "--config", "extensions.hggit=", "push") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import zipfile, urllib, csv, os, codecs | |
def get_items(url): | |
filename, headers = urllib.urlretrieve(url) | |
try: | |
with zipfile.ZipFile(filename) as zf: | |
csvfiles = [name for name in zf.namelist() | |
if name.endswith('.csv')] | |
for item in csvfiles: | |
with zf.open(item) as source: |