commit
stringlengths
40
40
old_file
stringlengths
4
118
new_file
stringlengths
4
118
old_contents
stringlengths
0
2.94k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
444
message
stringlengths
16
3.45k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
5
43.2k
prompt
stringlengths
17
4.58k
response
stringlengths
1
4.43k
prompt_tagged
stringlengths
58
4.62k
response_tagged
stringlengths
1
4.43k
text
stringlengths
132
7.29k
text_tagged
stringlengths
173
7.33k
e79420fc4f32ff9ef72c81646533363502cc2235
fabfile.py
fabfile.py
from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') # local('./src/manage.py loaddata licenses.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput')
from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput')
Delete commented out loaddata command.
Delete commented out loaddata command. git-svn-id: d73fdb991549f9d1a0affa567d55bb0fdbd453f3@8436 f04a3889-0f81-4131-97fb-bc517d1f583d
Python
bsd-3-clause
unt-libraries/texas-choropleth,damonkelley/texas-choropleth,unt-libraries/texas-choropleth,damonkelley/texas-choropleth,damonkelley/texas-choropleth,damonkelley/texas-choropleth,unt-libraries/texas-choropleth,unt-libraries/texas-choropleth
from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') # local('./src/manage.py loaddata licenses.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput') Delete commented out loaddata command. git-svn-id: d73fdb991549f9d1a0affa567d55bb0fdbd453f3@8436 f04a3889-0f81-4131-97fb-bc517d1f583d
from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput')
<commit_before>from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') # local('./src/manage.py loaddata licenses.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput') <commit_msg>Delete commented out loaddata command. git-svn-id: d73fdb991549f9d1a0affa567d55bb0fdbd453f3@8436 f04a3889-0f81-4131-97fb-bc517d1f583d<commit_after>
from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput')
from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') # local('./src/manage.py loaddata licenses.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput') Delete commented out loaddata command. git-svn-id: d73fdb991549f9d1a0affa567d55bb0fdbd453f3@8436 f04a3889-0f81-4131-97fb-bc517d1f583dfrom fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput')
<commit_before>from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') # local('./src/manage.py loaddata licenses.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput') <commit_msg>Delete commented out loaddata command. git-svn-id: d73fdb991549f9d1a0affa567d55bb0fdbd453f3@8436 f04a3889-0f81-4131-97fb-bc517d1f583d<commit_after>from fabric.api import local, run from fabric.colors import green from fabric.contrib import django from fabric.decorators import task @task def run_tests(test='src'): django.settings_module('texas_choropleth.settings.test') local('./src/manage.py test {0}'.format(test)) def build(): print(green("[ Installing Bowering Components ]")) local('bower install --allow-root --config.interactive=false') print(green("\n[ Syncing Database ]")) local('./src/manage.py syncdb --noinput') print(green("\n[ Running Database Migrations ]")) local('./src/manage.py migrate') print(green("\n[ Loading Fixtures ]")) local('./src/manage.py loaddata texas.json') local('./src/manage.py loaddata palettes.json') @task def build_dev(): django.settings_module('texas_choropleth.settings.local') build() @task def build_prod(): django.settings_module('texas_choropleth.settings.production') build() print(green("\n [ Collecting Staticfiles ]")) local('./src/manage.py collectstatic --noinput')
d99dfc16e7c14896a703da7868f26a710b3bc6f1
14B-088/HI/analysis/galaxy_params.py
14B-088/HI/analysis/galaxy_params.py
''' Use parameters from Diskfit in the Galaxy class ''' from astropy import units as u from galaxies import Galaxy from astropy.table import Table from paths import fourteenB_HI_data_path def update_galaxy_params(gal, param_table): ''' Use the fit values from fit rather than the hard-coded values in galaxies. ''' from astropy.coordinates import Angle, SkyCoord gal.inclination = Angle(param_table["inc"] * u.deg)[0] gal.position_angle = Angle(param_table["PA"] * u.deg)[0] gal.vsys = (param_table["Vsys"] * u.km / u.s)[0] # The positions in the table are in pixels, so convert to the sky using # the spatial WCS info. ra_cent, dec_cent = param_table["RAcent"], param_table["Deccent"] gal.center_position = SkyCoord(ra_cent, dec_cent, unit=(u.deg, u.deg), frame='fk5') folder_name = "diskfit_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table)
''' Use parameters from Diskfit in the Galaxy class ''' from galaxies import Galaxy from astropy.table import Table from cube_analysis.rotation_curves import update_galaxy_params from paths import fourteenB_HI_data_path, fourteenB_HI_data_wGBT_path # The models from the peak velocity aren't as biased, based on comparing # the VLA and VLA+GBT velocity curves. Using these as the defaults folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) # Load in the model from the feathered data as well. folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_wGBT_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal_feath = Galaxy("M33") update_galaxy_params(gal_feath, param_table)
Update galaxy params w/ new model choices
Update galaxy params w/ new model choices
Python
mit
e-koch/VLA_Lband,e-koch/VLA_Lband
''' Use parameters from Diskfit in the Galaxy class ''' from astropy import units as u from galaxies import Galaxy from astropy.table import Table from paths import fourteenB_HI_data_path def update_galaxy_params(gal, param_table): ''' Use the fit values from fit rather than the hard-coded values in galaxies. ''' from astropy.coordinates import Angle, SkyCoord gal.inclination = Angle(param_table["inc"] * u.deg)[0] gal.position_angle = Angle(param_table["PA"] * u.deg)[0] gal.vsys = (param_table["Vsys"] * u.km / u.s)[0] # The positions in the table are in pixels, so convert to the sky using # the spatial WCS info. ra_cent, dec_cent = param_table["RAcent"], param_table["Deccent"] gal.center_position = SkyCoord(ra_cent, dec_cent, unit=(u.deg, u.deg), frame='fk5') folder_name = "diskfit_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) Update galaxy params w/ new model choices
''' Use parameters from Diskfit in the Galaxy class ''' from galaxies import Galaxy from astropy.table import Table from cube_analysis.rotation_curves import update_galaxy_params from paths import fourteenB_HI_data_path, fourteenB_HI_data_wGBT_path # The models from the peak velocity aren't as biased, based on comparing # the VLA and VLA+GBT velocity curves. Using these as the defaults folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) # Load in the model from the feathered data as well. folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_wGBT_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal_feath = Galaxy("M33") update_galaxy_params(gal_feath, param_table)
<commit_before> ''' Use parameters from Diskfit in the Galaxy class ''' from astropy import units as u from galaxies import Galaxy from astropy.table import Table from paths import fourteenB_HI_data_path def update_galaxy_params(gal, param_table): ''' Use the fit values from fit rather than the hard-coded values in galaxies. ''' from astropy.coordinates import Angle, SkyCoord gal.inclination = Angle(param_table["inc"] * u.deg)[0] gal.position_angle = Angle(param_table["PA"] * u.deg)[0] gal.vsys = (param_table["Vsys"] * u.km / u.s)[0] # The positions in the table are in pixels, so convert to the sky using # the spatial WCS info. ra_cent, dec_cent = param_table["RAcent"], param_table["Deccent"] gal.center_position = SkyCoord(ra_cent, dec_cent, unit=(u.deg, u.deg), frame='fk5') folder_name = "diskfit_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) <commit_msg>Update galaxy params w/ new model choices<commit_after>
''' Use parameters from Diskfit in the Galaxy class ''' from galaxies import Galaxy from astropy.table import Table from cube_analysis.rotation_curves import update_galaxy_params from paths import fourteenB_HI_data_path, fourteenB_HI_data_wGBT_path # The models from the peak velocity aren't as biased, based on comparing # the VLA and VLA+GBT velocity curves. Using these as the defaults folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) # Load in the model from the feathered data as well. folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_wGBT_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal_feath = Galaxy("M33") update_galaxy_params(gal_feath, param_table)
''' Use parameters from Diskfit in the Galaxy class ''' from astropy import units as u from galaxies import Galaxy from astropy.table import Table from paths import fourteenB_HI_data_path def update_galaxy_params(gal, param_table): ''' Use the fit values from fit rather than the hard-coded values in galaxies. ''' from astropy.coordinates import Angle, SkyCoord gal.inclination = Angle(param_table["inc"] * u.deg)[0] gal.position_angle = Angle(param_table["PA"] * u.deg)[0] gal.vsys = (param_table["Vsys"] * u.km / u.s)[0] # The positions in the table are in pixels, so convert to the sky using # the spatial WCS info. ra_cent, dec_cent = param_table["RAcent"], param_table["Deccent"] gal.center_position = SkyCoord(ra_cent, dec_cent, unit=(u.deg, u.deg), frame='fk5') folder_name = "diskfit_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) Update galaxy params w/ new model choices ''' Use parameters from Diskfit in the Galaxy class ''' from galaxies import Galaxy from astropy.table import Table from cube_analysis.rotation_curves import update_galaxy_params from paths import fourteenB_HI_data_path, fourteenB_HI_data_wGBT_path # The models from the peak velocity aren't as biased, based on comparing # the VLA and VLA+GBT velocity curves. Using these as the defaults folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) # Load in the model from the feathered data as well. folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_wGBT_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal_feath = Galaxy("M33") update_galaxy_params(gal_feath, param_table)
<commit_before> ''' Use parameters from Diskfit in the Galaxy class ''' from astropy import units as u from galaxies import Galaxy from astropy.table import Table from paths import fourteenB_HI_data_path def update_galaxy_params(gal, param_table): ''' Use the fit values from fit rather than the hard-coded values in galaxies. ''' from astropy.coordinates import Angle, SkyCoord gal.inclination = Angle(param_table["inc"] * u.deg)[0] gal.position_angle = Angle(param_table["PA"] * u.deg)[0] gal.vsys = (param_table["Vsys"] * u.km / u.s)[0] # The positions in the table are in pixels, so convert to the sky using # the spatial WCS info. ra_cent, dec_cent = param_table["RAcent"], param_table["Deccent"] gal.center_position = SkyCoord(ra_cent, dec_cent, unit=(u.deg, u.deg), frame='fk5') folder_name = "diskfit_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) <commit_msg>Update galaxy params w/ new model choices<commit_after> ''' Use parameters from Diskfit in the Galaxy class ''' from galaxies import Galaxy from astropy.table import Table from cube_analysis.rotation_curves import update_galaxy_params from paths import fourteenB_HI_data_path, fourteenB_HI_data_wGBT_path # The models from the peak velocity aren't as biased, based on comparing # the VLA and VLA+GBT velocity curves. Using these as the defaults folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal = Galaxy("M33") update_galaxy_params(gal, param_table) # Load in the model from the feathered data as well. folder_name = "diskfit_peakvels_noasymm_noradial_nowarp_output" param_name = \ fourteenB_HI_data_wGBT_path("{}/rad.out.params.csv".format(folder_name)) param_table = Table.read(param_name) gal_feath = Galaxy("M33") update_galaxy_params(gal_feath, param_table)
dad86f0637ea94abf1cdbf6674b62696980d5589
dont_tread_on_memes/__main__.py
dont_tread_on_memes/__main__.py
import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, save): flag = dont_tread_on_memes.tread_on(message) if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread()
import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--format/--no-format", default=True, help=("Use the provided message as the entire caption instead of" " formatting it as 'Don't [message] me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, format, save): # Generate the flag if format is True: flag = dont_tread_on_memes.dont_me(message) else: flag = dont_tread_on_memes.tread_on(message) # Save or show if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread()
Allow 'raw' captioning via the --no-format flag
Allow 'raw' captioning via the --no-format flag
Python
mit
controversial/dont-tread-on-memes
import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, save): flag = dont_tread_on_memes.tread_on(message) if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread() Allow 'raw' captioning via the --no-format flag
import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--format/--no-format", default=True, help=("Use the provided message as the entire caption instead of" " formatting it as 'Don't [message] me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, format, save): # Generate the flag if format is True: flag = dont_tread_on_memes.dont_me(message) else: flag = dont_tread_on_memes.tread_on(message) # Save or show if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread()
<commit_before>import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, save): flag = dont_tread_on_memes.tread_on(message) if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread() <commit_msg>Allow 'raw' captioning via the --no-format flag<commit_after>
import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--format/--no-format", default=True, help=("Use the provided message as the entire caption instead of" " formatting it as 'Don't [message] me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, format, save): # Generate the flag if format is True: flag = dont_tread_on_memes.dont_me(message) else: flag = dont_tread_on_memes.tread_on(message) # Save or show if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread()
import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, save): flag = dont_tread_on_memes.tread_on(message) if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread() Allow 'raw' captioning via the --no-format flagimport dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--format/--no-format", default=True, help=("Use the provided message as the entire caption instead of" " formatting it as 'Don't [message] me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, format, save): # Generate the flag if format is True: flag = dont_tread_on_memes.dont_me(message) else: flag = dont_tread_on_memes.tread_on(message) # Save or show if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread()
<commit_before>import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, save): flag = dont_tread_on_memes.tread_on(message) if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread() <commit_msg>Allow 'raw' captioning via the --no-format flag<commit_after>import dont_tread_on_memes import click @click.command() @click.option("--message", prompt="Don't _____ me", help=("The word or phrase to substitute for 'tread' in 'don't " "tread on me'")) @click.option("--format/--no-format", default=True, help=("Use the provided message as the entire caption instead of" " formatting it as 'Don't [message] me'")) @click.option("--save", default=None, help="Where to save the image") def tread(message, format, save): # Generate the flag if format is True: flag = dont_tread_on_memes.dont_me(message) else: flag = dont_tread_on_memes.tread_on(message) # Save or show if save is not None: flag.save(save) else: flag.show() if __name__ == "__main__": tread()
27abcf86612e186f00cb9b91e604a222c9666438
app/eve_proxy/tasks.py
app/eve_proxy/tasks.py
from django.conf import settings import logging from datetime import datetime, timedelta from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = datetime.utcnow() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = datetime.utcnow() - timedelta(days=settings.EVE_PROXY_KEEP_LOGS) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete()
import logging from datetime import datetime, timedelta from django.conf import settings from django.utils.timezone import now from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = now() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = now() - timedelta(days=getattr(settings, 'EVE_PROXY_KEEP_LOGS', 30)) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete()
Update eve_proxy taks for Django 1.4
Update eve_proxy taks for Django 1.4
Python
bsd-3-clause
nikdoof/test-auth
from django.conf import settings import logging from datetime import datetime, timedelta from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = datetime.utcnow() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = datetime.utcnow() - timedelta(days=settings.EVE_PROXY_KEEP_LOGS) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete() Update eve_proxy taks for Django 1.4
import logging from datetime import datetime, timedelta from django.conf import settings from django.utils.timezone import now from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = now() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = now() - timedelta(days=getattr(settings, 'EVE_PROXY_KEEP_LOGS', 30)) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete()
<commit_before>from django.conf import settings import logging from datetime import datetime, timedelta from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = datetime.utcnow() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = datetime.utcnow() - timedelta(days=settings.EVE_PROXY_KEEP_LOGS) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete() <commit_msg>Update eve_proxy taks for Django 1.4<commit_after>
import logging from datetime import datetime, timedelta from django.conf import settings from django.utils.timezone import now from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = now() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = now() - timedelta(days=getattr(settings, 'EVE_PROXY_KEEP_LOGS', 30)) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete()
from django.conf import settings import logging from datetime import datetime, timedelta from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = datetime.utcnow() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = datetime.utcnow() - timedelta(days=settings.EVE_PROXY_KEEP_LOGS) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete() Update eve_proxy taks for Django 1.4import logging from datetime import datetime, timedelta from django.conf import settings from django.utils.timezone import now from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = now() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = now() - timedelta(days=getattr(settings, 'EVE_PROXY_KEEP_LOGS', 30)) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete()
<commit_before>from django.conf import settings import logging from datetime import datetime, timedelta from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = datetime.utcnow() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = datetime.utcnow() - timedelta(days=settings.EVE_PROXY_KEEP_LOGS) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete() <commit_msg>Update eve_proxy taks for Django 1.4<commit_after>import logging from datetime import datetime, timedelta from django.conf import settings from django.utils.timezone import now from celery.task import task from eve_proxy.models import CachedDocument, ApiAccessLog @task(ignore_result=True) def clear_stale_cache(cache_extension=0): log = clear_stale_cache.get_logger() time = now() - timedelta(seconds=cache_extension) objs = CachedDocument.objects.filter(cached_until__lt=time) log.info('Removing %s stale cache documents' % objs.count()) objs.delete() @task(ignore_result=True) def clear_old_logs(): log = clear_old_logs.get_logger() time = now() - timedelta(days=getattr(settings, 'EVE_PROXY_KEEP_LOGS', 30)) objs = ApiAccessLog.objects.filter(time_access__lt=time) log.info('Removing %s old access logs' % objs.count()) objs.delete()
1619c955c75f91b9d61c3195704f17fc88ef9e04
aybu/manager/utils/pshell.py
aybu/manager/utils/pshell.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.core.models.Base.metadata.bind = env['engine']
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.manager.models.Base.metadata.bind = env['engine'] aybu.manager.models.Environment.initialize(settings) env['session'] = env['request'].db_session
Initialize session and environment in shell
Initialize session and environment in shell
Python
apache-2.0
asidev/aybu-manager
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.core.models.Base.metadata.bind = env['engine'] Initialize session and environment in shell
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.manager.models.Base.metadata.bind = env['engine'] aybu.manager.models.Environment.initialize(settings) env['session'] = env['request'].db_session
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.core.models.Base.metadata.bind = env['engine'] <commit_msg>Initialize session and environment in shell<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.manager.models.Base.metadata.bind = env['engine'] aybu.manager.models.Environment.initialize(settings) env['session'] = env['request'].db_session
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.core.models.Base.metadata.bind = env['engine'] Initialize session and environment in shell#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.manager.models.Base.metadata.bind = env['engine'] aybu.manager.models.Environment.initialize(settings) env['session'] = env['request'].db_session
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.core.models.Base.metadata.bind = env['engine'] <commit_msg>Initialize session and environment in shell<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Copyright 2010 Asidev s.r.l. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from sqlalchemy import engine_from_config import aybu.manager.models def setup(env): settings = env['request'].registry.settings env['models'] = aybu.manager.models env['engine'] = engine_from_config(settings, 'sqlalchemy.') env['request'].set_db_engine = env['engine'] aybu.manager.models.Base.metadata.bind = env['engine'] aybu.manager.models.Environment.initialize(settings) env['session'] = env['request'].db_session
38a3712a571ea8f3f76d1559938bc07d91c87cc6
baseflask/refresh_varsnap.py
baseflask/refresh_varsnap.py
""" This script refreshes production varsnap snaps """ import os from syspath import git_root # NOQA from app import serve os.environ['ENV'] = 'production' app = serve.app.test_client() app.get('/') app.get('/health') app.get('/humans.txt') app.get('/robots.txt') app.get('/.well-known/security.txt') app.get('/asdf')
""" This script refreshes production varsnap snaps """ import os from dotenv import dotenv_values from syspath import git_root # NOQA from app import serve config = dotenv_values('.env.production') base_url = 'https://' + config.get('SERVER_NAME', '') os.environ['ENV'] = 'production' serve.app.config['SERVER_NAME'] = config['SERVER_NAME'] app = serve.app.test_client() app.get('/', base_url=base_url) app.get('/health', base_url=base_url) app.get('/humans.txt', base_url=base_url) app.get('/robots.txt', base_url=base_url) app.get('/.well-known/security.txt', base_url=base_url) app.get('/asdf', base_url=base_url)
Use production server name and https for generating production snaps
Use production server name and https for generating production snaps
Python
mit
albertyw/base-flask,albertyw/base-flask,albertyw/base-flask,albertyw/base-flask
""" This script refreshes production varsnap snaps """ import os from syspath import git_root # NOQA from app import serve os.environ['ENV'] = 'production' app = serve.app.test_client() app.get('/') app.get('/health') app.get('/humans.txt') app.get('/robots.txt') app.get('/.well-known/security.txt') app.get('/asdf') Use production server name and https for generating production snaps
""" This script refreshes production varsnap snaps """ import os from dotenv import dotenv_values from syspath import git_root # NOQA from app import serve config = dotenv_values('.env.production') base_url = 'https://' + config.get('SERVER_NAME', '') os.environ['ENV'] = 'production' serve.app.config['SERVER_NAME'] = config['SERVER_NAME'] app = serve.app.test_client() app.get('/', base_url=base_url) app.get('/health', base_url=base_url) app.get('/humans.txt', base_url=base_url) app.get('/robots.txt', base_url=base_url) app.get('/.well-known/security.txt', base_url=base_url) app.get('/asdf', base_url=base_url)
<commit_before>""" This script refreshes production varsnap snaps """ import os from syspath import git_root # NOQA from app import serve os.environ['ENV'] = 'production' app = serve.app.test_client() app.get('/') app.get('/health') app.get('/humans.txt') app.get('/robots.txt') app.get('/.well-known/security.txt') app.get('/asdf') <commit_msg>Use production server name and https for generating production snaps<commit_after>
""" This script refreshes production varsnap snaps """ import os from dotenv import dotenv_values from syspath import git_root # NOQA from app import serve config = dotenv_values('.env.production') base_url = 'https://' + config.get('SERVER_NAME', '') os.environ['ENV'] = 'production' serve.app.config['SERVER_NAME'] = config['SERVER_NAME'] app = serve.app.test_client() app.get('/', base_url=base_url) app.get('/health', base_url=base_url) app.get('/humans.txt', base_url=base_url) app.get('/robots.txt', base_url=base_url) app.get('/.well-known/security.txt', base_url=base_url) app.get('/asdf', base_url=base_url)
""" This script refreshes production varsnap snaps """ import os from syspath import git_root # NOQA from app import serve os.environ['ENV'] = 'production' app = serve.app.test_client() app.get('/') app.get('/health') app.get('/humans.txt') app.get('/robots.txt') app.get('/.well-known/security.txt') app.get('/asdf') Use production server name and https for generating production snaps""" This script refreshes production varsnap snaps """ import os from dotenv import dotenv_values from syspath import git_root # NOQA from app import serve config = dotenv_values('.env.production') base_url = 'https://' + config.get('SERVER_NAME', '') os.environ['ENV'] = 'production' serve.app.config['SERVER_NAME'] = config['SERVER_NAME'] app = serve.app.test_client() app.get('/', base_url=base_url) app.get('/health', base_url=base_url) app.get('/humans.txt', base_url=base_url) app.get('/robots.txt', base_url=base_url) app.get('/.well-known/security.txt', base_url=base_url) app.get('/asdf', base_url=base_url)
<commit_before>""" This script refreshes production varsnap snaps """ import os from syspath import git_root # NOQA from app import serve os.environ['ENV'] = 'production' app = serve.app.test_client() app.get('/') app.get('/health') app.get('/humans.txt') app.get('/robots.txt') app.get('/.well-known/security.txt') app.get('/asdf') <commit_msg>Use production server name and https for generating production snaps<commit_after>""" This script refreshes production varsnap snaps """ import os from dotenv import dotenv_values from syspath import git_root # NOQA from app import serve config = dotenv_values('.env.production') base_url = 'https://' + config.get('SERVER_NAME', '') os.environ['ENV'] = 'production' serve.app.config['SERVER_NAME'] = config['SERVER_NAME'] app = serve.app.test_client() app.get('/', base_url=base_url) app.get('/health', base_url=base_url) app.get('/humans.txt', base_url=base_url) app.get('/robots.txt', base_url=base_url) app.get('/.well-known/security.txt', base_url=base_url) app.get('/asdf', base_url=base_url)
4b89a9ab88ef197394103af7dda431e01e6d9298
app/__init__.py
app/__init__.py
import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import *
import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy import logging logging.basicConfig() telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import *
Stop DB creation scripts from silently failing
Stop DB creation scripts from silently failing
Python
mit
rabramley/telomere,rabramley/telomere,rabramley/telomere
import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import * Stop DB creation scripts from silently failing
import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy import logging logging.basicConfig() telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import *
<commit_before>import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import * <commit_msg>Stop DB creation scripts from silently failing<commit_after>
import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy import logging logging.basicConfig() telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import *
import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import * Stop DB creation scripts from silently failingimport datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy import logging logging.basicConfig() telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import *
<commit_before>import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import * <commit_msg>Stop DB creation scripts from silently failing<commit_after>import datetime from flask import Flask, g from flask.ext.sqlalchemy import SQLAlchemy import logging logging.basicConfig() telomere = Flask(__name__) telomere.config.from_object('app.settings') db = SQLAlchemy(telomere) import app.database database.init_db() telomere.secret_key = telomere.config['SECRET_KEY'] @telomere.before_request def set_date(): g.year = datetime.datetime.now().year import app.helpers.templateFilters from app.views import *
17bc3130b8b93a3569906afc494484c9ed0db677
drogher/shippers/fedex.py
drogher/shippers/fedex.py
from .base import Shipper class FedEx(Shipper): barcode_pattern = r'^96\d{20}$' shipper = 'FedEx' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit)
from .base import Shipper class FedEx(Shipper): shipper = 'FedEx' class FedExExpress(FedEx): barcode_pattern = r'^\d{34}$' @property def tracking_number(self): return self.barcode[20:].lstrip('0') @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = 0 for c, d in zip(reversed(sequence), [1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3]): total += int(c) * d return total % 11 % 10 == int(check_digit) class FedExGround(FedEx): barcode_pattern = r'^96\d{20}$' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit)
Add FedEx Express shipper class
Add FedEx Express shipper class
Python
bsd-3-clause
jbittel/drogher
from .base import Shipper class FedEx(Shipper): barcode_pattern = r'^96\d{20}$' shipper = 'FedEx' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit) Add FedEx Express shipper class
from .base import Shipper class FedEx(Shipper): shipper = 'FedEx' class FedExExpress(FedEx): barcode_pattern = r'^\d{34}$' @property def tracking_number(self): return self.barcode[20:].lstrip('0') @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = 0 for c, d in zip(reversed(sequence), [1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3]): total += int(c) * d return total % 11 % 10 == int(check_digit) class FedExGround(FedEx): barcode_pattern = r'^96\d{20}$' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit)
<commit_before>from .base import Shipper class FedEx(Shipper): barcode_pattern = r'^96\d{20}$' shipper = 'FedEx' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit) <commit_msg>Add FedEx Express shipper class<commit_after>
from .base import Shipper class FedEx(Shipper): shipper = 'FedEx' class FedExExpress(FedEx): barcode_pattern = r'^\d{34}$' @property def tracking_number(self): return self.barcode[20:].lstrip('0') @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = 0 for c, d in zip(reversed(sequence), [1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3]): total += int(c) * d return total % 11 % 10 == int(check_digit) class FedExGround(FedEx): barcode_pattern = r'^96\d{20}$' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit)
from .base import Shipper class FedEx(Shipper): barcode_pattern = r'^96\d{20}$' shipper = 'FedEx' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit) Add FedEx Express shipper classfrom .base import Shipper class FedEx(Shipper): shipper = 'FedEx' class FedExExpress(FedEx): barcode_pattern = r'^\d{34}$' @property def tracking_number(self): return self.barcode[20:].lstrip('0') @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = 0 for c, d in zip(reversed(sequence), [1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3]): total += int(c) * d return total % 11 % 10 == int(check_digit) class FedExGround(FedEx): barcode_pattern = r'^96\d{20}$' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit)
<commit_before>from .base import Shipper class FedEx(Shipper): barcode_pattern = r'^96\d{20}$' shipper = 'FedEx' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit) <commit_msg>Add FedEx Express shipper class<commit_after>from .base import Shipper class FedEx(Shipper): shipper = 'FedEx' class FedExExpress(FedEx): barcode_pattern = r'^\d{34}$' @property def tracking_number(self): return self.barcode[20:].lstrip('0') @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = 0 for c, d in zip(reversed(sequence), [1, 3, 7, 1, 3, 7, 1, 3, 7, 1, 3]): total += int(c) * d return total % 11 % 10 == int(check_digit) class FedExGround(FedEx): barcode_pattern = r'^96\d{20}$' @property def tracking_number(self): return self.barcode[7:] @property def valid_checksum(self): sequence, check_digit = self.tracking_number[:-1], self.tracking_number[-1] total = odd = even = 0 for i, c in enumerate(reversed(sequence)): if i & 0x1: odd += int(c) else: even += int(c) total = (even * 3) + odd check = (total + (10 - total % 10)) - total return check == int(check_digit)
dd5487398aee50e2625fbd7b6f42f51dfe2256e8
asd/__main__.py
asd/__main__.py
import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, x: f(x) , ':': lambda f, x: f(x) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS)
import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, *xs: f(*xs) , ':': lambda f, *xs: f(*xs) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS)
Allow runtime $ and : to accept variable amount of arguments.
Allow runtime $ and : to accept variable amount of arguments.
Python
mit
pyos/dg
import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, x: f(x) , ':': lambda f, x: f(x) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS) Allow runtime $ and : to accept variable amount of arguments.
import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, *xs: f(*xs) , ':': lambda f, *xs: f(*xs) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS)
<commit_before>import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, x: f(x) , ':': lambda f, x: f(x) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS) <commit_msg>Allow runtime $ and : to accept variable amount of arguments.<commit_after>
import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, *xs: f(*xs) , ':': lambda f, *xs: f(*xs) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS)
import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, x: f(x) , ':': lambda f, x: f(x) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS) Allow runtime $ and : to accept variable amount of arguments.import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, *xs: f(*xs) , ':': lambda f, *xs: f(*xs) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS)
<commit_before>import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, x: f(x) , ':': lambda f, x: f(x) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS) <commit_msg>Allow runtime $ and : to accept variable amount of arguments.<commit_after>import sys import operator import dg import interactive from . import compiler class Interactive (interactive.Interactive): PARSER = dg.Parser() COMPILER = compiler.Compiler() GLOBALS = { # Runtime counterparts of some stuff in `Compiler.builtins`. '$': lambda f, *xs: f(*xs) , ':': lambda f, *xs: f(*xs) # TODO various operators , '+': operator.add , '-': operator.sub , '!!': operator.getitem } def compile(self, code): q = self.PARSER.compile_command(code) q = q if q is None else self.COMPILER.compile(q, name='<module>', single=True) return q def run(self, ns): q = self.PARSER.parse(sys.stdin, '<stdin>') q = self.COMPILER.compile(q, name='<module>') return self.eval(q, ns) Interactive().shell(__name__, Interactive.GLOBALS)
36bb40d48f5942b18686af077d9a78661c8a5f8a
Python/Product/PythonTools/ptvsd/setup.py
Python/Product/PythonTools/ptvsd/setup.py
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0rc1', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] )
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 5 - Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] )
Update ptvsd version number for 2.1 RTM
Update ptvsd version number for 2.1 RTM
Python
apache-2.0
MetSystem/PTVS,crwilcox/PTVS,Microsoft/PTVS,dut3062796s/PTVS,int19h/PTVS,gomiero/PTVS,zooba/PTVS,alanch-ms/PTVS,DEVSENSE/PTVS,Microsoft/PTVS,fjxhkj/PTVS,jkorell/PTVS,bolabola/PTVS,bolabola/PTVS,juanyaw/PTVS,ChinaQuants/PTVS,xNUTs/PTVS,gilbertw/PTVS,dut3062796s/PTVS,jkorell/PTVS,Microsoft/PTVS,msunardi/PTVS,Habatchii/PTVS,christer155/PTVS,huguesv/PTVS,dut3062796s/PTVS,ChinaQuants/PTVS,juanyaw/PTVS,MetSystem/PTVS,gomiero/PTVS,DinoV/PTVS,gomiero/PTVS,huguesv/PTVS,ChinaQuants/PTVS,christer155/PTVS,mlorbetske/PTVS,ChinaQuants/PTVS,fivejjs/PTVS,christer155/PTVS,Habatchii/PTVS,bolabola/PTVS,Habatchii/PTVS,alanch-ms/PTVS,Microsoft/PTVS,xNUTs/PTVS,ChinaQuants/PTVS,dut3062796s/PTVS,DinoV/PTVS,alanch-ms/PTVS,int19h/PTVS,dut3062796s/PTVS,modulexcite/PTVS,int19h/PTVS,xNUTs/PTVS,modulexcite/PTVS,bolabola/PTVS,mlorbetske/PTVS,denfromufa/PTVS,fjxhkj/PTVS,alanch-ms/PTVS,denfromufa/PTVS,dut3062796s/PTVS,jkorell/PTVS,int19h/PTVS,fivejjs/PTVS,xNUTs/PTVS,crwilcox/PTVS,DinoV/PTVS,christer155/PTVS,fjxhkj/PTVS,alanch-ms/PTVS,Microsoft/PTVS,int19h/PTVS,gomiero/PTVS,zooba/PTVS,gilbertw/PTVS,crwilcox/PTVS,MetSystem/PTVS,fivejjs/PTVS,DinoV/PTVS,int19h/PTVS,fivejjs/PTVS,juanyaw/PTVS,denfromufa/PTVS,mlorbetske/PTVS,bolabola/PTVS,fjxhkj/PTVS,christer155/PTVS,xNUTs/PTVS,Microsoft/PTVS,DEVSENSE/PTVS,DinoV/PTVS,crwilcox/PTVS,msunardi/PTVS,gilbertw/PTVS,alanch-ms/PTVS,mlorbetske/PTVS,jkorell/PTVS,juanyaw/PTVS,msunardi/PTVS,huguesv/PTVS,msunardi/PTVS,fivejjs/PTVS,zooba/PTVS,gilbertw/PTVS,modulexcite/PTVS,ChinaQuants/PTVS,juanyaw/PTVS,DinoV/PTVS,bolabola/PTVS,fivejjs/PTVS,Habatchii/PTVS,gomiero/PTVS,mlorbetske/PTVS,zooba/PTVS,denfromufa/PTVS,Habatchii/PTVS,Habatchii/PTVS,jkorell/PTVS,crwilcox/PTVS,DEVSENSE/PTVS,MetSystem/PTVS,juanyaw/PTVS,fjxhkj/PTVS,xNUTs/PTVS,fjxhkj/PTVS,zooba/PTVS,modulexcite/PTVS,modulexcite/PTVS,crwilcox/PTVS,huguesv/PTVS,denfromufa/PTVS,denfromufa/PTVS,msunardi/PTVS,msunardi/PTVS,huguesv/PTVS,MetSystem/PTVS,gilbertw/PTVS,jkorell/PTVS,christer155/PTVS,zooba/PTVS,huguesv/PTVS,MetSystem/PTVS,mlorbetske/PTVS,DEVSENSE/PTVS,gomiero/PTVS,DEVSENSE/PTVS,DEVSENSE/PTVS,gilbertw/PTVS,modulexcite/PTVS
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0rc1', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] ) Update ptvsd version number for 2.1 RTM
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 5 - Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] )
<commit_before>#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0rc1', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] ) <commit_msg>Update ptvsd version number for 2.1 RTM<commit_after>
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 5 - Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] )
#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0rc1', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] ) Update ptvsd version number for 2.1 RTM#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 5 - Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] )
<commit_before>#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0rc1', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 4 - Beta', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] ) <commit_msg>Update ptvsd version number for 2.1 RTM<commit_after>#!/usr/bin/env python #------------------------------------------------------------------------- # Copyright (c) Microsoft. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #-------------------------------------------------------------------------- from distutils.core import setup setup(name='ptvsd', version='2.1.0', description='Python Tools for Visual Studio remote debugging server', license='Apache License 2.0', author='Microsoft Corporation', author_email='ptvshelp@microsoft.com', url='https://pytools.codeplex.com/', classifiers=[ 'Development Status :: 5 - Stable', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 3', 'License :: OSI Approved :: Apache Software License'], packages=['ptvsd'] )
353c3f1e88c55bbb31146c32162b18e9e6ae7cfc
corehq/apps/hqwebapp/management/commands/list_waf_allow_patterns.py
corehq/apps/hqwebapp/management/commands/list_waf_allow_patterns.py
import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( '--compact', action='store_true', default=False, help='Compact multiple regular expressions into regexes no longer than 200 chars each', ) def handle(self, *args, compact=False, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) if not compact: for pattern in patterns: print(pattern) else: buffer = '' for pattern in patterns: if len(buffer) + len(pattern) + 1 <= 200: if buffer: buffer += '|' + pattern else: buffer = pattern else: print(buffer) buffer = pattern if buffer: print(buffer) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string)
import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def handle(self, *args, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) for pattern in patterns: print(pattern) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string)
Move WAF regex compaction from here to commcare-cloud
Move WAF regex compaction from here to commcare-cloud
Python
bsd-3-clause
dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq
import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( '--compact', action='store_true', default=False, help='Compact multiple regular expressions into regexes no longer than 200 chars each', ) def handle(self, *args, compact=False, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) if not compact: for pattern in patterns: print(pattern) else: buffer = '' for pattern in patterns: if len(buffer) + len(pattern) + 1 <= 200: if buffer: buffer += '|' + pattern else: buffer = pattern else: print(buffer) buffer = pattern if buffer: print(buffer) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string) Move WAF regex compaction from here to commcare-cloud
import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def handle(self, *args, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) for pattern in patterns: print(pattern) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string)
<commit_before>import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( '--compact', action='store_true', default=False, help='Compact multiple regular expressions into regexes no longer than 200 chars each', ) def handle(self, *args, compact=False, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) if not compact: for pattern in patterns: print(pattern) else: buffer = '' for pattern in patterns: if len(buffer) + len(pattern) + 1 <= 200: if buffer: buffer += '|' + pattern else: buffer = pattern else: print(buffer) buffer = pattern if buffer: print(buffer) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string) <commit_msg>Move WAF regex compaction from here to commcare-cloud<commit_after>
import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def handle(self, *args, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) for pattern in patterns: print(pattern) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string)
import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( '--compact', action='store_true', default=False, help='Compact multiple regular expressions into regexes no longer than 200 chars each', ) def handle(self, *args, compact=False, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) if not compact: for pattern in patterns: print(pattern) else: buffer = '' for pattern in patterns: if len(buffer) + len(pattern) + 1 <= 200: if buffer: buffer += '|' + pattern else: buffer = pattern else: print(buffer) buffer = pattern if buffer: print(buffer) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string) Move WAF regex compaction from here to commcare-cloudimport re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def handle(self, *args, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) for pattern in patterns: print(pattern) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string)
<commit_before>import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def add_arguments(self, parser): parser.add_argument( '--compact', action='store_true', default=False, help='Compact multiple regular expressions into regexes no longer than 200 chars each', ) def handle(self, *args, compact=False, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) if not compact: for pattern in patterns: print(pattern) else: buffer = '' for pattern in patterns: if len(buffer) + len(pattern) + 1 <= 200: if buffer: buffer += '|' + pattern else: buffer = pattern else: print(buffer) buffer = pattern if buffer: print(buffer) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string) <commit_msg>Move WAF regex compaction from here to commcare-cloud<commit_after>import re from django.core.management import BaseCommand from django.urls import get_resolver from corehq.apps.hqwebapp.decorators import waf_allow class Command(BaseCommand): def handle(self, *args, **options): resolver = get_resolver() for kind, views in waf_allow.views.items(): print(kind) print('--------') patterns = [] for view in views: if isinstance(view, str): # waf_allow(kind, hard_code_pattern=r'^/url/pattern/$') patterns.append(view) else: # @waf_allow(kind) for urlmatch in resolver.reverse_dict.getlist(view): patterns.append(resolver.regex.pattern + urlmatch[1]) patterns = sorted(_remove_regex_groups(pattern) for pattern in patterns) for pattern in patterns: print(pattern) def _remove_regex_groups(regex_string): return re.sub(r'\?P<[^>]+>', '', regex_string)
ff5eccb59efd09cfdeb64150440de35215e1b77d
gevent_tasks/utils.py
gevent_tasks/utils.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): # type: (int) -> str """ Generate a random ID of a given length. """ return ''.join(map(lambda c: random.choice(ch_choices), range(length)))
#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): """ Generate a random ID of a given length. Args: length (int): length of the returned string. Returns: `str` of length ``length``. Example:: >>> gen_uuid() aB6z >>> gen_uuid(10) aAzZ0123mN >>> gen_uuid(None) 9 """ if not length or length < 1: length = 1 return ''.join(map(lambda c: random.choice(ch_choices), range(length)))
Fix `gen_uuid` logic and documentation
Fix `gen_uuid` logic and documentation
Python
mit
blakev/gevent-tasks
#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): # type: (int) -> str """ Generate a random ID of a given length. """ return ''.join(map(lambda c: random.choice(ch_choices), range(length))) Fix `gen_uuid` logic and documentation
#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): """ Generate a random ID of a given length. Args: length (int): length of the returned string. Returns: `str` of length ``length``. Example:: >>> gen_uuid() aB6z >>> gen_uuid(10) aAzZ0123mN >>> gen_uuid(None) 9 """ if not length or length < 1: length = 1 return ''.join(map(lambda c: random.choice(ch_choices), range(length)))
<commit_before>#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): # type: (int) -> str """ Generate a random ID of a given length. """ return ''.join(map(lambda c: random.choice(ch_choices), range(length))) <commit_msg>Fix `gen_uuid` logic and documentation<commit_after>
#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): """ Generate a random ID of a given length. Args: length (int): length of the returned string. Returns: `str` of length ``length``. Example:: >>> gen_uuid() aB6z >>> gen_uuid(10) aAzZ0123mN >>> gen_uuid(None) 9 """ if not length or length < 1: length = 1 return ''.join(map(lambda c: random.choice(ch_choices), range(length)))
#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): # type: (int) -> str """ Generate a random ID of a given length. """ return ''.join(map(lambda c: random.choice(ch_choices), range(length))) Fix `gen_uuid` logic and documentation#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): """ Generate a random ID of a given length. Args: length (int): length of the returned string. Returns: `str` of length ``length``. Example:: >>> gen_uuid() aB6z >>> gen_uuid(10) aAzZ0123mN >>> gen_uuid(None) 9 """ if not length or length < 1: length = 1 return ''.join(map(lambda c: random.choice(ch_choices), range(length)))
<commit_before>#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): # type: (int) -> str """ Generate a random ID of a given length. """ return ''.join(map(lambda c: random.choice(ch_choices), range(length))) <commit_msg>Fix `gen_uuid` logic and documentation<commit_after>#! /usr/bin/env python # -*- coding: utf-8 -*- # >> # gevent-tasks, 2017 # << import random import string ch_choices = string.ascii_letters + string.digits def gen_uuid(length=4): """ Generate a random ID of a given length. Args: length (int): length of the returned string. Returns: `str` of length ``length``. Example:: >>> gen_uuid() aB6z >>> gen_uuid(10) aAzZ0123mN >>> gen_uuid(None) 9 """ if not length or length < 1: length = 1 return ''.join(map(lambda c: random.choice(ch_choices), range(length)))
69cff805c92810a4ee1d4581be8597f1aa14f78e
lib/game_launchers/steam_game_launcher.py
lib/game_launchers/steam_game_launcher.py
from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": pass # ???
from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess import webbrowser class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": webbrowser.open(f"steam://run/{app_id}")
Add support for launching Steam games on windows through the Steam protocol
Add support for launching Steam games on windows through the Steam protocol
Python
mit
SerpentAI/SerpentAI
from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": pass # ??? Add support for launching Steam games on windows through the Steam protocol
from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess import webbrowser class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": webbrowser.open(f"steam://run/{app_id}")
<commit_before>from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": pass # ??? <commit_msg>Add support for launching Steam games on windows through the Steam protocol<commit_after>
from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess import webbrowser class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": webbrowser.open(f"steam://run/{app_id}")
from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": pass # ??? Add support for launching Steam games on windows through the Steam protocolfrom lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess import webbrowser class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": webbrowser.open(f"steam://run/{app_id}")
<commit_before>from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": pass # ??? <commit_msg>Add support for launching Steam games on windows through the Steam protocol<commit_after>from lib.game_launcher import GameLauncher, GameLauncherException import sys import shlex import subprocess import webbrowser class SteamGameLauncher(GameLauncher): def __init__(self, **kwargs): super().__init__(**kwargs) def launch(self, **kwargs): app_id = kwargs.get("app_id") if app_id is None: raise GameLauncherException("An 'app_id' kwarg is required...") if sys.platform in ["linux", "linux2"]: subprocess.call(shlex.split(f"xdg-open steam://run/{app_id}")) elif sys.platform == "darwin": subprocess.call(shlex.split(f"open steam://run/{app_id}")) elif sys.platform == "windows": webbrowser.open(f"steam://run/{app_id}")
c633112d6336c37e15577eb6d035488cc42bfd59
indra/explanation/model_checker/__init__.py
indra/explanation/model_checker/__init__.py
from .model_checker import ModelChecker, PathResult, PathMetric from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker
from .model_checker import ModelChecker, PathResult, PathMetric, get_path_iter from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker
Add get_path_iter to model_checker importables
Add get_path_iter to model_checker importables
Python
bsd-2-clause
sorgerlab/belpy,johnbachman/indra,johnbachman/indra,bgyori/indra,sorgerlab/belpy,bgyori/indra,johnbachman/belpy,bgyori/indra,sorgerlab/indra,johnbachman/belpy,sorgerlab/indra,johnbachman/belpy,sorgerlab/indra,sorgerlab/belpy,johnbachman/indra
from .model_checker import ModelChecker, PathResult, PathMetric from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker Add get_path_iter to model_checker importables
from .model_checker import ModelChecker, PathResult, PathMetric, get_path_iter from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker
<commit_before>from .model_checker import ModelChecker, PathResult, PathMetric from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker <commit_msg>Add get_path_iter to model_checker importables<commit_after>
from .model_checker import ModelChecker, PathResult, PathMetric, get_path_iter from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker
from .model_checker import ModelChecker, PathResult, PathMetric from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker Add get_path_iter to model_checker importablesfrom .model_checker import ModelChecker, PathResult, PathMetric, get_path_iter from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker
<commit_before>from .model_checker import ModelChecker, PathResult, PathMetric from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker <commit_msg>Add get_path_iter to model_checker importables<commit_after>from .model_checker import ModelChecker, PathResult, PathMetric, get_path_iter from .pysb import PysbModelChecker from .signed_graph import SignedGraphModelChecker from .unsigned_graph import UnsignedGraphModelChecker from .pybel import PybelModelChecker
e8506331cfa5e14029e3de4ccb16c5e0267e85b3
manoseimas/votings/nodes.py
manoseimas/votings/nodes.py
from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create")
from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from sboard.nodes import TagListView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") provideAdapter(TagListView, (IPolicyIssue,))
Use TagListView for IPolicyIssue as default view.
Use TagListView for IPolicyIssue as default view.
Python
agpl-3.0
ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt,ManoSeimas/manoseimas.lt
from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") Use TagListView for IPolicyIssue as default view.
from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from sboard.nodes import TagListView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") provideAdapter(TagListView, (IPolicyIssue,))
<commit_before>from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") <commit_msg>Use TagListView for IPolicyIssue as default view.<commit_after>
from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from sboard.nodes import TagListView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") provideAdapter(TagListView, (IPolicyIssue,))
from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") Use TagListView for IPolicyIssue as default view.from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from sboard.nodes import TagListView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") provideAdapter(TagListView, (IPolicyIssue,))
<commit_before>from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") <commit_msg>Use TagListView for IPolicyIssue as default view.<commit_after>from zope.component import adapts from zope.component import provideAdapter from sboard.nodes import CreateView from sboard.nodes import DetailsView from sboard.nodes import TagListView from .forms import PolicyIssueForm from .interfaces import IVoting from .interfaces import IPolicyIssue class VotingView(DetailsView): adapts(IVoting) templates = { 'details': 'votings/voting_details.html', } provideAdapter(VotingView) class CreatePolicyIssueView(CreateView): adapts(object, IPolicyIssue) form = PolicyIssueForm provideAdapter(CreatePolicyIssueView, name="create") provideAdapter(TagListView, (IPolicyIssue,))
aa59466630fa3e39e8b0f5da40100b62e2194ab8
tests/parser/test_loop_parsing.py
tests/parser/test_loop_parsing.py
from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]])
from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.iteration_loop import IterationLoop from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) def test_iteration_loop_parsing(): loop = parse_local('for number n in numbers') assert isinstance(loop, IterationLoop) assert loop.target == Identifier('n') assert loop.target_type == Identifier('number') assert loop.collection == Identifier('numbers')
Add unit test for iteration loop parsing
Add unit test for iteration loop parsing
Python
mit
ytanay/thinglang,ytanay/thinglang,ytanay/thinglang,ytanay/thinglang
from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) Add unit test for iteration loop parsing
from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.iteration_loop import IterationLoop from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) def test_iteration_loop_parsing(): loop = parse_local('for number n in numbers') assert isinstance(loop, IterationLoop) assert loop.target == Identifier('n') assert loop.target_type == Identifier('number') assert loop.collection == Identifier('numbers')
<commit_before>from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) <commit_msg>Add unit test for iteration loop parsing<commit_after>
from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.iteration_loop import IterationLoop from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) def test_iteration_loop_parsing(): loop = parse_local('for number n in numbers') assert isinstance(loop, IterationLoop) assert loop.target == Identifier('n') assert loop.target_type == Identifier('number') assert loop.collection == Identifier('numbers')
from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) Add unit test for iteration loop parsingfrom tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.iteration_loop import IterationLoop from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) def test_iteration_loop_parsing(): loop = parse_local('for number n in numbers') assert isinstance(loop, IterationLoop) assert loop.target == Identifier('n') assert loop.target_type == Identifier('number') assert loop.collection == Identifier('numbers')
<commit_before>from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) <commit_msg>Add unit test for iteration loop parsing<commit_after>from tests.infrastructure.test_utils import parse_local, validate_types from thinglang.lexer.values.numeric import NumericValue from thinglang.lexer.values.identifier import Identifier from thinglang.parser.blocks.iteration_loop import IterationLoop from thinglang.parser.blocks.loop import Loop from thinglang.parser.values.binary_operation import BinaryOperation from thinglang.parser.values.method_call import MethodCall def validate_loop(node, condition): assert isinstance(node, Loop) if isinstance(condition, list): validate_types(node.value.arguments, condition, (BinaryOperation, MethodCall), lambda x: x.arguments) else: assert isinstance(node.value, condition) def test_simple_loop_conditionals(): validate_loop(parse_local('while i < 5'), [Identifier, NumericValue]) validate_loop(parse_local('while i < j'), [Identifier, Identifier]) def test_method_call_loop_conditionals(): validate_loop(parse_local('while i < Threshold.current(1, 5)'), [Identifier, [NumericValue, NumericValue]]) def test_iteration_loop_parsing(): loop = parse_local('for number n in numbers') assert isinstance(loop, IterationLoop) assert loop.target == Identifier('n') assert loop.target_type == Identifier('number') assert loop.collection == Identifier('numbers')
46344032e016b51e9d34b2620b72e418533374e2
hyper/http20/frame.py
hyper/http20/frame.py
# -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError()
# -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ # A map of type byte to frame class. FRAMES = { 0x00: DataFrame } class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError()
Define a mapping between byte and class.
Define a mapping between byte and class.
Python
mit
Lukasa/hyper,fredthomsen/hyper,Lukasa/hyper,masaori335/hyper,lawnmowerlatte/hyper,jdecuyper/hyper,irvind/hyper,jdecuyper/hyper,lawnmowerlatte/hyper,irvind/hyper,masaori335/hyper,plucury/hyper,plucury/hyper,fredthomsen/hyper
# -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError() Define a mapping between byte and class.
# -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ # A map of type byte to frame class. FRAMES = { 0x00: DataFrame } class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError()
<commit_before># -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError() <commit_msg>Define a mapping between byte and class.<commit_after>
# -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ # A map of type byte to frame class. FRAMES = { 0x00: DataFrame } class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError()
# -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError() Define a mapping between byte and class.# -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ # A map of type byte to frame class. FRAMES = { 0x00: DataFrame } class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError()
<commit_before># -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError() <commit_msg>Define a mapping between byte and class.<commit_after># -*- coding: utf-8 -*- """ hyper/http20/frame ~~~~~~~~~~~~~~~~~~ Defines framing logic for HTTP/2.0. Provides both classes to represent framed data and logic for aiding the connection when it comes to reading from the socket. """ # A map of type byte to frame class. FRAMES = { 0x00: DataFrame } class Frame(object): """ The base class for all HTTP/2.0 frames. """ # The flags defined on this type of frame. defined_flags = [] # The type of the frame. type = 0 def __init__(self, stream_id): self.stream_id = stream_id self.flags = set() def parse_flags(self, flag_byte): for flag, flag_bit in self.defined_flags: if flag_byte & flag_bit: self.flags.add(flag) return self.flags def serialize(self): raise NotImplementedError() def _get_len(self): raise NotImplementedError()
9f4215c6ca5cf8e022b8a6d180f0c47170eee7df
setup.py
setup.py
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.9.1', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser', version='0.9.3', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
Increment version and update keywords.
Increment version and update keywords.
Python
bsd-3-clause
consbio/gis-metadata-parser
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.9.1', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) Increment version and update keywords.
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser', version='0.9.3', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
<commit_before>import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.9.1', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) <commit_msg>Increment version and update keywords.<commit_after>
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser', version='0.9.3', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.9.1', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) Increment version and update keywords.import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser', version='0.9.3', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
<commit_before>import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,metadata,xml,parser', version='0.9.1', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} ) <commit_msg>Increment version and update keywords.<commit_after>import subprocess import sys from setuptools import Command, setup class RunTests(Command): user_options = [] def initialize_options(self): pass def finalize_options(self): pass def run(self): errno = subprocess.call([sys.executable, '-m', 'unittest', 'gis_metadata.tests.tests']) raise SystemExit(errno) setup( name='gis_metadata_parser', description='Parser for GIS metadata standards including FGDC and ISO-19115', keywords='fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser', version='0.9.3', packages=[ 'gis_metadata', 'gis_metadata.tests' ], install_requires=[ 'parserutils', 'six' ], url='https://github.com/consbio/gis-metadata-parser', license='BSD', cmdclass={'test': RunTests} )
98ce3150b6f01e9513fa9ce2da1d505e6350aea6
setup.py
setup.py
import sys from setuptools import setup if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') setup_requires = [] install_requires = [ 'simplemysql', ] setup( name='zipnish', version='0.1.0', description='zipnish', long_description='Micro-services monitoring tool based on Varnish Cache.', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', packages=['logreader', 'logreader.log'], zip_safe=False, install_requires=install_requires, setup_requires=setup_requires, package_data={ 'logreader': ['default.cfg'] }, entry_points={'console_scripts': ['logreader = logreader.app:main']}, scripts=[] )
import sys from setuptools import setup, find_packages if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') def read(filename): with open(filename) as f: return f.read() install_requires = [ 'simplemysql', 'flask', 'sqlalchemy', ] setup( include_package_data=True, name='zipnish', version='0.1.2', description='zipnish', long_description=read('README.rst'), classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', platforms='Linux', packages=find_packages(exclude=['logreader.test']), zip_safe=False, install_requires=install_requires, package_data={ 'logreader': ['default.cfg'], }, entry_points={'console_scripts': ['zipnish-logreader = logreader.app:main', 'zipnish-ui = ui.flask_app:main'], }, scripts=[] )
Read long description from READMe.rst
Read long description from READMe.rst
Python
bsd-2-clause
varnish/zipnish,varnish/zipnish,varnish/varnish-microservice-monitor,varnish/varnish-microservice-monitor,varnish/varnish-microservice-monitor,varnish/zipnish,varnish/zipnish,varnish/varnish-microservice-monitor,varnish/zipnish,varnish/varnish-microservice-monitor
import sys from setuptools import setup if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') setup_requires = [] install_requires = [ 'simplemysql', ] setup( name='zipnish', version='0.1.0', description='zipnish', long_description='Micro-services monitoring tool based on Varnish Cache.', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', packages=['logreader', 'logreader.log'], zip_safe=False, install_requires=install_requires, setup_requires=setup_requires, package_data={ 'logreader': ['default.cfg'] }, entry_points={'console_scripts': ['logreader = logreader.app:main']}, scripts=[] ) Read long description from READMe.rst
import sys from setuptools import setup, find_packages if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') def read(filename): with open(filename) as f: return f.read() install_requires = [ 'simplemysql', 'flask', 'sqlalchemy', ] setup( include_package_data=True, name='zipnish', version='0.1.2', description='zipnish', long_description=read('README.rst'), classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', platforms='Linux', packages=find_packages(exclude=['logreader.test']), zip_safe=False, install_requires=install_requires, package_data={ 'logreader': ['default.cfg'], }, entry_points={'console_scripts': ['zipnish-logreader = logreader.app:main', 'zipnish-ui = ui.flask_app:main'], }, scripts=[] )
<commit_before>import sys from setuptools import setup if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') setup_requires = [] install_requires = [ 'simplemysql', ] setup( name='zipnish', version='0.1.0', description='zipnish', long_description='Micro-services monitoring tool based on Varnish Cache.', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', packages=['logreader', 'logreader.log'], zip_safe=False, install_requires=install_requires, setup_requires=setup_requires, package_data={ 'logreader': ['default.cfg'] }, entry_points={'console_scripts': ['logreader = logreader.app:main']}, scripts=[] ) <commit_msg>Read long description from READMe.rst<commit_after>
import sys from setuptools import setup, find_packages if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') def read(filename): with open(filename) as f: return f.read() install_requires = [ 'simplemysql', 'flask', 'sqlalchemy', ] setup( include_package_data=True, name='zipnish', version='0.1.2', description='zipnish', long_description=read('README.rst'), classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', platforms='Linux', packages=find_packages(exclude=['logreader.test']), zip_safe=False, install_requires=install_requires, package_data={ 'logreader': ['default.cfg'], }, entry_points={'console_scripts': ['zipnish-logreader = logreader.app:main', 'zipnish-ui = ui.flask_app:main'], }, scripts=[] )
import sys from setuptools import setup if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') setup_requires = [] install_requires = [ 'simplemysql', ] setup( name='zipnish', version='0.1.0', description='zipnish', long_description='Micro-services monitoring tool based on Varnish Cache.', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', packages=['logreader', 'logreader.log'], zip_safe=False, install_requires=install_requires, setup_requires=setup_requires, package_data={ 'logreader': ['default.cfg'] }, entry_points={'console_scripts': ['logreader = logreader.app:main']}, scripts=[] ) Read long description from READMe.rstimport sys from setuptools import setup, find_packages if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') def read(filename): with open(filename) as f: return f.read() install_requires = [ 'simplemysql', 'flask', 'sqlalchemy', ] setup( include_package_data=True, name='zipnish', version='0.1.2', description='zipnish', long_description=read('README.rst'), classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', platforms='Linux', packages=find_packages(exclude=['logreader.test']), zip_safe=False, install_requires=install_requires, package_data={ 'logreader': ['default.cfg'], }, entry_points={'console_scripts': ['zipnish-logreader = logreader.app:main', 'zipnish-ui = ui.flask_app:main'], }, scripts=[] )
<commit_before>import sys from setuptools import setup if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') setup_requires = [] install_requires = [ 'simplemysql', ] setup( name='zipnish', version='0.1.0', description='zipnish', long_description='Micro-services monitoring tool based on Varnish Cache.', classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', packages=['logreader', 'logreader.log'], zip_safe=False, install_requires=install_requires, setup_requires=setup_requires, package_data={ 'logreader': ['default.cfg'] }, entry_points={'console_scripts': ['logreader = logreader.app:main']}, scripts=[] ) <commit_msg>Read long description from READMe.rst<commit_after>import sys from setuptools import setup, find_packages if sys.version_info < (2, 7): sys.exit('Zipnish requires at least Python 2.7, please upgrade and try again.') def read(filename): with open(filename) as f: return f.read() install_requires = [ 'simplemysql', 'flask', 'sqlalchemy', ] setup( include_package_data=True, name='zipnish', version='0.1.2', description='zipnish', long_description=read('README.rst'), classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'License :: OSI Approved :: Apache Software License', 'Programming Language :: Python :: 2.7', ], author='Adeel Shahid, Per Buer, Marius Magureanu', author_email='marius@varnish-software.com', url='https://github.com/varnish/zipnish.git', license='Apache License 2.0', platforms='Linux', packages=find_packages(exclude=['logreader.test']), zip_safe=False, install_requires=install_requires, package_data={ 'logreader': ['default.cfg'], }, entry_points={'console_scripts': ['zipnish-logreader = logreader.app:main', 'zipnish-ui = ui.flask_app:main'], }, scripts=[] )
ac84d8743b50a00c49a8ceb81ed69661841bce70
wagtail/core/middleware.py
wagtail/core/middleware.py
import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail28Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in wagtail 2.8. Update your middleware settings.', RemovedInWagtail28Warning, stacklevel=2 ) try: request._wagtail_site = Site.find_for_request(request) except Site.DoesNotExist: request._wagtail_site = None
import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail211Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'Wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in Wagtail 2.11. Update your middleware settings.', RemovedInWagtail211Warning, stacklevel=2 ) try: request.site = Site.find_for_request(request) except Site.DoesNotExist: request.site = None
Revert SiteMiddleware to setting request.site
Revert SiteMiddleware to setting request.site This way, SiteMiddleware continues to support existing user / third-party code that has not yet been migrated from request.site to Site.find_for_request
Python
bsd-3-clause
takeflight/wagtail,takeflight/wagtail,thenewguy/wagtail,thenewguy/wagtail,timorieber/wagtail,wagtail/wagtail,gasman/wagtail,takeflight/wagtail,kaedroho/wagtail,mixxorz/wagtail,wagtail/wagtail,timorieber/wagtail,kaedroho/wagtail,kaedroho/wagtail,rsalmaso/wagtail,rsalmaso/wagtail,FlipperPA/wagtail,thenewguy/wagtail,mixxorz/wagtail,wagtail/wagtail,jnns/wagtail,wagtail/wagtail,mixxorz/wagtail,gasman/wagtail,zerolab/wagtail,zerolab/wagtail,jnns/wagtail,torchbox/wagtail,takeflight/wagtail,gasman/wagtail,thenewguy/wagtail,torchbox/wagtail,torchbox/wagtail,kaedroho/wagtail,rsalmaso/wagtail,zerolab/wagtail,zerolab/wagtail,mixxorz/wagtail,jnns/wagtail,timorieber/wagtail,gasman/wagtail,jnns/wagtail,FlipperPA/wagtail,torchbox/wagtail,mixxorz/wagtail,rsalmaso/wagtail,FlipperPA/wagtail,thenewguy/wagtail,zerolab/wagtail,rsalmaso/wagtail,wagtail/wagtail,timorieber/wagtail,FlipperPA/wagtail,kaedroho/wagtail,gasman/wagtail
import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail28Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in wagtail 2.8. Update your middleware settings.', RemovedInWagtail28Warning, stacklevel=2 ) try: request._wagtail_site = Site.find_for_request(request) except Site.DoesNotExist: request._wagtail_site = None Revert SiteMiddleware to setting request.site This way, SiteMiddleware continues to support existing user / third-party code that has not yet been migrated from request.site to Site.find_for_request
import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail211Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'Wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in Wagtail 2.11. Update your middleware settings.', RemovedInWagtail211Warning, stacklevel=2 ) try: request.site = Site.find_for_request(request) except Site.DoesNotExist: request.site = None
<commit_before>import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail28Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in wagtail 2.8. Update your middleware settings.', RemovedInWagtail28Warning, stacklevel=2 ) try: request._wagtail_site = Site.find_for_request(request) except Site.DoesNotExist: request._wagtail_site = None <commit_msg>Revert SiteMiddleware to setting request.site This way, SiteMiddleware continues to support existing user / third-party code that has not yet been migrated from request.site to Site.find_for_request<commit_after>
import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail211Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'Wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in Wagtail 2.11. Update your middleware settings.', RemovedInWagtail211Warning, stacklevel=2 ) try: request.site = Site.find_for_request(request) except Site.DoesNotExist: request.site = None
import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail28Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in wagtail 2.8. Update your middleware settings.', RemovedInWagtail28Warning, stacklevel=2 ) try: request._wagtail_site = Site.find_for_request(request) except Site.DoesNotExist: request._wagtail_site = None Revert SiteMiddleware to setting request.site This way, SiteMiddleware continues to support existing user / third-party code that has not yet been migrated from request.site to Site.find_for_requestimport warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail211Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'Wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in Wagtail 2.11. Update your middleware settings.', RemovedInWagtail211Warning, stacklevel=2 ) try: request.site = Site.find_for_request(request) except Site.DoesNotExist: request.site = None
<commit_before>import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail28Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in wagtail 2.8. Update your middleware settings.', RemovedInWagtail28Warning, stacklevel=2 ) try: request._wagtail_site = Site.find_for_request(request) except Site.DoesNotExist: request._wagtail_site = None <commit_msg>Revert SiteMiddleware to setting request.site This way, SiteMiddleware continues to support existing user / third-party code that has not yet been migrated from request.site to Site.find_for_request<commit_after>import warnings from django.utils.deprecation import MiddlewareMixin from wagtail.core.models import Site from wagtail.utils.deprecation import RemovedInWagtail211Warning class SiteMiddleware(MiddlewareMixin): def process_request(self, request): """ Set request.site to contain the Site object responsible for handling this request, according to hostname matching rules """ warnings.warn( 'Wagtail SiteMiddleware and the use of request.site is deprecated ' 'and will be removed in Wagtail 2.11. Update your middleware settings.', RemovedInWagtail211Warning, stacklevel=2 ) try: request.site = Site.find_for_request(request) except Site.DoesNotExist: request.site = None
ca1fe65c5008ddba3467b962f2a51f6c034a5006
mopidy_subsonic/__init__.py
mopidy_subsonic/__init__.py
from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __doc__ = """A extension for playing music from Subsonic. This extension handles URIs starting with ``subsonic:`` and enables you to play music using a Subsonic server. See https://github.com/rattboi/mopidy-subsonic/ for further instructions on using this extension. **Issues:** https://github.com/rattboi/mopidy-subsonic/issues **Dependencies:** requests """ __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend]
from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend]
Remove module docstring copied from an old Mopidy extension
Remove module docstring copied from an old Mopidy extension
Python
mit
rattboi/mopidy-subsonic
from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __doc__ = """A extension for playing music from Subsonic. This extension handles URIs starting with ``subsonic:`` and enables you to play music using a Subsonic server. See https://github.com/rattboi/mopidy-subsonic/ for further instructions on using this extension. **Issues:** https://github.com/rattboi/mopidy-subsonic/issues **Dependencies:** requests """ __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend] Remove module docstring copied from an old Mopidy extension
from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend]
<commit_before>from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __doc__ = """A extension for playing music from Subsonic. This extension handles URIs starting with ``subsonic:`` and enables you to play music using a Subsonic server. See https://github.com/rattboi/mopidy-subsonic/ for further instructions on using this extension. **Issues:** https://github.com/rattboi/mopidy-subsonic/issues **Dependencies:** requests """ __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend] <commit_msg>Remove module docstring copied from an old Mopidy extension<commit_after>
from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend]
from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __doc__ = """A extension for playing music from Subsonic. This extension handles URIs starting with ``subsonic:`` and enables you to play music using a Subsonic server. See https://github.com/rattboi/mopidy-subsonic/ for further instructions on using this extension. **Issues:** https://github.com/rattboi/mopidy-subsonic/issues **Dependencies:** requests """ __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend] Remove module docstring copied from an old Mopidy extensionfrom __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend]
<commit_before>from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __doc__ = """A extension for playing music from Subsonic. This extension handles URIs starting with ``subsonic:`` and enables you to play music using a Subsonic server. See https://github.com/rattboi/mopidy-subsonic/ for further instructions on using this extension. **Issues:** https://github.com/rattboi/mopidy-subsonic/issues **Dependencies:** requests """ __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend] <commit_msg>Remove module docstring copied from an old Mopidy extension<commit_after>from __future__ import unicode_literals import os from mopidy import ext, config from mopidy.exceptions import ExtensionError __version__ = '0.2' class SubsonicExtension(ext.Extension): dist_name = 'Mopidy-Subsonic' ext_name = 'subsonic' version = __version__ def get_default_config(self): conf_file = os.path.join(os.path.dirname(__file__), 'ext.conf') return config.read(conf_file) def get_config_schema(self): schema = super(SubsonicExtension, self).get_config_schema() schema['hostname'] = config.Hostname() schema['port'] = config.Port() schema['username'] = config.String() schema['password'] = config.Secret() schema['ssl'] = config.Boolean() return schema def validate_environment(self): try: import libsonic except ImportError as e: raise ExtensionError('Library libsonic not found', e) def get_backend_classes(self): from .actor import SubsonicBackend return [SubsonicBackend]
6d72a1d3b4bd2e1a11e2fb9744353e5d2d9c8863
setup.py
setup.py
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup(cmdclass = {'build_ext': build_ext}, ext_modules = [Extension("lulu_base", ["lulu_base.pyx"]), Extension("ccomp", ["ccomp.pyx"])])
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy def cext(name): return Extension(name, [name + ".pyx"], include_dirs=[numpy.get_include()]) setup(cmdclass = {'build_ext': build_ext}, ext_modules = [cext('lulu_base'), cext('ccomp')])
Add NumPy includes dir for Cython builds.
Add NumPy includes dir for Cython builds.
Python
bsd-3-clause
stefanv/lulu
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup(cmdclass = {'build_ext': build_ext}, ext_modules = [Extension("lulu_base", ["lulu_base.pyx"]), Extension("ccomp", ["ccomp.pyx"])]) Add NumPy includes dir for Cython builds.
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy def cext(name): return Extension(name, [name + ".pyx"], include_dirs=[numpy.get_include()]) setup(cmdclass = {'build_ext': build_ext}, ext_modules = [cext('lulu_base'), cext('ccomp')])
<commit_before>from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup(cmdclass = {'build_ext': build_ext}, ext_modules = [Extension("lulu_base", ["lulu_base.pyx"]), Extension("ccomp", ["ccomp.pyx"])]) <commit_msg>Add NumPy includes dir for Cython builds.<commit_after>
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy def cext(name): return Extension(name, [name + ".pyx"], include_dirs=[numpy.get_include()]) setup(cmdclass = {'build_ext': build_ext}, ext_modules = [cext('lulu_base'), cext('ccomp')])
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup(cmdclass = {'build_ext': build_ext}, ext_modules = [Extension("lulu_base", ["lulu_base.pyx"]), Extension("ccomp", ["ccomp.pyx"])]) Add NumPy includes dir for Cython builds.from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy def cext(name): return Extension(name, [name + ".pyx"], include_dirs=[numpy.get_include()]) setup(cmdclass = {'build_ext': build_ext}, ext_modules = [cext('lulu_base'), cext('ccomp')])
<commit_before>from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext setup(cmdclass = {'build_ext': build_ext}, ext_modules = [Extension("lulu_base", ["lulu_base.pyx"]), Extension("ccomp", ["ccomp.pyx"])]) <commit_msg>Add NumPy includes dir for Cython builds.<commit_after>from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext import numpy def cext(name): return Extension(name, [name + ".pyx"], include_dirs=[numpy.get_include()]) setup(cmdclass = {'build_ext': build_ext}, ext_modules = [cext('lulu_base'), cext('ccomp')])
11a377a03b5d0c7d26f1a49aefb8e9d634f75d95
lib/oeqa/runtime/sanity/comm_btcheck.py
lib/oeqa/runtime/sanity/comm_btcheck.py
from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log)
from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # This is special for edison platform self.target.run('connmanctl enable bluetooth') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log)
Add workaround for edison platform. See IOTOS-1000, it needs 'connmanctl enable bluetooth' before rfkill. Then, the hciconfig could show hci0 device.
Add workaround for edison platform. See IOTOS-1000, it needs 'connmanctl enable bluetooth' before rfkill. Then, the hciconfig could show hci0 device. Signed-off-by: Zhang Jingke <0979c04a6d09a3b3c8dd699e3664fb112fdd2a5b@intel.com>
Python
mit
ostroproject/meta-iotqa,daweiwu/meta-iotqa-1,wanghongjuan/meta-iotqa-1,daweiwu/meta-iotqa-1,wanghongjuan/meta-iotqa-1,wanghongjuan/meta-iotqa-1,wanghongjuan/meta-iotqa-1,daweiwu/meta-iotqa-1,ostroproject/meta-iotqa,ostroproject/meta-iotqa,wanghongjuan/meta-iotqa-1,daweiwu/meta-iotqa-1,ostroproject/meta-iotqa,ostroproject/meta-iotqa,daweiwu/meta-iotqa-1
from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log) Add workaround for edison platform. See IOTOS-1000, it needs 'connmanctl enable bluetooth' before rfkill. Then, the hciconfig could show hci0 device. Signed-off-by: Zhang Jingke <0979c04a6d09a3b3c8dd699e3664fb112fdd2a5b@intel.com>
from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # This is special for edison platform self.target.run('connmanctl enable bluetooth') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log)
<commit_before>from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log) <commit_msg>Add workaround for edison platform. See IOTOS-1000, it needs 'connmanctl enable bluetooth' before rfkill. Then, the hciconfig could show hci0 device. Signed-off-by: Zhang Jingke <0979c04a6d09a3b3c8dd699e3664fb112fdd2a5b@intel.com><commit_after>
from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # This is special for edison platform self.target.run('connmanctl enable bluetooth') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log)
from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log) Add workaround for edison platform. See IOTOS-1000, it needs 'connmanctl enable bluetooth' before rfkill. Then, the hciconfig could show hci0 device. Signed-off-by: Zhang Jingke <0979c04a6d09a3b3c8dd699e3664fb112fdd2a5b@intel.com>from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # This is special for edison platform self.target.run('connmanctl enable bluetooth') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log)
<commit_before>from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log) <commit_msg>Add workaround for edison platform. See IOTOS-1000, it needs 'connmanctl enable bluetooth' before rfkill. Then, the hciconfig could show hci0 device. Signed-off-by: Zhang Jingke <0979c04a6d09a3b3c8dd699e3664fb112fdd2a5b@intel.com><commit_after>from oeqa.oetest import oeRuntimeTest class CommBluetoothTest(oeRuntimeTest): log = "" def target_collect_info(self, cmd): (status, output) = self.target.run(cmd) self.log = self.log + "\n\n[Debug] Command output --- %s: \n" % cmd self.log = self.log + output '''Bluetooth device check''' def test_comm_btcheck(self): '''check bluetooth device''' # un-block software rfkill lock self.target.run('rfkill unblock all') # This is special for edison platform self.target.run('connmanctl enable bluetooth') # Collect system information as log self.target_collect_info("ifconfig") self.target_collect_info("hciconfig") self.target_collect_info("lsmod") # Detect BT device status (status, output) = self.target.run('hciconfig hci0') self.assertEqual(status, 0, msg="Error messages: %s" % self.log)
bcda095b10a9db6ae1745ec4be45f3ee273c75aa
lms/djangoapps/philu_overrides/constants.py
lms/djangoapps/philu_overrides/constants.py
ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!"
ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" class="click-here-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!"
Add relevant css class to clickable link in banner
Add relevant css class to clickable link in banner
Python
agpl-3.0
philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform,philanthropy-u/edx-platform
ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!" Add relevant css class to clickable link in banner
ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" class="click-here-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!"
<commit_before>ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!" <commit_msg>Add relevant css class to clickable link in banner<commit_after>
ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" class="click-here-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!"
ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!" Add relevant css class to clickable link in bannerACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" class="click-here-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!"
<commit_before>ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!" <commit_msg>Add relevant css class to clickable link in banner<commit_after>ACTIVATION_ERROR_MSG_FORMAT = '<span id="resend-activation-span"> Your account has not been activated. Please check your email to activate your account. <a id="resend-activation-link" class="click-here-link" href="{}"> Resend Activation Email </a></span>' ORG_DETAILS_UPDATE_ALERT = 'It has been more than a year since you updated these numbers. Are they still correct?' ORG_OEF_UPDATE_ALERT = 'It has been more than a year since you submitted your OEF assessment. Time to submit a new one!' ACTIVATION_ALERT_TYPE = 'activation' ENROLL_SHARE_TITLE_FORMAT = "Let's take this {} course together" ENROLL_SHARE_DESC_FORMAT = "I just enrolled in Philanthropy University's {} course. Let's take it together!"
6f4beaa772e9b8b9b1de6f6a92c0b7fd00bdd5af
mltsp/science_features/lomb_scargle_fast.py
mltsp/science_features/lomb_scargle_fast.py
import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ opt_args = {'period_range': (2*t.max() / len(t), t.max()), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period
import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ dt = t.max() - t.min() opt_args = {'period_range': (2 * dt / len(t), dt), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period
Use more sensible choice of period_range for `period_fast` feature
Use more sensible choice of period_range for `period_fast` feature Periods searched should depend only on the range of times, rather than the max time.
Python
bsd-3-clause
acrellin/mltsp,mltsp/mltsp,mltsp/mltsp,acrellin/mltsp,bnaul/mltsp,acrellin/mltsp,bnaul/mltsp,mltsp/mltsp,mltsp/mltsp,acrellin/mltsp,bnaul/mltsp,mltsp/mltsp,acrellin/mltsp,bnaul/mltsp,bnaul/mltsp,acrellin/mltsp,mltsp/mltsp,bnaul/mltsp
import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ opt_args = {'period_range': (2*t.max() / len(t), t.max()), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period Use more sensible choice of period_range for `period_fast` feature Periods searched should depend only on the range of times, rather than the max time.
import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ dt = t.max() - t.min() opt_args = {'period_range': (2 * dt / len(t), dt), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period
<commit_before>import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ opt_args = {'period_range': (2*t.max() / len(t), t.max()), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period <commit_msg>Use more sensible choice of period_range for `period_fast` feature Periods searched should depend only on the range of times, rather than the max time.<commit_after>
import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ dt = t.max() - t.min() opt_args = {'period_range': (2 * dt / len(t), dt), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period
import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ opt_args = {'period_range': (2*t.max() / len(t), t.max()), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period Use more sensible choice of period_range for `period_fast` feature Periods searched should depend only on the range of times, rather than the max time.import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ dt = t.max() - t.min() opt_args = {'period_range': (2 * dt / len(t), dt), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period
<commit_before>import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ opt_args = {'period_range': (2*t.max() / len(t), t.max()), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period <commit_msg>Use more sensible choice of period_range for `period_fast` feature Periods searched should depend only on the range of times, rather than the max time.<commit_after>import numpy as np import gatspy def lomb_scargle_fast_period(t, m, e): """Fits a simple sinuosidal model y(t) = A sin(2*pi*w*t + phi) + c and returns the estimated period 1/w. Much faster than fitting the full multi-frequency model used by `science_features.lomb_scargle`. """ dt = t.max() - t.min() opt_args = {'period_range': (2 * dt / len(t), dt), 'quiet': True} model = gatspy.periodic.LombScargleFast(fit_period=True, optimizer_kwds=opt_args) model.fit(t, m, e) return model.best_period
222cc6a9910f4fc44fd15a64da5db52a94d9a3c3
setup.py
setup.py
# coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() )
# coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = PyGitUp.gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() )
Use full module path for entry point
Use full module path for entry point
Python
mit
christer155/PyGitUp,christer155/PyGitUp,msiemens/PyGitUp
# coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() ) Use full module path for entry point
# coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = PyGitUp.gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() )
<commit_before># coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() ) <commit_msg>Use full module path for entry point<commit_after>
# coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = PyGitUp.gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() )
# coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() ) Use full module path for entry point# coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = PyGitUp.gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() )
<commit_before># coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() ) <commit_msg>Use full module path for entry point<commit_after># coding=utf-8 from setuptools import setup, find_packages setup( name="git-up", version="1.3.0", packages=find_packages(exclude=["tests"]), scripts=['PyGitUp/gitup.py'], install_requires=['GitPython==1.0.0', 'colorama==0.3.3', 'termcolor==1.1.0', 'docopt==0.6.2', 'six==1.9.0'], # Tests test_suite="nose.collector", tests_require='nose', # Executable entry_points={ 'console_scripts': [ 'git-up = PyGitUp.gitup:run' ] }, # Additional data package_data={ 'PyGitUp': ['check-bundler.rb'], '': ['README.rst', 'LICENCE'] }, zip_safe=False, # Metadata author="Markus Siemens", author_email="markus@m-siemens.de", description="A python implementation of 'git up'", license="MIT", keywords="git git-up", url="https://github.com/msiemens/PyGitUp", classifiers=[ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Topic :: Software Development :: Version Control", "Topic :: Utilities" ], long_description=open('README.rst').read() )
69b6652e3e804ccf1cef43a5ec157629bb0bfa5f
setup.py
setup.py
#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = ['argparse>=0.8'], # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} )
#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() import sys if sys.version_info < (2, 7): install_requires = ['argparse>=0.8'] else: install_requires = [] setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = install_requires, # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} )
Make argparse dependency optional if running Python 2.7
Make argparse dependency optional if running Python 2.7 Signed-off-by: Daniel Farina <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@heroku.com>
Python
bsd-3-clause
wal-e/wal-e,x86Labs/wal-e,equa/wal-e,DataDog/wal-e,fdr/heroku-wal-e,fdr/wal-e,heroku/wal-e,tenstartups/wal-e,alex/wal-e,intoximeters/wal-e,modulexcite/wal-e,RichardKnop/wal-e,nagual13/wal-e,ArtemZ/wal-e,ajmarks/wal-e
#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = ['argparse>=0.8'], # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} ) Make argparse dependency optional if running Python 2.7 Signed-off-by: Daniel Farina <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@heroku.com>
#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() import sys if sys.version_info < (2, 7): install_requires = ['argparse>=0.8'] else: install_requires = [] setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = install_requires, # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} )
<commit_before>#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = ['argparse>=0.8'], # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} ) <commit_msg>Make argparse dependency optional if running Python 2.7 Signed-off-by: Daniel Farina <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@heroku.com><commit_after>
#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() import sys if sys.version_info < (2, 7): install_requires = ['argparse>=0.8'] else: install_requires = [] setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = install_requires, # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} )
#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = ['argparse>=0.8'], # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} ) Make argparse dependency optional if running Python 2.7 Signed-off-by: Daniel Farina <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@heroku.com>#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() import sys if sys.version_info < (2, 7): install_requires = ['argparse>=0.8'] else: install_requires = [] setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = install_requires, # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} )
<commit_before>#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = ['argparse>=0.8'], # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} ) <commit_msg>Make argparse dependency optional if running Python 2.7 Signed-off-by: Daniel Farina <3d0f3b9ddcacec30c4008c5e030e6c13a478cb4f@heroku.com><commit_after>#!/usr/bin/env python import os.path # Version file managment scheme and graceful degredation for # setuptools borrowed and adapted from GitPython. try: from setuptools import setup, find_packages except ImportError: from ez_setup import use_setuptools use_setuptools() from setuptools import setup, find_packages v = open(os.path.join(os.path.dirname(__file__), 'VERSION')) VERSION = v.readline().strip() v.close() import sys if sys.version_info < (2, 7): install_requires = ['argparse>=0.8'] else: install_requires = [] setup( name = "WAL-E", version = VERSION, packages = find_packages(), install_requires = install_requires, # metadata for upload to PyPI author = "Daniel Farina", author_email = "daniel@heroku.com", description = "PostgreSQL WAL-shipping for S3", license = "BSD", keywords = "postgresql database backup", url = "https://github.com/heroku/wal-e", # install entry_points = {'console_scripts': ['wal-e = wal_e.wal_e:main']} )
7b1a721f57133049c82a486df3393df677daea07
rex/exploit/exploit.py
rex/exploit/exploit.py
import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques
import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some shellcode self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques
Complete a sentence in a comment
Complete a sentence in a comment
Python
bsd-2-clause
shellphish/rex,shellphish/rex
import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques Complete a sentence in a comment
import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some shellcode self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques
<commit_before>import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques <commit_msg>Complete a sentence in a comment<commit_after>
import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some shellcode self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques
import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques Complete a sentence in a commentimport angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some shellcode self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques
<commit_before>import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques <commit_msg>Complete a sentence in a comment<commit_after>import angr from .shellcode_manager import ShellcodeManager from rex.exploit import CannotExploit import logging l = logging.getLogger("rex.exploit.Exploit") class Exploit(object): ''' Exploit object which can leak flags or set registers ''' def __init__(self, crash): ''' :param crash: an exploitable crash object :param use_rop_cache: should rop gadgets be cached? :param rop_cache_file: which filename to use for a rop cache ''' if not crash.exploitable(): raise CannotExploit("crash cannot be exploited") self.crash = crash self.binary = crash.binary self.os = crash.project.loader.main_bin.os project = angr.Project(self.binary) # let's put together our rop gadgets self.rop = project.analyses.ROP() # and let's gather some shellcode self.shellcode = ShellcodeManager(project) self.payloads = [ ] def initialize(self): l.info("accumulating rop gadgets") self.rop.find_gadgets() for technique in Techniques[self.os]: p = technique(self.crash, self.rop, self.shellcode) try: l.debug("applying technique %s", p.name) self.payloads.append(p.apply()) except CannotExploit as e: l.debug("technique failed: %s", e.message) from .techniques import Techniques
231291ca9190f802f2132874cd55c1fc63b13b56
setup.py
setup.py
# encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='SimPy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], )
# encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='simpy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], )
Change SimPy to simpy for the package name.
Change SimPy to simpy for the package name.
Python
mit
Uzere/uSim
# encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='SimPy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], ) Change SimPy to simpy for the package name.
# encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='simpy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], )
<commit_before># encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='SimPy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], ) <commit_msg>Change SimPy to simpy for the package name.<commit_after>
# encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='simpy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], )
# encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='SimPy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], ) Change SimPy to simpy for the package name.# encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='simpy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], )
<commit_before># encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='SimPy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], ) <commit_msg>Change SimPy to simpy for the package name.<commit_after># encoding: utf-8 from setuptools import setup, find_packages import simpy setup( name='simpy', version=simpy.__version__, author='Ontje Lünsdorf, Stefan Scherfke', author_email='the_com at gmx.de; stefan at sofa-rockers.org', description='Event discrete, process based simulation for Python.', long_description=(open('README.txt').read() + '\n\n' + open('CHANGES.txt').read() + '\n\n' + open('AUTHORS.txt').read()), url='https://simpy.rtfd.org', download_url='https://bitbucket.org/simpy/simpy/downloads', license='MIT License', install_requires=[], packages=find_packages(), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', 'Intended Audience :: Developers', 'Intended Audience :: Education', 'Intended Audience :: Science/Research', 'License :: OSI Approved :: MIT License', 'Natural Language :: English', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: Implementation :: PyPy', 'Topic :: Scientific/Engineering', ], )
d1e20c37db3e94b09bc03819ce561d5fef6d8189
setup.py
setup.py
from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0.dev', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] )
from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] )
Remove the .dev from version.
Remove the .dev from version.
Python
apache-2.0
bdastur/buckets
from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0.dev', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] ) Remove the .dev from version.
from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] )
<commit_before>from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0.dev', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] ) <commit_msg>Remove the .dev from version.<commit_after>
from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] )
from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0.dev', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] ) Remove the .dev from version.from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] )
<commit_before>from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0.dev', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] ) <commit_msg>Remove the .dev from version.<commit_after>from setuptools import setup, find_packages with open('README.md') as fhandle: long_description = fhandle.read() setup( name='buckets', version='1.0.0', description='managing data by relevancy.', long_description=long_description, url="https://github.com/bdastur/spam", author="Behzad Dastur", author_email="bdastur@gmail.com", license='Apache Software License', classifier=[ 'Development Status :: 3 - Alpha', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Intended Audience :: Developers', 'License :: Apache Software License', 'Topic :: Software Development :: Libraries', 'Topic :: Utilities', 'License :: OSI Approved :: Apache Software License', 'Operating System :: POSIX :: Linux', 'Operating System :: MacOS', ], keywords='buckets utility ', py_modules=['buckets'] )
1d4ea99dfae26491752ec95b5bfaf949fc592e75
setup.py
setup.py
# -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['Programming Language :: Python', 'License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS)
# -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS)
Make supported Python versions clear: 2.6 and 2.7 for now.
Make supported Python versions clear: 2.6 and 2.7 for now.
Python
bsd-3-clause
benoitbryon/xal,benoitbryon/xal
# -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['Programming Language :: Python', 'License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS) Make supported Python versions clear: 2.6 and 2.7 for now.
# -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS)
<commit_before># -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['Programming Language :: Python', 'License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS) <commit_msg>Make supported Python versions clear: 2.6 and 2.7 for now.<commit_after>
# -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS)
# -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['Programming Language :: Python', 'License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS) Make supported Python versions clear: 2.6 and 2.7 for now.# -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS)
<commit_before># -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['Programming Language :: Python', 'License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS) <commit_msg>Make supported Python versions clear: 2.6 and 2.7 for now.<commit_after># -*- coding: utf-8 -*- """Python packaging.""" import os from setuptools import setup here = os.path.abspath(os.path.dirname(__file__)) NAME = 'xal' DESCRIPTION = """Execution abstraction layer for high-level system scripts.""" README = open(os.path.join(here, 'README')).read() VERSION = open(os.path.join(here, 'VERSION')).read().strip() PACKAGES = [NAME] REQUIREMENTS = ['setuptools'] ENTRY_POINTS = {} CLASSIFIERS = ['License :: OSI Approved :: BSD License', 'Development Status :: 1 - Planning', 'Intended Audience :: Developers', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7'] if __name__ == '__main__': # Don't run setup() when we import this module. setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=README, classifiers=CLASSIFIERS, keywords='subprocess', author='Benoît Bryon', author_email='benoit@marmelune.net', url='https://github.com/benoitbryon/%s' % NAME, packages=PACKAGES, include_package_data=True, zip_safe=False, install_requires=REQUIREMENTS, entry_points=ENTRY_POINTS)
060691f8187fca7975063e4da3b535c61aacc7dd
setup.py
setup.py
from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } )
from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", 'python-slugify >= 0.0.6', "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } )
Include Python-slugify to begin using their slugging function
Include Python-slugify to begin using their slugging function
Python
mit
stefanw/dataset,reubano/dataset,saimn/dataset,pudo/dataset,askebos/dataset,twds/dataset,vguzmanp/dataset
from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } ) Include Python-slugify to begin using their slugging function
from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", 'python-slugify >= 0.0.6', "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } )
<commit_before>from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } ) <commit_msg>Include Python-slugify to begin using their slugging function<commit_after>
from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", 'python-slugify >= 0.0.6', "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } )
from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } ) Include Python-slugify to begin using their slugging functionfrom setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", 'python-slugify >= 0.0.6', "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } )
<commit_before>from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } ) <commit_msg>Include Python-slugify to begin using their slugging function<commit_after>from setuptools import setup, find_packages setup( name='dataset', version='0.3.13', description="Toolkit for Python-based data processing.", long_description="", classifiers=[ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", ], keywords='sql sqlalchemy etl loading utility', author='Friedrich Lindenberg, Gregor Aisch', author_email='info@okfn.org', url='http://github.com/pudo/dataset', license='MIT', packages=find_packages(exclude=['ez_setup', 'examples', 'tests']), namespace_packages=[], include_package_data=False, zip_safe=False, install_requires=[ 'sqlalchemy >= 0.8.1', 'sqlalchemy-migrate >= 0.7', "argparse >= 1.2.1", 'python-slugify >= 0.0.6', "PyYAML >= 3.10" ], tests_require=[], entry_points={ 'console_scripts': [ 'datafreeze = dataset.freeze.app:main', ] } )
374729efac2b79d1b4459c76932d7149988f5fe3
setup.py
setup.py
from distutils.core import setup setup( name='tspapi', version='0.1.0', url="http://boundary.github.io/pulse-api-python/", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], )
from distutils.core import setup setup( name='tspapi', version='0.1.1', url="https://github.com/boundary/pulse-api-python", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], )
Add correct URL ; increment version
Add correct URL ; increment version
Python
apache-2.0
jdgwartney/pulse-api-python
from distutils.core import setup setup( name='tspapi', version='0.1.0', url="http://boundary.github.io/pulse-api-python/", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], ) Add correct URL ; increment version
from distutils.core import setup setup( name='tspapi', version='0.1.1', url="https://github.com/boundary/pulse-api-python", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], )
<commit_before>from distutils.core import setup setup( name='tspapi', version='0.1.0', url="http://boundary.github.io/pulse-api-python/", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], ) <commit_msg>Add correct URL ; increment version<commit_after>
from distutils.core import setup setup( name='tspapi', version='0.1.1', url="https://github.com/boundary/pulse-api-python", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], )
from distutils.core import setup setup( name='tspapi', version='0.1.0', url="http://boundary.github.io/pulse-api-python/", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], ) Add correct URL ; increment versionfrom distutils.core import setup setup( name='tspapi', version='0.1.1', url="https://github.com/boundary/pulse-api-python", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], )
<commit_before>from distutils.core import setup setup( name='tspapi', version='0.1.0', url="http://boundary.github.io/pulse-api-python/", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], ) <commit_msg>Add correct URL ; increment version<commit_after>from distutils.core import setup setup( name='tspapi', version='0.1.1', url="https://github.com/boundary/pulse-api-python", author='David Gwartney', author_email='david_gwartney@bmc.com', packages=['tspapi', ], # entry_points={ # 'console_scripts': [ # 'actionhandler = boundary.webhook_handler:main', # ], # }, # scripts=[ # 'tsp-cli-env.sh', # ], # package_data={'boundary': ['templates/*']}, license='Apache 2', description='Python Bindings for the TrueSight Pulse REST APIs', long_description=open('README.txt').read(), install_requires=[ "requests >= 2.3.0", ], )
f5c93124a12331cadee8178009e8d22ce49883c5
setup.py
setup.py
# -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], )
# -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], tests_require=["twisted", "trio"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], )
Add tests_require field (might fix COPR build?)
Add tests_require field (might fix COPR build?)
Python
mit
jfhbrook/pyee
# -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], ) Add tests_require field (might fix COPR build?)
# -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], tests_require=["twisted", "trio"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], )
<commit_before># -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], ) <commit_msg>Add tests_require field (might fix COPR build?)<commit_after>
# -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], tests_require=["twisted", "trio"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], )
# -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], ) Add tests_require field (might fix COPR build?)# -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], tests_require=["twisted", "trio"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], )
<commit_before># -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], ) <commit_msg>Add tests_require field (might fix COPR build?)<commit_after># -*- coding: utf-8 -*- from os import path from setuptools import find_packages, setup README_rst = path.join(path.abspath(path.dirname(__file__)), "README.rst") with open(README_rst, "r") as f: long_description = f.read() setup( name="pyee", version="9.0.1", packages=find_packages(), include_package_data=True, description="A port of node.js's EventEmitter to python.", long_description=long_description, author="Josh Holbrook", author_email="josh.holbrook@gmail.com", url="https://github.com/jfhbrook/pyee", license="MIT", keywords=["events", "emitter", "node.js", "node", "eventemitter", "event_emitter"], install_requires=["typing-extensions"], tests_require=["twisted", "trio"], classifiers=[ "Programming Language :: Python", "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Topic :: Other/Nonlisted Topic", ], )
25da519492abb9c77968830adbe6504ebb3e3cee
setup.py
setup.py
#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.0' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, )
#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.1' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, )
Bump version in preparation for release. Beta status
Bump version in preparation for release. Beta status
Python
bsd-3-clause
adlibre/python-bureaucrat
#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.0' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, ) Bump version in preparation for release. Beta status
#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.1' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, )
<commit_before>#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.0' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, ) <commit_msg>Bump version in preparation for release. Beta status<commit_after>
#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.1' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, )
#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.0' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, ) Bump version in preparation for release. Beta status#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.1' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, )
<commit_before>#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.0' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 3 - Alpha", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, ) <commit_msg>Bump version in preparation for release. Beta status<commit_after>#!/usr/bin/env python import sys from setuptools import setup VERSION = '0.2.1' install_requires = [] if sys.version_info < (2, 7): install_requires.append('argparse') try: from pypandoc import convert read_md = lambda f: convert(f, 'rst') except ImportError: print("Warning: pypandoc module not found, could not convert Markdown to RST") read_md = lambda f: open(f, 'r').read() setup(name='bureaucrat', version=VERSION, author="Andrew Cutler", author_email="andrew@adlibre.com.au", description="Procfile and Deployfile process manager for virtual environments", license="BSD", long_description=read_md('README.md'), url='https://github.com/adlibre/python-bureaucrat', download_url='https://github.com/adlibre/python-bureaucrat/archive/v%s.tar.gz' % VERSION, classifiers=[ "Development Status :: 4 - Beta", "Environment :: Console", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: Unix", "Programming Language :: Python", "Topic :: Utilities", ], scripts=['bureaucrat'], install_requires=install_requires, )
ec9f75c1b53abd3cc91f7ff95816cf933917b1ba
setup.py
setup.py
import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, )
import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'pytest-watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, )
Add pytest-watch to console scripts to match the name.
Add pytest-watch to console scripts to match the name.
Python
mit
blueyed/pytest-watch,rakjin/pytest-watch,ColtonProvias/pytest-watch,joeyespo/pytest-watch
import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, ) Add pytest-watch to console scripts to match the name.
import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'pytest-watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, )
<commit_before>import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, ) <commit_msg>Add pytest-watch to console scripts to match the name.<commit_after>
import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'pytest-watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, )
import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, ) Add pytest-watch to console scripts to match the name.import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'pytest-watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, )
<commit_before>import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, ) <commit_msg>Add pytest-watch to console scripts to match the name.<commit_after>import os from setuptools import setup, find_packages def read(filename): with open(os.path.join(os.path.dirname(__file__), filename)) as f: return f.read() setup( name='pytest-watch', version='3.1.0', description='Local continuous test runner with pytest and watchdog.', long_description=read('README.md'), author='Joe Esposito', author_email='joe@joeyespo.com', url='http://github.com/joeyespo/pytest-watch', license='MIT', platforms='any', packages=find_packages(), install_requires=read('requirements.txt').splitlines(), entry_points={ 'console_scripts': [ 'py.test.watch = pytest_watch.command:main', 'pytest-watch = pytest_watch.command:main', 'ptw = pytest_watch.command:main', ] }, )
cf2d13319a2e55aa74d72a93889ee27926172e67
setup.py
setup.py
import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], )
import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', package_data = { 'playhouse': ['berkeley_build.sh']}, packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], )
Add berkeley_build to package data.
Add berkeley_build to package data.
Python
mit
coreos/peewee,ronyb29/peewee,mackjoner/peewee,d1hotpep/peewee,jnovinger/peewee,bopo/peewee,Dipsomaniac/peewee,coreos/peewee,jnovinger/peewee,jarrahwu/peewee,bopo/peewee,coleifer/peewee,coleifer/peewee,fuzeman/peewee,fuzeman/peewee,softside/peewee,wenxer/peewee,d1hotpep/peewee,jarrahwu/peewee,bopo/peewee,stas/peewee,lez/peewee,new-xiaji/peewee,py4a/peewee,zhang625272514/peewee,coreos/peewee,zhang625272514/peewee,zhang625272514/peewee,teserak/peewee,Sunzhifeng/peewee,new-xiaji/peewee,coleifer/peewee,ghukill/peewee,wenxer/peewee,Sunzhifeng/peewee,Sunzhifeng/peewee,jarrahwu/peewee,new-xiaji/peewee,Dipsomaniac/peewee,Dipsomaniac/peewee
import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], ) Add berkeley_build to package data.
import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', package_data = { 'playhouse': ['berkeley_build.sh']}, packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], )
<commit_before>import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], ) <commit_msg>Add berkeley_build to package data.<commit_after>
import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', package_data = { 'playhouse': ['berkeley_build.sh']}, packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], )
import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], ) Add berkeley_build to package data.import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', package_data = { 'playhouse': ['berkeley_build.sh']}, packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], )
<commit_before>import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], ) <commit_msg>Add berkeley_build to package data.<commit_after>import os from setuptools import find_packages from setuptools import setup f = open(os.path.join(os.path.dirname(__file__), 'README.rst')) readme = f.read() f.close() setup( name='peewee', version=__import__('peewee').__version__, description='a little orm', long_description=readme, author='Charles Leifer', author_email='coleifer@gmail.com', url='http://github.com/coleifer/peewee/', package_data = { 'playhouse': ['berkeley_build.sh']}, packages=['playhouse'], py_modules=['peewee', 'pwiz'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', ], test_suite='tests', scripts = ['pwiz.py'], )
9c2321585ef47634723b69bfa190719c17e3183f
roundware/rw/fields.py
roundware/rw/fields.py
from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField import pyclamav class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"])
from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name import pyclamav has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"])
Move pyclamav import inside of clean method on RWValidatedFileField so that it doesn't get imported by streamscript or unless as needed for field validation
Move pyclamav import inside of clean method on RWValidatedFileField so that it doesn't get imported by streamscript or unless as needed for field validation
Python
agpl-3.0
IMAmuseum/roundware-server,yangjackascd/roundware-server,jslootbeek/roundware-server,probabble/roundware-server,jslootbeek/roundware-server,eosrei/roundware-server,probabble/roundware-server,yangjackascd/roundware-server,eosrei/roundware-server,eosrei/roundware-server,Karlamon/roundware-server,IMAmuseum/roundware-server,IMAmuseum/roundware-server,Karlamon/roundware-server,probabble/roundware-server,IMAmuseum/roundware-server,eosrei/roundware-server,probabble/roundware-server,jslootbeek/roundware-server,jslootbeek/roundware-server,Karlamon/roundware-server,yangjackascd/roundware-server,yangjackascd/roundware-server,Karlamon/roundware-server
from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField import pyclamav class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"]) Move pyclamav import inside of clean method on RWValidatedFileField so that it doesn't get imported by streamscript or unless as needed for field validation
from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name import pyclamav has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"])
<commit_before>from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField import pyclamav class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"]) <commit_msg>Move pyclamav import inside of clean method on RWValidatedFileField so that it doesn't get imported by streamscript or unless as needed for field validation<commit_after>
from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name import pyclamav has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"])
from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField import pyclamav class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"]) Move pyclamav import inside of clean method on RWValidatedFileField so that it doesn't get imported by streamscript or unless as needed for field validationfrom django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name import pyclamav has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"])
<commit_before>from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField import pyclamav class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"]) <commit_msg>Move pyclamav import inside of clean method on RWValidatedFileField so that it doesn't get imported by streamscript or unless as needed for field validation<commit_after>from django.forms import forms from south.modelsinspector import add_introspection_rules from validatedfile.fields import ValidatedFileField class RWValidatedFileField(ValidatedFileField): """ Same as FileField, but you can specify: * content_types - list containing allowed content_types. Example: ['application/pdf', 'image/jpeg'] """ def __init__(self, content_types=None, **kwargs): if content_types: self.content_types = content_types super(RWValidatedFileField, self).__init__(**kwargs) def clean(self, *args, **kwargs): # ValidatedFileField.clean will check the MIME type from the # http headers and by peeking in the file data = super(RWValidatedFileField, self).clean(*args, **kwargs) file = data.file # next scan with pyclamav tmpfile = file.file.name import pyclamav has_virus, virus_name = pyclamav.scanfile(tmpfile) if has_virus: fn = file.name raise forms.ValidationError( 'The file %s you uploaded appears to contain a virus or be' 'malware (%s).' % (fn, virus_name) ) return data add_introspection_rules([], ["^roundware\.rw\.fields\.RWValidatedFileField"])
2c0116290c6017c8cad06eec1795be5aa61c7f57
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.1', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=['python-debian', 'stdeb'], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']})
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.2', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=[ 'python-debian', # proper dependency 'stdeb', # proper dependency 'chardet', # transitive dependency of `python-debian'... (no one gets dependencies right :-) ], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']})
Document missing dependency of python-debian
Document missing dependency of python-debian
Python
mit
paylogic/py2deb,paylogic/py2deb
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.1', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=['python-debian', 'stdeb'], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']}) Document missing dependency of python-debian
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.2', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=[ 'python-debian', # proper dependency 'stdeb', # proper dependency 'chardet', # transitive dependency of `python-debian'... (no one gets dependencies right :-) ], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']})
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.1', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=['python-debian', 'stdeb'], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']}) <commit_msg>Document missing dependency of python-debian<commit_after>
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.2', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=[ 'python-debian', # proper dependency 'stdeb', # proper dependency 'chardet', # transitive dependency of `python-debian'... (no one gets dependencies right :-) ], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']})
#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.1', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=['python-debian', 'stdeb'], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']}) Document missing dependency of python-debian#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.2', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=[ 'python-debian', # proper dependency 'stdeb', # proper dependency 'chardet', # transitive dependency of `python-debian'... (no one gets dependencies right :-) ], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']})
<commit_before>#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.1', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=['python-debian', 'stdeb'], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']}) <commit_msg>Document missing dependency of python-debian<commit_after>#!/usr/bin/env python from setuptools import setup, find_packages setup(name='pl-py2deb', version='0.5.2', description='A tool to convert python packages to debian packages.', author='Arjan Verwer', author_email='arjan.verwer@paylogic.eu', url='https://wiki.paylogic.eu/', packages=find_packages(), package_data={'py2deb': ['config/*.ini']}, install_requires=[ 'python-debian', # proper dependency 'stdeb', # proper dependency 'chardet', # transitive dependency of `python-debian'... (no one gets dependencies right :-) ], entry_points={'console_scripts': ['pl-py2deb = py2deb:main']})
0b56816dbb9ace028a003914f7ecbd0539ff812c
setup.py
setup.py
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1' component_name = 'moves-event' setup(name=component_name, version='0.1', description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name, download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1.0' component_name = 'moves-event' setup(name=component_name, version=current_version, description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name + '/', #download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', download_url='https://github.com/francxk/'+component_name+'/archive/' + component_name+ '-' +current_version + '.tar.gz', #download_url='http://github.com/francxk/'+component_name+'/tarball/master', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )
Add decorator for token management
Add decorator for token management
Python
mit
francxk/moves-event,francxk/moves-event
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1' component_name = 'moves-event' setup(name=component_name, version='0.1', description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name, download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )Add decorator for token management
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1.0' component_name = 'moves-event' setup(name=component_name, version=current_version, description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name + '/', #download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', download_url='https://github.com/francxk/'+component_name+'/archive/' + component_name+ '-' +current_version + '.tar.gz', #download_url='http://github.com/francxk/'+component_name+'/tarball/master', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1' component_name = 'moves-event' setup(name=component_name, version='0.1', description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name, download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )<commit_msg>Add decorator for token management<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1.0' component_name = 'moves-event' setup(name=component_name, version=current_version, description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name + '/', #download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', download_url='https://github.com/francxk/'+component_name+'/archive/' + component_name+ '-' +current_version + '.tar.gz', #download_url='http://github.com/francxk/'+component_name+'/tarball/master', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1' component_name = 'moves-event' setup(name=component_name, version='0.1', description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name, download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )Add decorator for token management#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1.0' component_name = 'moves-event' setup(name=component_name, version=current_version, description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name + '/', #download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', download_url='https://github.com/francxk/'+component_name+'/archive/' + component_name+ '-' +current_version + '.tar.gz', #download_url='http://github.com/francxk/'+component_name+'/tarball/master', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1' component_name = 'moves-event' setup(name=component_name, version='0.1', description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name, download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )<commit_msg>Add decorator for token management<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 20 oct. 2013 @author: franck roudet ''' from setuptools import setup, find_packages current_version = '0.1.0' component_name = 'moves-event' setup(name=component_name, version=current_version, description='Generate Django Moves Signal', author='Franck Roudet', author_email='anon@fr.fr', url='https://github.com/francxk/' + component_name + '/', #download_url='https://github.com/francxk/'+component_name+'/archive/v'+current_version + '.tar.gz', download_url='https://github.com/francxk/'+component_name+'/archive/' + component_name+ '-' +current_version + '.tar.gz', #download_url='http://github.com/francxk/'+component_name+'/tarball/master', packages=find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"]), package_data={'': ['LICENSE', 'NOTICE'],}, install_requires=open('requirements.txt').read(), long_description=open('README.rst').read(), classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Topic :: Software Development :: Libraries :: Python Modules', ], include_package_data=True, license=open('LICENSE.txt').read(), zip_safe=False, )
b4cb9768918fd6c6dd206d8ea081539e1f2285c9
setup.py
setup.py
#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'yaml', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ )
#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ )
Remove yaml from install_requires. It is not a valid package
Remove yaml from install_requires. It is not a valid package
Python
bsd-3-clause
NSLS-II/lightsource2-recipes,NSLS-II/lightsource2-recipes,NSLS-II/lightsource2-recipes,NSLS-II/auto-build-tagged-recipes,NSLS-II/lightsource2-recipes,NSLS-II/auto-build-tagged-recipes
#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'yaml', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ ) Remove yaml from install_requires. It is not a valid package
#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ )
<commit_before>#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'yaml', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ ) <commit_msg>Remove yaml from install_requires. It is not a valid package<commit_after>
#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ )
#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'yaml', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ ) Remove yaml from install_requires. It is not a valid package#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ )
<commit_before>#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'yaml', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ ) <commit_msg>Remove yaml from install_requires. It is not a valid package<commit_after>#!/usr/bin/env python, from setuptools import setup, find_packages import versioneer setup( version=versioneer.get_version(), cmdclass=versioneer.get_cmdclass(), name='nsls2-auto-builder', description='toolset for analyzing automated conda package building at NSLS2', author='Eric Dill', author_email='edill@bnl.gov', url='https://github.com/ericdill/conda_build_utils', packages=find_packages(), include_package_data=True, install_requires=['click', 'pyyaml'], entry_points=""" [console_scripts] devbuild=nsls2_build_tools.build:cli """ )
09bd6564b172e6bad10315359e49aa03e1c7e6e1
setup.py
setup.py
""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], install_requires=install_requires if install_requires else '', tests_requires=tests_requires, )
""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], # install_requires=install_requires, tests_requires=tests_requires, )
Remove install_requires since it's empty
Remove install_requires since it's empty
Python
apache-2.0
rachekalmir/pyJolt
""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], install_requires=install_requires if install_requires else '', tests_requires=tests_requires, ) Remove install_requires since it's empty
""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], # install_requires=install_requires, tests_requires=tests_requires, )
<commit_before>""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], install_requires=install_requires if install_requires else '', tests_requires=tests_requires, ) <commit_msg>Remove install_requires since it's empty<commit_after>
""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], # install_requires=install_requires, tests_requires=tests_requires, )
""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], install_requires=install_requires if install_requires else '', tests_requires=tests_requires, ) Remove install_requires since it's empty""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], # install_requires=install_requires, tests_requires=tests_requires, )
<commit_before>""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], install_requires=install_requires if install_requires else '', tests_requires=tests_requires, ) <commit_msg>Remove install_requires since it's empty<commit_after>""" Python JOLT Implementation """ from setuptools import setup import configparser config = configparser.ConfigParser() config.read('Pipfile') install_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['packages'].items())) tests_requires = list(map(lambda v: v[0] + v[1].strip("'"), config['dev-packages'].items())) setup( name='pyjolt', version='0.0.1', description='Python JOLT Implementation', long_description=__doc__, author='rachekalmir', author_email='rachekalmir@users.noreply.github.com', url='https://github.com/rachekalmir/pyjolt/', license='Apache 2.0', packages=['pyjolt'], # install_requires=install_requires, tests_requires=tests_requires, )
685b5e6965bd45ed3240b3da9dfaaf27f25882a0
setup.py
setup.py
from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.2.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] )
from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.3.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] )
Bump version for UDF/blob support
Bump version for UDF/blob support
Python
bsd-3-clause
uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco,uwescience/raco
from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.2.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] ) Bump version for UDF/blob support
from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.3.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] )
<commit_before>from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.2.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] ) <commit_msg>Bump version for UDF/blob support<commit_after>
from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.3.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] )
from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.2.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] ) Bump version for UDF/blob supportfrom setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.3.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] )
<commit_before>from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.2.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] ) <commit_msg>Bump version for UDF/blob support<commit_after>from setuptools import setup ### Add find_packages function, see # https://wiki.python.org/moin/Distutils/Cookbook/AutoPackageDiscovery import os def is_package(path): return ( os.path.isdir(path) and os.path.isfile(os.path.join(path, '__init__.py')) ) def find_packages(path=".", base="", exclude=None): """Find all packages in path""" if not exclude: exclude = [] packages = {} for item in os.listdir(path): dir = os.path.join(path, item) if is_package(dir) and dir not in exclude: if base: module_name = "{base}.{item}".format(base=base,item=item) else: module_name = item packages[module_name] = dir packages.update(find_packages(dir, module_name)) return packages ### setup(name='raco', version='1.3.0', description='Relational Algebra COmpiler', author='Bill Howe, Andrew Whitaker, Daniel Halperin', author_email='raco@cs.washington.edu', url='https://github.com/uwescience/raco', packages=find_packages(exclude=['clang']), package_data={'': ['c_templates/*.template','grappa_templates/*.template']}, install_requires=['networkx', 'ply', 'pyparsing', 'SQLAlchemy', 'jinja2', 'requests', 'requests_toolbelt' ], scripts=['scripts/myrial'] )
eefc359576b75fadd0293e46c45227f2e1cad4a9
setup.py
setup.py
from setuptools import setup, find_packages setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, )
from setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, )
Add README to python package metadata
Add README to python package metadata
Python
mit
Braedon/prometheus-es-exporter
from setuptools import setup, find_packages setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, ) Add README to python package metadata
from setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, )
<commit_before>from setuptools import setup, find_packages setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, ) <commit_msg>Add README to python package metadata<commit_after>
from setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, )
from setuptools import setup, find_packages setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, ) Add README to python package metadatafrom setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, )
<commit_before>from setuptools import setup, find_packages setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, ) <commit_msg>Add README to python package metadata<commit_after>from setuptools import setup, find_packages from os import path this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f: long_description = f.read() setup( name='prometheus-es-exporter', version='0.9.0.dev1', description='Elasticsearch query Prometheus exporter', long_description=long_description, long_description_content_type='text/markdown', url='https://github.com/braedon/prometheus-es-exporter', author='Braedon Vickers', author_email='braedon.vickers@gmail.com', license='MIT', classifiers=[ 'Development Status :: 4 - Beta', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'Topic :: System :: Monitoring', 'License :: OSI Approved :: MIT License', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='monitoring prometheus exporter elasticsearch', packages=find_packages(exclude=['tests']), python_requires='>=3.5', install_requires=[ 'click', 'click-config-file', 'elasticsearch', 'jog', 'prometheus-client >= 0.6.0', ], entry_points={ 'console_scripts': [ 'prometheus-es-exporter=prometheus_es_exporter:main', ], }, )
7f817802445bcfea9730f29a82c87f4883fda71e
apps/package/templatetags/package_tags.py
apps/package/templatetags/package_tags.py
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = [x.commit_date for x in Commit.objects.filter(package=package)] for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = [str(x) for x in weeks] return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False }
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = Commit.objects.filter(package=package).values_list('commit_date', flat=True) for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = map(str, weeks) return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False }
Update the commit_over_52 template tag to be more efficient.
Update the commit_over_52 template tag to be more efficient. Replaced several list comprehensions with in-database operations and map calls for significantly improved performance.
Python
mit
miketheman/opencomparison,miketheman/opencomparison,benracine/opencomparison,audreyr/opencomparison,nanuxbe/djangopackages,cartwheelweb/packaginator,pydanny/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,cartwheelweb/packaginator,pydanny/djangopackages,QLGu/djangopackages,audreyr/opencomparison,nanuxbe/djangopackages,pydanny/djangopackages,QLGu/djangopackages,cartwheelweb/packaginator,benracine/opencomparison
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = [x.commit_date for x in Commit.objects.filter(package=package)] for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = [str(x) for x in weeks] return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False } Update the commit_over_52 template tag to be more efficient. Replaced several list comprehensions with in-database operations and map calls for significantly improved performance.
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = Commit.objects.filter(package=package).values_list('commit_date', flat=True) for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = map(str, weeks) return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False }
<commit_before>from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = [x.commit_date for x in Commit.objects.filter(package=package)] for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = [str(x) for x in weeks] return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False } <commit_msg>Update the commit_over_52 template tag to be more efficient. Replaced several list comprehensions with in-database operations and map calls for significantly improved performance.<commit_after>
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = Commit.objects.filter(package=package).values_list('commit_date', flat=True) for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = map(str, weeks) return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False }
from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = [x.commit_date for x in Commit.objects.filter(package=package)] for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = [str(x) for x in weeks] return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False } Update the commit_over_52 template tag to be more efficient. Replaced several list comprehensions with in-database operations and map calls for significantly improved performance.from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = Commit.objects.filter(package=package).values_list('commit_date', flat=True) for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = map(str, weeks) return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False }
<commit_before>from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = [x.commit_date for x in Commit.objects.filter(package=package)] for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = [str(x) for x in weeks] return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False } <commit_msg>Update the commit_over_52 template tag to be more efficient. Replaced several list comprehensions with in-database operations and map calls for significantly improved performance.<commit_after>from datetime import timedelta from datetime import datetime from django import template from github2.client import Github from package.models import Package, Commit register = template.Library() github = Github() @register.filter def commits_over_52(package): current = datetime.now() weeks = [] commits = Commit.objects.filter(package=package).values_list('commit_date', flat=True) for week in range(52): weeks.append(len([x for x in commits if x < current and x > (current - timedelta(7))])) current -= timedelta(7) weeks.reverse() weeks = map(str, weeks) return ','.join(weeks) @register.inclusion_tag('package/templatetags/usage.html') def usage(user, package): using = package.usage.filter(username=user) or False count = 0 if using: count = package.usage.count() - 1 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": True } @register.inclusion_tag('package/templatetags/usage.html') def usage_no_count(user, package): using = package.usage.filter(username=user) or False count = 0 return { "using": using, "count": count, "package_id": package.id, "user_id": user.id, "show_count": False }
dbe7bfdba6392cb2cc5c8d0e710682c2cb9c2bc5
cellom2tif/filetypes.py
cellom2tif/filetypes.py
def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn.endswith('.C01') or fn.endswith('.c01') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask
import os def fn_has_ext(fn, ext, case_sensitive=False): """ Determine whether a file has a particular extension. Parameters ---------- fn : string The filename of the query file. ext : string The extension being checked. case_sensitive : bool Whether or not to treat the extension as case sensitive. Returns ------- file_has_ext : bool True if the filename has the specified extension. """ fn_ext = os.path.splitext(fn)[1][1:] if case_sensitive: file_has_ext = fn_ext == ext else: file_has_ext = fn_ext.lower() == ext.lower() return file_has_ext def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn_has_ext(fn, 'C01') or fn_has_ext(fn, 'DIB') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask
Add DIB files to cellomics file filter
Add DIB files to cellomics file filter
Python
bsd-3-clause
jni/cellom2tif
def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn.endswith('.C01') or fn.endswith('.c01') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask Add DIB files to cellomics file filter
import os def fn_has_ext(fn, ext, case_sensitive=False): """ Determine whether a file has a particular extension. Parameters ---------- fn : string The filename of the query file. ext : string The extension being checked. case_sensitive : bool Whether or not to treat the extension as case sensitive. Returns ------- file_has_ext : bool True if the filename has the specified extension. """ fn_ext = os.path.splitext(fn)[1][1:] if case_sensitive: file_has_ext = fn_ext == ext else: file_has_ext = fn_ext.lower() == ext.lower() return file_has_ext def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn_has_ext(fn, 'C01') or fn_has_ext(fn, 'DIB') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask
<commit_before>def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn.endswith('.C01') or fn.endswith('.c01') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask <commit_msg>Add DIB files to cellomics file filter<commit_after>
import os def fn_has_ext(fn, ext, case_sensitive=False): """ Determine whether a file has a particular extension. Parameters ---------- fn : string The filename of the query file. ext : string The extension being checked. case_sensitive : bool Whether or not to treat the extension as case sensitive. Returns ------- file_has_ext : bool True if the filename has the specified extension. """ fn_ext = os.path.splitext(fn)[1][1:] if case_sensitive: file_has_ext = fn_ext == ext else: file_has_ext = fn_ext.lower() == ext.lower() return file_has_ext def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn_has_ext(fn, 'C01') or fn_has_ext(fn, 'DIB') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask
def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn.endswith('.C01') or fn.endswith('.c01') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask Add DIB files to cellomics file filterimport os def fn_has_ext(fn, ext, case_sensitive=False): """ Determine whether a file has a particular extension. Parameters ---------- fn : string The filename of the query file. ext : string The extension being checked. case_sensitive : bool Whether or not to treat the extension as case sensitive. Returns ------- file_has_ext : bool True if the filename has the specified extension. """ fn_ext = os.path.splitext(fn)[1][1:] if case_sensitive: file_has_ext = fn_ext == ext else: file_has_ext = fn_ext.lower() == ext.lower() return file_has_ext def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn_has_ext(fn, 'C01') or fn_has_ext(fn, 'DIB') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask
<commit_before>def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn.endswith('.C01') or fn.endswith('.c01') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask <commit_msg>Add DIB files to cellomics file filter<commit_after>import os def fn_has_ext(fn, ext, case_sensitive=False): """ Determine whether a file has a particular extension. Parameters ---------- fn : string The filename of the query file. ext : string The extension being checked. case_sensitive : bool Whether or not to treat the extension as case sensitive. Returns ------- file_has_ext : bool True if the filename has the specified extension. """ fn_ext = os.path.splitext(fn)[1][1:] if case_sensitive: file_has_ext = fn_ext == ext else: file_has_ext = fn_ext.lower() == ext.lower() return file_has_ext def is_cellomics_image(fn): """Determine whether a file is a Cellomics image. Parameters ---------- fn : string The filename of the file in question. Returns ------- is_cellom : bool True if the filename points to a Cellomics image. """ is_cellom = fn_has_ext(fn, 'C01') or fn_has_ext(fn, 'DIB') return is_cellom def is_cellomics_mask(fn): """Determine whether a file is a Cellomics mask image. Parameters ---------- fn : string The filename. Returns ------- is_mask : bool True if the filename points to a Cellomics mask image. """ is_mask = fn.endswith('o1.C01') or fn.endswith('o1.c01') return is_mask
3c93a0ee9fa2ed615fd2ee1fd0100c1d4d971306
client/python/setup.py
client/python/setup.py
from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.2', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], )
from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.3.10', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], )
Update python client version number.
Update python client version number.
Python
mit
unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv,unrealcv/unrealcv
from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.2', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], ) Update python client version number.
from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.3.10', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], )
<commit_before>from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.2', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], ) <commit_msg>Update python client version number.<commit_after>
from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.3.10', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], )
from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.2', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], ) Update python client version number.from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.3.10', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], )
<commit_before>from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.2', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], ) <commit_msg>Update python client version number.<commit_after>from distutils.core import setup setup( name = 'UnrealCV', packages = ['unrealcv'], version = '0.3.10', description = 'UnrealCV client for python. see http://unrealcv.github.io for more detail.', author = 'Weichao Qiu', author_email = 'qiuwch@gmail.com', url = 'http://unrealcv.github.io', download_url = 'http://unrealcv.github.io', keywords = ['computer vision', 'unreal engine', 'ue4', 'synthetic', 'simulator', 'robotics'], classifiers = [], )
7c4476fe79da06be5aa89f9a6580c36d11411384
setup.py
setup.py
from setuptools import setup setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.2", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description="Simple Slack Bot makes writing your next Slack bot incredibly easy. By factoring out common functionality all Slack Bots require, you can focus on writing your business logic by simply registering for Slack Events defined by the Slack API", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], )
from setuptools import setup from os import path # read the contents of your README file this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.3", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description=long_description, long_description_content_type="text/markdown", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], )
Modify pypi description to use README.md
Modify pypi description to use README.md
Python
mit
GregHilston/Simple-Slack-Bot
from setuptools import setup setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.2", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description="Simple Slack Bot makes writing your next Slack bot incredibly easy. By factoring out common functionality all Slack Bots require, you can focus on writing your business logic by simply registering for Slack Events defined by the Slack API", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], ) Modify pypi description to use README.md
from setuptools import setup from os import path # read the contents of your README file this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.3", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description=long_description, long_description_content_type="text/markdown", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], )
<commit_before>from setuptools import setup setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.2", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description="Simple Slack Bot makes writing your next Slack bot incredibly easy. By factoring out common functionality all Slack Bots require, you can focus on writing your business logic by simply registering for Slack Events defined by the Slack API", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], ) <commit_msg>Modify pypi description to use README.md<commit_after>
from setuptools import setup from os import path # read the contents of your README file this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.3", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description=long_description, long_description_content_type="text/markdown", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], )
from setuptools import setup setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.2", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description="Simple Slack Bot makes writing your next Slack bot incredibly easy. By factoring out common functionality all Slack Bots require, you can focus on writing your business logic by simply registering for Slack Events defined by the Slack API", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], ) Modify pypi description to use README.mdfrom setuptools import setup from os import path # read the contents of your README file this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.3", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description=long_description, long_description_content_type="text/markdown", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], )
<commit_before>from setuptools import setup setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.2", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description="Simple Slack Bot makes writing your next Slack bot incredibly easy. By factoring out common functionality all Slack Bots require, you can focus on writing your business logic by simply registering for Slack Events defined by the Slack API", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], ) <commit_msg>Modify pypi description to use README.md<commit_after>from setuptools import setup from os import path # read the contents of your README file this_directory = path.abspath(path.dirname(__file__)) with open(path.join(this_directory, "README.md"), encoding="utf-8") as f: long_description = f.read() setup( name="simple_slack_bot", packages=["simple_slack_bot"], # this must be the same as the name above version="1.3.3", description="Simple Slack Bot makes writing your next Slack bot incredibly easy", long_description=long_description, long_description_content_type="text/markdown", author="Greg Hilston", author_email="Gregory.Hilston@gmail.com", url="https://github.com/GregHilston/Simple-Slack-Bot", # use the URL to the github repo download_url="https://github.com/GregHilston/Simple-Slack-Bot/tarball/v1.1.0", keywords=["slack", "bot", "chat", "simple"], # arbitrary keywords classifiers=[], install_requires=[ "slacker==0.9.42", "slacksocket>=0.7,!=0.8,<=0.9", "pyyaml", "websocket-client==0.48", # required to define as our dependency has a dependency which broke backwards compatibility ], )
8ad0af715803fc263d33a1592b4cc20b16dd81c8
setup.py
setup.py
#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.5', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ])
#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.7', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ])
Update sorl-thumbnail requirement from <12.5,>=12.4.1 to >=12.4.1,<12.7
Update sorl-thumbnail requirement from <12.5,>=12.4.1 to >=12.4.1,<12.7 Updates the requirements on [sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail) to permit the latest version. - [Release notes](https://github.com/jazzband/sorl-thumbnail/releases) - [Changelog](https://github.com/jazzband/sorl-thumbnail/blob/master/CHANGES.rst) - [Commits](https://github.com/jazzband/sorl-thumbnail/compare/12.4.1...12.6.2) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
Python
bsd-3-clause
django-oscar/django-oscar-stores,django-oscar/django-oscar-stores,django-oscar/django-oscar-stores
#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.5', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ]) Update sorl-thumbnail requirement from <12.5,>=12.4.1 to >=12.4.1,<12.7 Updates the requirements on [sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail) to permit the latest version. - [Release notes](https://github.com/jazzband/sorl-thumbnail/releases) - [Changelog](https://github.com/jazzband/sorl-thumbnail/blob/master/CHANGES.rst) - [Commits](https://github.com/jazzband/sorl-thumbnail/compare/12.4.1...12.6.2) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>
#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.7', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ])
<commit_before>#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.5', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ]) <commit_msg>Update sorl-thumbnail requirement from <12.5,>=12.4.1 to >=12.4.1,<12.7 Updates the requirements on [sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail) to permit the latest version. - [Release notes](https://github.com/jazzband/sorl-thumbnail/releases) - [Changelog](https://github.com/jazzband/sorl-thumbnail/blob/master/CHANGES.rst) - [Commits](https://github.com/jazzband/sorl-thumbnail/compare/12.4.1...12.6.2) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com><commit_after>
#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.7', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ])
#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.5', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ]) Update sorl-thumbnail requirement from <12.5,>=12.4.1 to >=12.4.1,<12.7 Updates the requirements on [sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail) to permit the latest version. - [Release notes](https://github.com/jazzband/sorl-thumbnail/releases) - [Changelog](https://github.com/jazzband/sorl-thumbnail/blob/master/CHANGES.rst) - [Commits](https://github.com/jazzband/sorl-thumbnail/compare/12.4.1...12.6.2) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com>#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.7', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ])
<commit_before>#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.5', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ]) <commit_msg>Update sorl-thumbnail requirement from <12.5,>=12.4.1 to >=12.4.1,<12.7 Updates the requirements on [sorl-thumbnail](https://github.com/jazzband/sorl-thumbnail) to permit the latest version. - [Release notes](https://github.com/jazzband/sorl-thumbnail/releases) - [Changelog](https://github.com/jazzband/sorl-thumbnail/blob/master/CHANGES.rst) - [Commits](https://github.com/jazzband/sorl-thumbnail/compare/12.4.1...12.6.2) Signed-off-by: dependabot-preview[bot] <5bdcd3c0d4d24ae3e71b3b452a024c6324c7e4bb@dependabot.com><commit_after>#!/usr/bin/env python import os from setuptools import find_packages, setup setup( name='django-oscar-stores', version="2.0", url='https://github.com/django-oscar/django-oscar-stores', author="David Winterbottom", author_email="david.winterbottom@gmail.com", description="An extension for Oscar to include stores", long_description=open( os.path.join(os.path.dirname(__file__), 'README.rst')).read(), keywords="django, oscar, e-commerce", license='BSD', platforms=['linux'], packages=find_packages(exclude=["sandbox*", "tests*"]), include_package_data=True, install_requires=[ 'django-oscar>=2.0,<2.1', 'requests>=1.1', 'sorl-thumbnail>=12.4.1,<12.7', ], # See http://pypi.python.org/pypi?%3Aaction=list_classifiers classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Web Environment', 'Framework :: Django', 'Framework :: Django :: 1.11', 'Framework :: Django :: 2.2', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: Unix', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ])
936234e5de71267faec3b081e96d937098ff6d51
portfolio/tests/__init__.py
portfolio/tests/__init__.py
# from .admin import * from .models import *
# Must use absolute imports with ``*`` for Python 2.5. # from portfolio.tests.admin import * from portfolio.tests.models import *
Fix test broken in Python 2.5 by commit 414cdb8b274.
Fix test broken in Python 2.5 by commit 414cdb8b274.
Python
bsd-3-clause
benspaulding/django-portfolio,blturner/django-portfolio,blturner/django-portfolio
# from .admin import * from .models import * Fix test broken in Python 2.5 by commit 414cdb8b274.
# Must use absolute imports with ``*`` for Python 2.5. # from portfolio.tests.admin import * from portfolio.tests.models import *
<commit_before># from .admin import * from .models import * <commit_msg>Fix test broken in Python 2.5 by commit 414cdb8b274.<commit_after>
# Must use absolute imports with ``*`` for Python 2.5. # from portfolio.tests.admin import * from portfolio.tests.models import *
# from .admin import * from .models import * Fix test broken in Python 2.5 by commit 414cdb8b274.# Must use absolute imports with ``*`` for Python 2.5. # from portfolio.tests.admin import * from portfolio.tests.models import *
<commit_before># from .admin import * from .models import * <commit_msg>Fix test broken in Python 2.5 by commit 414cdb8b274.<commit_after># Must use absolute imports with ``*`` for Python 2.5. # from portfolio.tests.admin import * from portfolio.tests.models import *
7a85c0da0640c5dc669e1416e6ce76c58343f07a
normandy/recipes/storage.py
normandy/recipes/storage.py
import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], })
import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) # Remove obsolete locales. Locale.objects.exclude(code__in=languages.keys()).delete()
Remove obsolete locales during product_details sync.
Remove obsolete locales during product_details sync.
Python
mpl-2.0
mozilla/normandy,Osmose/normandy,Osmose/normandy,mozilla/normandy,mozilla/normandy,Osmose/normandy,mozilla/normandy,Osmose/normandy
import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) Remove obsolete locales during product_details sync.
import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) # Remove obsolete locales. Locale.objects.exclude(code__in=languages.keys()).delete()
<commit_before>import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) <commit_msg>Remove obsolete locales during product_details sync.<commit_after>
import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) # Remove obsolete locales. Locale.objects.exclude(code__in=languages.keys()).delete()
import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) Remove obsolete locales during product_details sync.import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) # Remove obsolete locales. Locale.objects.exclude(code__in=languages.keys()).delete()
<commit_before>import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) <commit_msg>Remove obsolete locales during product_details sync.<commit_after>import json from django.db import transaction from product_details.storage import PDDatabaseStorage class ProductDetailsRelationalStorage(PDDatabaseStorage): """ Extends the in-database storage for product_details to provide a database table of locales for other models to have foreign keys to. """ @transaction.atomic def update(self, name, content, last_modified): # Don't import models when module loads due to app startup. from normandy.recipes.models import Locale super().update(name, content, last_modified) # If we are updating firefox versions, update the table. if name == 'languages.json': languages = json.loads(content) for locale_code, names in languages.items(): Locale.objects.update_or_create(code=locale_code, defaults={ 'english_name': names['English'], 'native_name': names['native'], }) # Remove obsolete locales. Locale.objects.exclude(code__in=languages.keys()).delete()
3e6b1fcd1b88aa1bbfa7ba7a1dd5e95affa371fc
mustachejs/templatetags/mustachejs.py
mustachejs/templatetags/mustachejs.py
from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) fp = open(filepath, "r") output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") fp.close() output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1])
from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) with open(filepath, "r") as fp: output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1])
Use the 'with' keyword for managing template file pointers
Use the 'with' keyword for managing template file pointers
Python
bsd-3-clause
mjumbewu/django-jstemplate,bopo/django-jstemplate,mjumbewu/django-jstemplate,bopo/django-jstemplate,mjumbewu/django-jstemplate,bopo/django-jstemplate
from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) fp = open(filepath, "r") output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") fp.close() output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1]) Use the 'with' keyword for managing template file pointers
from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) with open(filepath, "r") as fp: output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1])
<commit_before>from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) fp = open(filepath, "r") output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") fp.close() output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1]) <commit_msg>Use the 'with' keyword for managing template file pointers<commit_after>
from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) with open(filepath, "r") as fp: output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1])
from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) fp = open(filepath, "r") output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") fp.close() output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1]) Use the 'with' keyword for managing template file pointersfrom django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) with open(filepath, "r") as fp: output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1])
<commit_before>from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) fp = open(filepath, "r") output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") fp.close() output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1]) <commit_msg>Use the 'with' keyword for managing template file pointers<commit_after>from django import template from ..conf import conf from ..loading import find, MustacheJSTemplateNotFound register = template.Library() class MustacheJSNode(template.Node): def __init__(self, name): self.name = template.Variable(name) def render(self, context): name = self.name.resolve(context) try: filepath = find(name) with open(filepath, "r") as fp: output = fp.read() output = output.replace('\\', r'\\') output = output.replace('\n', r'\n') output = output.replace("'", r"\'") output = ("<script>Mustache.TEMPLATES=Mustache.TEMPLATES||{};" + "Mustache.TEMPLATES['{0}']='".format(name) + output + "';</script>") except (IOError, MustacheJSTemplateNotFound): output = "" if conf.DEBUG: raise return output @register.tag def mustachejs(parser, token): """ Finds the MustacheJS template for the given name and renders it surrounded by the requisite MustacheJS <script> tags. """ bits = token.contents.split() if len(bits) not in [2, 3]: raise template.TemplateSyntaxError( "'mustachejs' tag takes one argument: the name/id of the template") return MustacheJSNode(bits[1])
ffae486e85ce1949c274dd0053e225994fccd7f1
users.py
users.py
import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return if user.google_user == users.get_current_user(): json = get_current_user_json() else: json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()
import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()
Use GET /me if you want the current user JSON
Use GET /me if you want the current user JSON
Python
mit
youtify/youtify,youtify/youtify,youtify/youtify
import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return if user.google_user == users.get_current_user(): json = get_current_user_json() else: json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main() Use GET /me if you want the current user JSON
import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()
<commit_before>import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return if user.google_user == users.get_current_user(): json = get_current_user_json() else: json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main() <commit_msg>Use GET /me if you want the current user JSON<commit_after>
import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()
import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return if user.google_user == users.get_current_user(): json = get_current_user_json() else: json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main() Use GET /me if you want the current user JSONimport logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()
<commit_before>import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return if user.google_user == users.get_current_user(): json = get_current_user_json() else: json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main() <commit_msg>Use GET /me if you want the current user JSON<commit_after>import logging from google.appengine.ext import webapp from google.appengine.ext.webapp import util from google.appengine.api import users from django.utils import simplejson from model import get_current_youtify_user from model import YoutifyUser from model import get_youtify_user_by_nick from model import get_current_user_json from model import get_youtify_user_json_for class UserHandler(webapp.RequestHandler): def get(self): """Get user as JSON""" user_id = self.request.path.split('/')[-1] if user_id is None or len(user_id) == 0: self.error(404) return user = None json = None if user_id.isdigit(): user = YoutifyUser.get_by_id(int(user_id)) else: user = get_youtify_user_by_nick(user_id) if user is None: self.error(404) return json = get_youtify_user_json_for(user) self.response.headers['Content-Type'] = 'application/json' self.response.out.write(json) def post(self): """Update user""" self.error(500) def main(): application = webapp.WSGIApplication([ ('/api/users/.*', UserHandler), ], debug=True) util.run_wsgi_app(application) if __name__ == '__main__': main()
6a63f9ff253e335a8721d8ee0ac5db4a066032ed
contrib/packs/actions/pack_mgmt/delete.py
contrib/packs/actions/pack_mgmt/delete.py
import os import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): shutil.rmtree(abs_fp) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric'])
import os import pipes import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) # TODO: Use config base path + virtualenv suffix VIRTUALENVS_PATH = '/opt/stackstorm/virtualenvs/' class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) # 1. Delete pack content for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): self.logger.debug('Deleting pack directory "%s"' % (abs_fp)) shutil.rmtree(abs_fp) # 2. Delete pack virtual environment for pack_name in packs: pack_name = pipes.quote(pack_name) virtualenv_path = os.path.join(VIRTUALENVS_PATH, pack_name) if os.path.isdir(virtualenv_path): self.logger.debug('Deleting virtualenv "%s" for pack "%s"' % (virtualenv_path, pack_name)) shutil.rmtree(virtualenv_path) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric'])
Update "packs.uninstall" to also remove pack-specific virtual environment (if exists).
Update "packs.uninstall" to also remove pack-specific virtual environment (if exists).
Python
apache-2.0
alfasin/st2,pixelrebel/st2,emedvedev/st2,dennybaa/st2,Plexxi/st2,tonybaloney/st2,emedvedev/st2,lakshmi-kannan/st2,grengojbo/st2,nzlosh/st2,pinterb/st2,jtopjian/st2,nzlosh/st2,Itxaka/st2,jtopjian/st2,StackStorm/st2,punalpatel/st2,Itxaka/st2,grengojbo/st2,Itxaka/st2,lakshmi-kannan/st2,alfasin/st2,punalpatel/st2,peak6/st2,grengojbo/st2,Plexxi/st2,pixelrebel/st2,nzlosh/st2,alfasin/st2,pinterb/st2,StackStorm/st2,emedvedev/st2,pixelrebel/st2,armab/st2,tonybaloney/st2,dennybaa/st2,tonybaloney/st2,StackStorm/st2,dennybaa/st2,punalpatel/st2,peak6/st2,nzlosh/st2,Plexxi/st2,pinterb/st2,StackStorm/st2,armab/st2,jtopjian/st2,lakshmi-kannan/st2,peak6/st2,armab/st2,Plexxi/st2
import os import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): shutil.rmtree(abs_fp) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric']) Update "packs.uninstall" to also remove pack-specific virtual environment (if exists).
import os import pipes import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) # TODO: Use config base path + virtualenv suffix VIRTUALENVS_PATH = '/opt/stackstorm/virtualenvs/' class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) # 1. Delete pack content for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): self.logger.debug('Deleting pack directory "%s"' % (abs_fp)) shutil.rmtree(abs_fp) # 2. Delete pack virtual environment for pack_name in packs: pack_name = pipes.quote(pack_name) virtualenv_path = os.path.join(VIRTUALENVS_PATH, pack_name) if os.path.isdir(virtualenv_path): self.logger.debug('Deleting virtualenv "%s" for pack "%s"' % (virtualenv_path, pack_name)) shutil.rmtree(virtualenv_path) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric'])
<commit_before>import os import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): shutil.rmtree(abs_fp) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric']) <commit_msg>Update "packs.uninstall" to also remove pack-specific virtual environment (if exists).<commit_after>
import os import pipes import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) # TODO: Use config base path + virtualenv suffix VIRTUALENVS_PATH = '/opt/stackstorm/virtualenvs/' class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) # 1. Delete pack content for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): self.logger.debug('Deleting pack directory "%s"' % (abs_fp)) shutil.rmtree(abs_fp) # 2. Delete pack virtual environment for pack_name in packs: pack_name = pipes.quote(pack_name) virtualenv_path = os.path.join(VIRTUALENVS_PATH, pack_name) if os.path.isdir(virtualenv_path): self.logger.debug('Deleting virtualenv "%s" for pack "%s"' % (virtualenv_path, pack_name)) shutil.rmtree(virtualenv_path) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric'])
import os import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): shutil.rmtree(abs_fp) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric']) Update "packs.uninstall" to also remove pack-specific virtual environment (if exists).import os import pipes import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) # TODO: Use config base path + virtualenv suffix VIRTUALENVS_PATH = '/opt/stackstorm/virtualenvs/' class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) # 1. Delete pack content for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): self.logger.debug('Deleting pack directory "%s"' % (abs_fp)) shutil.rmtree(abs_fp) # 2. Delete pack virtual environment for pack_name in packs: pack_name = pipes.quote(pack_name) virtualenv_path = os.path.join(VIRTUALENVS_PATH, pack_name) if os.path.isdir(virtualenv_path): self.logger.debug('Deleting virtualenv "%s" for pack "%s"' % (virtualenv_path, pack_name)) shutil.rmtree(virtualenv_path) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric'])
<commit_before>import os import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): shutil.rmtree(abs_fp) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric']) <commit_msg>Update "packs.uninstall" to also remove pack-specific virtual environment (if exists).<commit_after>import os import pipes import shutil from st2actions.runners.pythonrunner import Action BLOCKED_PACKS = frozenset(['core']) # TODO: Use config base path + virtualenv suffix VIRTUALENVS_PATH = '/opt/stackstorm/virtualenvs/' class UninstallPackAction(Action): def run(self, abs_repo_base=None, packs=None): intersection = BLOCKED_PACKS & frozenset(packs) if len(intersection) > 0: raise Exception('Uninstall includes an uninstallable pack - %s.' % list(intersection)) # 1. Delete pack content for fp in os.listdir(abs_repo_base): abs_fp = os.path.join(abs_repo_base, fp) if fp in packs and os.path.isdir(abs_fp): self.logger.debug('Deleting pack directory "%s"' % (abs_fp)) shutil.rmtree(abs_fp) # 2. Delete pack virtual environment for pack_name in packs: pack_name = pipes.quote(pack_name) virtualenv_path = os.path.join(VIRTUALENVS_PATH, pack_name) if os.path.isdir(virtualenv_path): self.logger.debug('Deleting virtualenv "%s" for pack "%s"' % (virtualenv_path, pack_name)) shutil.rmtree(virtualenv_path) if __name__ == '__main__': action = UninstallPackAction() action.run('/home/manas/repo_base', ['fabric'])
60a44ce1fe2fda130ec1cf416accfffa270fcd2e
mycli/packages/special/utils.py
mycli/packages/special/utils.py
import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) output = subprocess.check_output('pwd', stderr=subprocess.STDOUT, shell=True) except OSError as e: return False, e.strerror
import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) subprocess.call(['pwd']) return True, None except OSError as e: return False, e.strerror
Stop using 'check_output' method and start using 'call' method in handler_cd_command
Stop using 'check_output' method and start using 'call' method in handler_cd_command
Python
bsd-3-clause
mdsrosa/mycli,mdsrosa/mycli
import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) output = subprocess.check_output('pwd', stderr=subprocess.STDOUT, shell=True) except OSError as e: return False, e.strerror Stop using 'check_output' method and start using 'call' method in handler_cd_command
import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) subprocess.call(['pwd']) return True, None except OSError as e: return False, e.strerror
<commit_before>import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) output = subprocess.check_output('pwd', stderr=subprocess.STDOUT, shell=True) except OSError as e: return False, e.strerror <commit_msg>Stop using 'check_output' method and start using 'call' method in handler_cd_command<commit_after>
import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) subprocess.call(['pwd']) return True, None except OSError as e: return False, e.strerror
import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) output = subprocess.check_output('pwd', stderr=subprocess.STDOUT, shell=True) except OSError as e: return False, e.strerror Stop using 'check_output' method and start using 'call' method in handler_cd_commandimport os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) subprocess.call(['pwd']) return True, None except OSError as e: return False, e.strerror
<commit_before>import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) output = subprocess.check_output('pwd', stderr=subprocess.STDOUT, shell=True) except OSError as e: return False, e.strerror <commit_msg>Stop using 'check_output' method and start using 'call' method in handler_cd_command<commit_after>import os import subprocess def handle_cd_command(arg): """Handles a `cd` shell command by calling python's os.chdir.""" CD_CMD = 'cd' directory = '' error = False tokens = arg.split(CD_CMD + ' ') directory = tokens[-1] try: os.chdir(directory) subprocess.call(['pwd']) return True, None except OSError as e: return False, e.strerror
34ac848cc19477f032a78a4ccbc782d2694d1969
bluebottle/votes/models.py
bluebottle/votes/models.py
from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), )
from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) ordering = ('-created', )
Sort votes by created desc
Sort votes by created desc BB-4430 #resolve
Python
bsd-3-clause
onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,jfterpstra/bluebottle,onepercentclub/bluebottle
from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) Sort votes by created desc BB-4430 #resolve
from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) ordering = ('-created', )
<commit_before>from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) <commit_msg>Sort votes by created desc BB-4430 #resolve<commit_after>
from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) ordering = ('-created', )
from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) Sort votes by created desc BB-4430 #resolvefrom django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) ordering = ('-created', )
<commit_before>from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) <commit_msg>Sort votes by created desc BB-4430 #resolve<commit_after>from django.db import models from django.conf import settings from django.utils.translation import ugettext as _ from django_extensions.db.fields import CreationDateTimeField class Vote(models.Model): """ Mixin for generating an invoice reference. """ created = CreationDateTimeField(_('created')) project = models.ForeignKey(settings.PROJECTS_PROJECT_MODEL) voter = models.ForeignKey(settings.AUTH_USER_MODEL, verbose_name=_('voter'), blank=True, null=True) def __unicode__(self): return "{0} -> {1}".format(self.voter, self.project) class Meta: unique_together = (('project', 'voter'), ) ordering = ('-created', )
3f11a637f02b97bc9faaf18d26b6a6910f2302ca
Instanssi/admin_programme/forms.py
Instanssi/admin_programme/forms.py
# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',)
# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', 'gplus_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',)
Add google+ icon to admin form.
admin_programme: Add google+ icon to admin form.
Python
mit
Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org,Instanssi/Instanssi.org
# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',) admin_programme: Add google+ icon to admin form.
# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', 'gplus_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',)
<commit_before># -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',) <commit_msg>admin_programme: Add google+ icon to admin form.<commit_after>
# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', 'gplus_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',)
# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',) admin_programme: Add google+ icon to admin form.# -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', 'gplus_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',)
<commit_before># -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',) <commit_msg>admin_programme: Add google+ icon to admin form.<commit_after># -*- coding: utf-8 -*- from django import forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Submit, Layout, Fieldset, ButtonHolder from Instanssi.ext_programme.models import ProgrammeEvent class ProgrammeEventForm(forms.ModelForm): def __init__(self, *args, **kwargs): super(ProgrammeEventForm, self).__init__(*args, **kwargs) self.helper = FormHelper() self.helper.layout = Layout( Fieldset( u'Tapahtuma', 'event_type', 'title', 'description', 'start', 'end', 'presenters', 'presenters_titles', 'icon_original', 'email', 'home_url', 'twitter_url', 'github_url', 'facebook_url', 'linkedin_url', 'wiki_url', 'gplus_url', ButtonHolder ( Submit('submit', u'Tallenna') ) ) ) class Meta: model = ProgrammeEvent exclude = ('event','icon_small',)
9dd4da3d62312c5184150a967f7e4a3935c7b94e
moksha/tests/test_clientsockets.py
moksha/tests/test_clientsockets.py
import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_middleware_wrap(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets]))
import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_has_socket_str(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets]))
Rename test. Fix copy/pasta forgetfulness.
Rename test. Fix copy/pasta forgetfulness.
Python
apache-2.0
pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,pombredanne/moksha,pombredanne/moksha,mokshaproject/moksha,mokshaproject/moksha,pombredanne/moksha
import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_middleware_wrap(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets])) Rename test. Fix copy/pasta forgetfulness.
import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_has_socket_str(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets]))
<commit_before>import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_middleware_wrap(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets])) <commit_msg>Rename test. Fix copy/pasta forgetfulness.<commit_after>
import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_has_socket_str(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets]))
import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_middleware_wrap(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets])) Rename test. Fix copy/pasta forgetfulness.import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_has_socket_str(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets]))
<commit_before>import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_middleware_wrap(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets])) <commit_msg>Rename test. Fix copy/pasta forgetfulness.<commit_after>import webtest import moksha.tests.utils as testutils from moksha.api.widgets.live import get_moksha_socket from moksha.middleware import make_moksha_middleware from tw2.core import make_middleware as make_tw2_middleware class TestClientSocketDumb: def _setUp(self): def kernel(config): def app(environ, start_response): start_response('200 OK', [('Content-Type', 'text/html')]) socket = get_moksha_socket(config) return map(str, [socket.display()]) app = make_moksha_middleware(app, config) app = make_tw2_middleware(app, config) app = webtest.TestApp(app) self.app = app for _setup, name in testutils.make_setup_functions(kernel): yield _setup, name def _tearDown(self): pass @testutils.crosstest def test_has_socket_str(self): targets = ['moksha_websocket', 'TCPSocket'] response = self.app.get('/') assert(any([target in response for target in targets]))
43a2cb58df9dc3e4e91370d9b10c62c0d05b8798
papermill/tests/test_cli.py
papermill/tests/test_cli.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), (10, 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), (10, True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), ("12.51", 12.51), (10, 10), ("10", 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), ("-23.2", False), (10, True), ("13", True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected
Add test to include strings to numbers
Add test to include strings to numbers
Python
bsd-3-clause
nteract/papermill,nteract/papermill
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), (10, 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), (10, True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected Add test to include strings to numbers
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), ("12.51", 12.51), (10, 10), ("10", 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), ("-23.2", False), (10, True), ("13", True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), (10, 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), (10, True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected <commit_msg>Add test to include strings to numbers<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), ("12.51", 12.51), (10, 10), ("10", 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), ("-23.2", False), (10, True), ("13", True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), (10, 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), (10, True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected Add test to include strings to numbers#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), ("12.51", 12.51), (10, 10), ("10", 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), ("-23.2", False), (10, True), ("13", True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), (10, 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), (10, True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected <commit_msg>Add test to include strings to numbers<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- """ Test the command line interface """ import pytest from ..cli import _is_int, _is_float, _resolve_type @pytest.mark.parametrize("test_input,expected", [ ("True", True), ("False", False), ("None", None), (13.3, 13.3), ("12.51", 12.51), (10, 10), ("10", 10), ("hello world", "hello world"), (u"😍", u"😍"), ]) def test_resolve_type(test_input, expected): assert _resolve_type(test_input) == expected @pytest.mark.parametrize("value,expected", [ (13.71, True), ("False", False), ("None", False), (-8.2, True), (10, False), ("hello world", False), ("😍", False), ]) def test_is_float(value, expected): assert (_is_float(value)) == expected @pytest.mark.parametrize("value,expected", [ (13.71, False), ("False", False), ("None", False), (-8.2, False), ("-23.2", False), (10, True), ("13", True), ("hello world", False), ("😍", False), ]) def test_is_int(value, expected): assert (_is_int(value)) == expected
7a6fc91b8eafe0cc88d892443ad25b24a94a3ace
cross_service_tempest_plugin/tests/scenario/test_cross_service.py
cross_service_tempest_plugin/tests/scenario/test_cross_service.py
# Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'dns', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'orchestration', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass
# Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'designate', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'heat_plugin', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass
Fix the skip to match plugins
Fix the skip to match plugins
Python
apache-2.0
afrittoli/cross_service_tempest_plugins,afrittoli/cross_service_tempest_plugins
# Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'dns', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'orchestration', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass Fix the skip to match plugins
# Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'designate', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'heat_plugin', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass
<commit_before># Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'dns', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'orchestration', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass <commit_msg>Fix the skip to match plugins<commit_after>
# Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'designate', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'heat_plugin', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass
# Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'dns', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'orchestration', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass Fix the skip to match plugins# Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'designate', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'heat_plugin', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass
<commit_before># Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'dns', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'orchestration', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass <commit_msg>Fix the skip to match plugins<commit_after># Copyright 2017 Andrea Frittoli # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from tempest import config from tempest import test CONF = config.CONF class HeatDriverNeutronDNSIntegration(test.BaseTestCase): @classmethod def skip_checks(cls): super(HeatDriverNeutronDNSIntegration, cls).skip_checks() if not getattr(CONF.service_available, 'designate', False): raise cls.skipException('Designate support is required') if not getattr(CONF.service_available, 'heat_plugin', False): raise cls.skipException('Heat support is required') def test_port_on_extenal_net_to_dns(self): pass def test_floating_ip_with_name_from_port_to_dns(self): pass def test_floating_ip_with_own_name_to_dns(self): pass
dd19012ed8bb6ec702d84abe400bc3dec47044f3
sortedm2m_tests/__init__.py
sortedm2m_tests/__init__.py
# Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages
# Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def __init__(self, *args, **kwargs): os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' from south.management.commands import patch_for_test_db_setup patch_for_test_db_setup() super(TestSuite, self).__init__(*args, **kwargs) def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages
Fix to allow tests with South migrations to run.
Fix to allow tests with South migrations to run.
Python
bsd-3-clause
gregmuellegger/django-sortedm2m,fabrique/django-sortedm2m,gradel/django-sortedm2m,MathieuDuponchelle/django-sortedm2m,fabrique/django-sortedm2m,gradel/django-sortedm2m,fabrique/django-sortedm2m,gradel/django-sortedm2m,gregmuellegger/django-sortedm2m,MathieuDuponchelle/django-sortedm2m,gregmuellegger/django-sortedm2m
# Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages Fix to allow tests with South migrations to run.
# Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def __init__(self, *args, **kwargs): os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' from south.management.commands import patch_for_test_db_setup patch_for_test_db_setup() super(TestSuite, self).__init__(*args, **kwargs) def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages
<commit_before># Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages <commit_msg>Fix to allow tests with South migrations to run.<commit_after>
# Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def __init__(self, *args, **kwargs): os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' from south.management.commands import patch_for_test_db_setup patch_for_test_db_setup() super(TestSuite, self).__init__(*args, **kwargs) def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages
# Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages Fix to allow tests with South migrations to run.# Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def __init__(self, *args, **kwargs): os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' from south.management.commands import patch_for_test_db_setup patch_for_test_db_setup() super(TestSuite, self).__init__(*args, **kwargs) def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages
<commit_before># Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages <commit_msg>Fix to allow tests with South migrations to run.<commit_after># Python import os # django-setuptest import setuptest TEST_APPS = ['sortedm2m_tests', 'sortedm2m_field', 'sortedm2m_form', 'south_support'] class TestSuite(setuptest.SetupTestSuite): def __init__(self, *args, **kwargs): os.environ['DJANGO_SETTINGS_MODULE'] = 'test_settings' from south.management.commands import patch_for_test_db_setup patch_for_test_db_setup() super(TestSuite, self).__init__(*args, **kwargs) def resolve_packages(self): packages = super(TestSuite, self).resolve_packages() for test_app in TEST_APPS: if test_app not in packages: packages.append(test_app) return packages
cc9cb88573fd5dc3825b253ac7ef44aec05d0aa9
app/soc/modules/gci/views/helper/url_patterns.py
app/soc/modules/gci/views/helper/url_patterns.py
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program', 'task'])
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program'])
Fix GCI Task URL Pattern.
Fix GCI Task URL Pattern.
Python
apache-2.0
rhyolight/nupic.son,rhyolight/nupic.son,rhyolight/nupic.son
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program', 'task']) Fix GCI Task URL Pattern.
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program'])
<commit_before>#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program', 'task']) <commit_msg>Fix GCI Task URL Pattern.<commit_after>
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program'])
#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program', 'task']) Fix GCI Task URL Pattern.#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program'])
<commit_before>#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program', 'task']) <commit_msg>Fix GCI Task URL Pattern.<commit_after>#!/usr/bin/env python2.5 # # Copyright 2011 the Melange authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Module for constructing GCI related URL patterns """ __authors__ = [ '"Lennard de Rijk" <ljvderijk@gmail.com>', '"Selwyn Jacob" <selwynjacob90@gmail.com>', ] from django.conf.urls.defaults import url as django_url from soc.views.helper import url_patterns def url(regex, view, kwargs=None, name=None): """Constructs an url pattern prefixed with ^gci/. Args: see django.conf.urls.defaults.url """ return django_url('^gci/%s' % regex, view, kwargs=kwargs, name=name) TASK = url_patterns.namedIdBasedPattern(['sponsor', 'program'])
44c609cb0cba6e1837a5605f3dd09f7a059d2f14
Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Synth.py
Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Synth.py
import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = Polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1
import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 polyphoniser = Polyphoniser def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = self.polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1
Add option to change the polyphony component in the synth to allow different behaviours.
Add option to change the polyphony component in the synth to allow different behaviours.
Python
apache-2.0
sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia
import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = Polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1 Add option to change the polyphony component in the synth to allow different behaviours.
import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 polyphoniser = Polyphoniser def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = self.polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1
<commit_before>import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = Polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1 <commit_msg>Add option to change the polyphony component in the synth to allow different behaviours.<commit_after>
import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 polyphoniser = Polyphoniser def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = self.polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1
import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = Polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1 Add option to change the polyphony component in the synth to allow different behaviours.import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 polyphoniser = Polyphoniser def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = self.polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1
<commit_before>import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = Polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1 <commit_msg>Add option to change the polyphony component in the synth to allow different behaviours.<commit_after>import Axon from Kamaelia.Apps.Jam.Audio.Polyphony import Polyphoniser from Kamaelia.Apps.Jam.Audio.Mixer import MonoMixer class Synth(Axon.Component.component): polyphony = 8 polyphoniser = Polyphoniser def __init__(self, voiceGenerator, **argd): super(Synth, self).__init__(**argd) polyphoniser = self.polyphoniser(polyphony=self.polyphony).activate() mixer = MonoMixer(channels=self.polyphony).activate() self.link((self, "inbox"), (polyphoniser, "inbox"), passthrough=1) self.link((mixer, "outbox"), (self, "outbox"), passthrough=2) for index, voice in enumerate(voiceGenerator()): voice = voice.activate() self.link((polyphoniser, "voice%i" % index), (voice, "inbox")) self.link((voice, "outbox"), (mixer, "in%i" % index)) def main(self): while 1: if not self.anyReady(): self.pause() yield 1
82ed11aacc68c064b1f6c618dde12ea94c7592a5
migrations/versions/070_fix_folder_easfoldersyncstatus_unique_constraints.py
migrations/versions/070_fix_folder_easfoldersyncstatus_unique_constraints.py
"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_ibfk_1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_ibfk_1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.')
"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_fk1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_fk1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.')
Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours.
Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours.
Python
agpl-3.0
wakermahmud/sync-engine,closeio/nylas,Eagles2F/sync-engine,wakermahmud/sync-engine,EthanBlackburn/sync-engine,wakermahmud/sync-engine,ErinCall/sync-engine,EthanBlackburn/sync-engine,closeio/nylas,PriviPK/privipk-sync-engine,PriviPK/privipk-sync-engine,gale320/sync-engine,nylas/sync-engine,closeio/nylas,ErinCall/sync-engine,wakermahmud/sync-engine,nylas/sync-engine,ErinCall/sync-engine,Eagles2F/sync-engine,EthanBlackburn/sync-engine,jobscore/sync-engine,gale320/sync-engine,closeio/nylas,wakermahmud/sync-engine,nylas/sync-engine,Eagles2F/sync-engine,PriviPK/privipk-sync-engine,jobscore/sync-engine,ErinCall/sync-engine,EthanBlackburn/sync-engine,PriviPK/privipk-sync-engine,Eagles2F/sync-engine,jobscore/sync-engine,jobscore/sync-engine,PriviPK/privipk-sync-engine,EthanBlackburn/sync-engine,gale320/sync-engine,Eagles2F/sync-engine,ErinCall/sync-engine,gale320/sync-engine,gale320/sync-engine,nylas/sync-engine
"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_ibfk_1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_ibfk_1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.') Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours.
"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_fk1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_fk1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.')
<commit_before>"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_ibfk_1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_ibfk_1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.') <commit_msg>Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours.<commit_after>
"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_fk1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_fk1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.')
"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_ibfk_1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_ibfk_1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.') Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours."""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_fk1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_fk1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.')
<commit_before>"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_ibfk_1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_ibfk_1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.') <commit_msg>Rename FK in migration 70 - For some reason, Gunks' db has it named differently than ours.<commit_after>"""Fix Folder, EASFolderSyncStatus unique constraints Revision ID: 2525c5245cc2 Revises: 479b3b84a73e Create Date: 2014-07-28 18:57:24.476123 """ # revision identifiers, used by Alembic. revision = '2525c5245cc2' down_revision = '479b3b84a73e' from alembic import op import sqlalchemy as sa from inbox.ignition import main_engine engine = main_engine() Base = sa.ext.declarative.declarative_base() Base.metadata.reflect(engine) def upgrade(): op.drop_constraint('folder_fk1', 'folder', type_='foreignkey') op.drop_constraint('account_id', 'folder', type_='unique') op.create_foreign_key('folder_fk1', 'folder', 'account', ['account_id'], ['id']) op.create_unique_constraint('account_id', 'folder', ['account_id', 'name', 'canonical_name']) if 'easfoldersyncstatus' in Base.metadata.tables: op.create_unique_constraint('account_id_2', 'easfoldersyncstatus', ['account_id', 'eas_folder_id']) def downgrade(): raise Exception('Unsupported, going back will break things.')
94fd112502da71e8c6c0c5989d124d12516907b7
opps/contrib/multisite/__init__.py
opps/contrib/multisite/__init__.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from appconf import AppConf trans_app_label = _('Multisite') class OppsMultiSiteConf(AppConf): ADMIN = False class Meta: prefix = 'opps_multisite'
Set default value on settings var OPPS_MULTISITE_ADMIN
Set default value on settings var OPPS_MULTISITE_ADMIN
Python
mit
YACOWS/opps,opps/opps,jeanmask/opps,opps/opps,jeanmask/opps,williamroot/opps,williamroot/opps,opps/opps,opps/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,williamroot/opps
Set default value on settings var OPPS_MULTISITE_ADMIN
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from appconf import AppConf trans_app_label = _('Multisite') class OppsMultiSiteConf(AppConf): ADMIN = False class Meta: prefix = 'opps_multisite'
<commit_before><commit_msg>Set default value on settings var OPPS_MULTISITE_ADMIN<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from appconf import AppConf trans_app_label = _('Multisite') class OppsMultiSiteConf(AppConf): ADMIN = False class Meta: prefix = 'opps_multisite'
Set default value on settings var OPPS_MULTISITE_ADMIN#!/usr/bin/env python # -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from appconf import AppConf trans_app_label = _('Multisite') class OppsMultiSiteConf(AppConf): ADMIN = False class Meta: prefix = 'opps_multisite'
<commit_before><commit_msg>Set default value on settings var OPPS_MULTISITE_ADMIN<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from appconf import AppConf trans_app_label = _('Multisite') class OppsMultiSiteConf(AppConf): ADMIN = False class Meta: prefix = 'opps_multisite'
75c376aab034d2e21bc9eb5ab3cc6a9dee9d7ac3
oslo/messaging/notify/_impl_log.py
oslo/messaging/notify/_impl_log.py
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority)(jsonutils.dumps(message))
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority.lower())(jsonutils.dumps(message))
Use lowercase priority in log notifier
Use lowercase priority in log notifier
Python
apache-2.0
JioCloud/oslo.messaging,dims/oslo.messaging,isyippee/oslo.messaging,dukhlov/oslo.messaging,eayunstack/oslo.messaging,stevei101/oslo.messaging,magic0704/oslo.messaging,hkumarmk/oslo.messaging,apporc/oslo.messaging,magic0704/oslo.messaging,dukhlov/oslo.messaging,markmc/oslo.messaging,stevei101/oslo.messaging,zhurongze/oslo.messaging,ozamiatin/oslo.messaging,dims/oslo.messaging,zhurongze/oslo.messaging,markmc/oslo.messaging,redhat-openstack/oslo.messaging,isyippee/oslo.messaging,redhat-openstack/oslo.messaging,apporc/oslo.messaging,viggates/oslo.messaging,citrix-openstack-build/oslo.messaging,ozamiatin/oslo.messaging,hkumarmk/oslo.messaging
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority)(jsonutils.dumps(message)) Use lowercase priority in log notifier
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority.lower())(jsonutils.dumps(message))
<commit_before> # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority)(jsonutils.dumps(message)) <commit_msg>Use lowercase priority in log notifier<commit_after>
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority.lower())(jsonutils.dumps(message))
# Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority)(jsonutils.dumps(message)) Use lowercase priority in log notifier # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority.lower())(jsonutils.dumps(message))
<commit_before> # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority)(jsonutils.dumps(message)) <commit_msg>Use lowercase priority in log notifier<commit_after> # Copyright 2011 OpenStack Foundation. # All Rights Reserved. # Copyright 2013 Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import logging from oslo.messaging.notify import notifier from oslo.messaging.openstack.common import jsonutils class LogDriver(notifier._Driver): "Publish notifications via Python logging infrastructure." LOGGER_BASE = 'oslo.messaging.notification' def notify(self, ctxt, message, priority): logger = logging.getLogger('%s.%s' % (self.LOGGER_BASE, message['event_type'])) getattr(logger, priority.lower())(jsonutils.dumps(message))
4261aad86b40d052906b8162263e00aa7b12b5e7
pritunl_node/call_buffer.py
pritunl_node/call_buffer.py
from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): if self.waiter: self.waiter([]) self.waiter = None calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call)
from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): self.stop_waiter() calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def stop_waiter(self): if self.waiter: self.waiter(None) self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call)
Add stop waiter to call buffer
Add stop waiter to call buffer
Python
agpl-3.0
pritunl/pritunl-node,pritunl/pritunl-node
from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): if self.waiter: self.waiter([]) self.waiter = None calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call) Add stop waiter to call buffer
from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): self.stop_waiter() calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def stop_waiter(self): if self.waiter: self.waiter(None) self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call)
<commit_before>from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): if self.waiter: self.waiter([]) self.waiter = None calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call) <commit_msg>Add stop waiter to call buffer<commit_after>
from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): self.stop_waiter() calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def stop_waiter(self): if self.waiter: self.waiter(None) self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call)
from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): if self.waiter: self.waiter([]) self.waiter = None calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call) Add stop waiter to call bufferfrom constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): self.stop_waiter() calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def stop_waiter(self): if self.waiter: self.waiter(None) self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call)
<commit_before>from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): if self.waiter: self.waiter([]) self.waiter = None calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call) <commit_msg>Add stop waiter to call buffer<commit_after>from constants import * import collections import uuid class CallBuffer(): def __init__(self): self.waiter = None self.queue = collections.deque(maxlen=CALL_QUEUE_MAX) self.call_waiters = {} def wait_for_calls(self, callback): self.stop_waiter() calls = [] while True: try: calls.append(self.queue.popleft()) except IndexError: break if calls: callback(calls) return self.waiter = callback def cancel_waiter(self): self.waiter = None def stop_waiter(self): if self.waiter: self.waiter(None) self.waiter = None def return_call(self, id, response): callback = self.call_waiters.pop(id, None) if callback: callback(response) def create_call(self, command, args, callback=None): call_id = uuid.uuid4().hex call = { 'id': call_id, 'command': command, 'args': args, } if callback: self.call_waiters[call_id] = callback if self.waiter: self.waiter([call]) self.waiter = None else: self.queue.append(call)
e5949d11bf2c8b37a4fa583d71a21e2719364f5c
changes/jobs/sync_build.py
changes/jobs/sync_build.py
from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) raise
import logging from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity logger = logging.getLogger('jobs') def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) logger.exception('Failed to sync build') raise
Write exceptions to jobs logger
Write exceptions to jobs logger
Python
apache-2.0
bowlofstew/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,bowlofstew/changes,dropbox/changes,wfxiang08/changes,dropbox/changes,bowlofstew/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes
from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) raise Write exceptions to jobs logger
import logging from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity logger = logging.getLogger('jobs') def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) logger.exception('Failed to sync build') raise
<commit_before>from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) raise <commit_msg>Write exceptions to jobs logger<commit_after>
import logging from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity logger = logging.getLogger('jobs') def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) logger.exception('Failed to sync build') raise
from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) raise Write exceptions to jobs loggerimport logging from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity logger = logging.getLogger('jobs') def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) logger.exception('Failed to sync build') raise
<commit_before>from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) raise <commit_msg>Write exceptions to jobs logger<commit_after>import logging from datetime import datetime from flask import current_app from changes.backends.jenkins.builder import JenkinsBuilder from changes.config import db, queue from changes.constants import Status, Result from changes.models import Build, RemoteEntity logger = logging.getLogger('jobs') def sync_build(build_id): try: build = Build.query.get(build_id) if not build: return if build.status == Status.finished: return # HACK(dcramer): this definitely is a temporary fix for our "things are # only a single builder" problem entity = RemoteEntity.query.filter_by( provider='jenkins', internal_id=build.id, type='build', ).first() if not entity: build.status = Status.finished build.result = Result.aborted else: builder = JenkinsBuilder( app=current_app, base_url=current_app.config['JENKINS_URL'], ) builder.sync_build(build) build.date_modified = datetime.utcnow() db.session.add(build) if build.status != Status.finished: queue.delay('sync_build', build_id=build.id.hex) except Exception: # Ensure we continue to synchronize this build as this could be a # temporary failure queue.retry('sync_build', build_id=build.id.hex) logger.exception('Failed to sync build') raise
70e4c1fe5faefd87d19fa0067010cfdbeb7576c2
tests/models.py
tests/models.py
from django.db import models from enumfields import Enum, EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1)
from django.db import models from enum import Enum from enumfields import EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1)
Use regular Enums in tests
Use regular Enums in tests
Python
mit
jessamynsmith/django-enumfields,suutari-ai/django-enumfields,bxm156/django-enumfields,jackyyf/django-enumfields
from django.db import models from enumfields import Enum, EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1) Use regular Enums in tests
from django.db import models from enum import Enum from enumfields import EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1)
<commit_before>from django.db import models from enumfields import Enum, EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1) <commit_msg>Use regular Enums in tests<commit_after>
from django.db import models from enum import Enum from enumfields import EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1)
from django.db import models from enumfields import Enum, EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1) Use regular Enums in testsfrom django.db import models from enum import Enum from enumfields import EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1)
<commit_before>from django.db import models from enumfields import Enum, EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1) <commit_msg>Use regular Enums in tests<commit_after>from django.db import models from enum import Enum from enumfields import EnumField class MyModel(models.Model): class Color(Enum): RED = 'r' GREEN = 'g' BLUE = 'b' color = EnumField(Color, max_length=1)
7635dd48e94cb1a128b95a5237dc289f1f65964c
django_digest/test/__init__.py
django_digest/test/__init__.py
from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None
from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) # This payload object can only be read once. Since digest auth involves # two requests, refresh it for the second "request" payload = request['wsgi.input'].read() request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None
Reset input for second "request"
Reset input for second "request"
Python
bsd-3-clause
dimagi/django-digest
from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None Reset input for second "request"
from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) # This payload object can only be read once. Since digest auth involves # two requests, refresh it for the second "request" payload = request['wsgi.input'].read() request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None
<commit_before>from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None <commit_msg>Reset input for second "request"<commit_after>
from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) # This payload object can only be read once. Since digest auth involves # two requests, refresh it for the second "request" payload = request['wsgi.input'].read() request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None
from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None Reset input for second "request"from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) # This payload object can only be read once. Since digest auth involves # two requests, refresh it for the second "request" payload = request['wsgi.input'].read() request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None
<commit_before>from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None <commit_msg>Reset input for second "request"<commit_after>from __future__ import absolute_import from __future__ import unicode_literals import django.test from django_digest.test.methods.basic import BasicAuth from django_digest.test.methods.detect import DetectAuth from django_digest.test.methods.digest import DigestAuth class Client(django.test.Client): AUTH_METHODS = {'Basic': BasicAuth, 'Digest': DigestAuth} def __init__(self, *args, **kwargs): super(Client, self).__init__(*args, **kwargs) self.clear_authorization() def request(self, **request): if self.auth_method: request.update(self.auth_method(request)) # This payload object can only be read once. Since digest auth involves # two requests, refresh it for the second "request" payload = request['wsgi.input'].read() request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) if response.status_code == 401 and self.auth_method: # Try to authenticate request.update(self.auth_method(request, response)) request['wsgi.input'] = django.test.client.FakePayload(payload) response = super(Client, self).request(**request) return response def set_authorization(self, username, password, method=None): self.username = username self.password = password if method is None: self.auth_method = DetectAuth(client=self, username=username, password=password) else: self.auth_method = self.AUTH_METHODS[method](username=username, password=password) def clear_authorization(self): self.username = None self.password = None self.auth_method = None
13dc2bc9af1791a6d72c90264baee3d05f937482
python/train_reservation.py
python/train_reservation.py
class TicketOffice(object): def __init__(self, trains=None): self.trains = trains or {} def add_train(self, train_id, train): self.trains[train_id] = train def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Train(object): def __init__(self, seats=None): self.seats = seats or [] class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number
class TicketOffice(object): def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number
Make the starting code simpler
Make the starting code simpler
Python
mit
emilybache/KataTrainReservation,emilybache/KataTrainReservation,emilybache/KataTrainReservation,emilybache/KataTrainReservation
class TicketOffice(object): def __init__(self, trains=None): self.trains = trains or {} def add_train(self, train_id, train): self.trains[train_id] = train def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Train(object): def __init__(self, seats=None): self.seats = seats or [] class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_numberMake the starting code simpler
class TicketOffice(object): def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number
<commit_before> class TicketOffice(object): def __init__(self, trains=None): self.trains = trains or {} def add_train(self, train_id, train): self.trains[train_id] = train def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Train(object): def __init__(self, seats=None): self.seats = seats or [] class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number<commit_msg>Make the starting code simpler<commit_after>
class TicketOffice(object): def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number
class TicketOffice(object): def __init__(self, trains=None): self.trains = trains or {} def add_train(self, train_id, train): self.trains[train_id] = train def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Train(object): def __init__(self, seats=None): self.seats = seats or [] class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_numberMake the starting code simpler class TicketOffice(object): def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number
<commit_before> class TicketOffice(object): def __init__(self, trains=None): self.trains = trains or {} def add_train(self, train_id, train): self.trains[train_id] = train def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Train(object): def __init__(self, seats=None): self.seats = seats or [] class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number<commit_msg>Make the starting code simpler<commit_after> class TicketOffice(object): def make_reservation(self, reservation_request): # TODO: write this code! pass class ReservationRequest(object): def __init__(self, train_id, seat_count): self.train_id = train_id self.seat_count = seat_count class Reservation(object): def __init__(self, train_id, seats=None, booking_reference=None): self.train_id = train_id self.seats = seats or [] self.booking_reference = booking_reference class Seat(object): def __init__(self, carriage, seat_number): self.carriage = carriage self.seat_number = seat_number
100a2ef97d499a87d3fae271f794de050f1c5686
opps/sitemaps/urls.py
opps/sitemaps/urls.py
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'articles': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'articles': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', sitemap_views.sitemap, {'sitemaps': sitemaps}), )
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'containers': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'containers': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps}), )
Add cache in sitemap section
Add cache in sitemap section
Python
mit
williamroot/opps,opps/opps,williamroot/opps,jeanmask/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,YACOWS/opps,williamroot/opps,jeanmask/opps,YACOWS/opps,jeanmask/opps,opps/opps,opps/opps,opps/opps
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'articles': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'articles': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', sitemap_views.sitemap, {'sitemaps': sitemaps}), ) Add cache in sitemap section
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'containers': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'containers': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps}), )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'articles': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'articles': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', sitemap_views.sitemap, {'sitemaps': sitemaps}), ) <commit_msg>Add cache in sitemap section<commit_after>
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'containers': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'containers': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps}), )
#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'articles': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'articles': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', sitemap_views.sitemap, {'sitemaps': sitemaps}), ) Add cache in sitemap section#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'containers': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'containers': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps}), )
<commit_before>#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'articles': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'articles': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', sitemap_views.sitemap, {'sitemaps': sitemaps}), ) <commit_msg>Add cache in sitemap section<commit_after>#!/usr/bin/env python # -*- coding: utf-8 -*- from django.conf.urls import patterns, url from django.contrib.sitemaps import views as sitemap_views from opps.core.cache import cache_page from opps.sitemaps.sitemaps import GenericSitemap, InfoDisct sitemaps = { 'containers': GenericSitemap(InfoDisct(), priority=0.6), } sitemaps_googlenews = { 'containers': GenericSitemap(InfoDisct(True), priority=0.6), } urlpatterns = patterns( '', url(r'^\.xml$', cache_page(86400)(sitemap_views.index), {'sitemaps': sitemaps}), url(r'^-googlenews\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps_googlenews, 'template_name': 'sitemap_googlenews.xml'}), url(r'^-(?P<section>.+)\.xml$', cache_page(86400)(sitemap_views.sitemap), {'sitemaps': sitemaps}), )
d125a0ff41311be4d0da35a3ebdad51eeed0bc19
ctypeslib/test/test_dynmodule.py
ctypeslib/test/test_dynmodule.py
# Basic test of dynamic code generation import unittest import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main()
# Basic test of dynamic code generation import unittest import os, glob import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def tearDown(self): for fnm in glob.glob(stdio._gen_basename + ".*"): try: os.remove(fnm) except IOError: pass def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main()
Clean up generated files in the tearDown method.
Clean up generated files in the tearDown method.
Python
mit
sugarmanz/ctypeslib
# Basic test of dynamic code generation import unittest import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main() Clean up generated files in the tearDown method.
# Basic test of dynamic code generation import unittest import os, glob import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def tearDown(self): for fnm in glob.glob(stdio._gen_basename + ".*"): try: os.remove(fnm) except IOError: pass def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main()
<commit_before># Basic test of dynamic code generation import unittest import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main() <commit_msg>Clean up generated files in the tearDown method.<commit_after>
# Basic test of dynamic code generation import unittest import os, glob import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def tearDown(self): for fnm in glob.glob(stdio._gen_basename + ".*"): try: os.remove(fnm) except IOError: pass def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main()
# Basic test of dynamic code generation import unittest import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main() Clean up generated files in the tearDown method.# Basic test of dynamic code generation import unittest import os, glob import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def tearDown(self): for fnm in glob.glob(stdio._gen_basename + ".*"): try: os.remove(fnm) except IOError: pass def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main()
<commit_before># Basic test of dynamic code generation import unittest import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main() <commit_msg>Clean up generated files in the tearDown method.<commit_after># Basic test of dynamic code generation import unittest import os, glob import stdio from ctypes import POINTER, c_int class DynModTest(unittest.TestCase): def tearDown(self): for fnm in glob.glob(stdio._gen_basename + ".*"): try: os.remove(fnm) except IOError: pass def test_fopen(self): self.failUnlessEqual(stdio.fopen.restype, POINTER(stdio.FILE)) self.failUnlessEqual(stdio.fopen.argtypes, [stdio.STRING, stdio.STRING]) def test_constants(self): self.failUnlessEqual(stdio.O_RDONLY, 0) self.failUnlessEqual(stdio.O_WRONLY, 1) self.failUnlessEqual(stdio.O_RDWR, 2) if __name__ == "__main__": unittest.main()
e64b8fcb9854edcc689bf4b8fec5b3c589e7226f
netdisco/discoverables/belkin_wemo.py
netdisco/discoverables/belkin_wemo.py
""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', '')) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'})
""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', ''), device['serialNumber']) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'})
Add serialnumber to wemo discovery info tuple
Add serialnumber to wemo discovery info tuple
Python
mit
sfam/netdisco,brburns/netdisco,balloob/netdisco
""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', '')) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'}) Add serialnumber to wemo discovery info tuple
""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', ''), device['serialNumber']) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'})
<commit_before>""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', '')) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'}) <commit_msg>Add serialnumber to wemo discovery info tuple<commit_after>
""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', ''), device['serialNumber']) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'})
""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', '')) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'}) Add serialnumber to wemo discovery info tuple""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', ''), device['serialNumber']) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'})
<commit_before>""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', '')) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'}) <commit_msg>Add serialnumber to wemo discovery info tuple<commit_after>""" Discovers Belkin Wemo devices. """ from . import SSDPDiscoverable class Discoverable(SSDPDiscoverable): """ Adds support for discovering Belkin WeMo platform devices. """ def info_from_entry(self, entry): """ Returns most important info from a uPnP entry. """ device = entry.description['device'] return (device['friendlyName'], device['modelName'], entry.values['location'], device.get('macAddress', ''), device['serialNumber']) def get_entries(self): """ Returns all Belkin Wemo entries. """ return self.find_by_device_description( {'manufacturer': 'Belkin International Inc.'})
f04177c853ccd686af30b5866c13c8016b462a6b
forecast/applications/core/commands/runserver.py
forecast/applications/core/commands/runserver.py
# coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8000, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!"
# coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8888, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!"
Change default server port from 8000 to 8888 (as suggested in tornado's documentation)
Change default server port from 8000 to 8888 (as suggested in tornado's documentation)
Python
mit
osantana/forecast
# coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8000, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!" Change default server port from 8000 to 8888 (as suggested in tornado's documentation)
# coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8888, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!"
<commit_before># coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8000, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!" <commit_msg>Change default server port from 8000 to 8888 (as suggested in tornado's documentation)<commit_after>
# coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8888, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!"
# coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8000, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!" Change default server port from 8000 to 8888 (as suggested in tornado's documentation)# coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8888, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!"
<commit_before># coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8000, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!" <commit_msg>Change default server port from 8000 to 8888 (as suggested in tornado's documentation)<commit_after># coding: utf-8 import tornado.ioloop from forecast.manager import BaseCommand, Argument class RunserverCommand(BaseCommand): help_text = "Start a server" parameters = ( Argument("--port", "-p", action="store", default=8888, type=int), ) def run(self, project, args, unknown_args): print "Development server is running at http://127.0.0.1:%s/" % (args.port,) print "Quit the server with CONTROL-C." tornado_application = project.get_tornado_application() tornado_application.listen(args.port) try: tornado.ioloop.IOLoop.instance().start() except KeyboardInterrupt: print "\nInterrupted!"
6729515de02ce0678793ffb8faf280e65a4376e2
run.py
run.py
import sys from core import KDPVGenerator def print_help(): print('Usage: python run.py [data.yml]') def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): if len(sys.argv) < 2: filename = 'data.yml' else: filename = sys.argv[1] if filename in {'help', '-h', '--help'}: print_help() else: generate(filename) if __name__ == '__main__': main()
import argparse import os from core import KDPVGenerator def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): parser = argparse.ArgumentParser(description='KDPV Generator') parser.add_argument('filename', nargs='?', default='data.yml', help='data file (default: data.yml)') args = parser.parse_args() if not args.filename: parser.print_help() else: if not os.path.isfile(args.filename): exit('Unable to open file: {}'.format(args.filename)) generate(args.filename) if __name__ == '__main__': main()
Add argparse, handle data file missing
Add argparse, handle data file missing
Python
mit
spbpython/kdpv_generator
import sys from core import KDPVGenerator def print_help(): print('Usage: python run.py [data.yml]') def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): if len(sys.argv) < 2: filename = 'data.yml' else: filename = sys.argv[1] if filename in {'help', '-h', '--help'}: print_help() else: generate(filename) if __name__ == '__main__': main() Add argparse, handle data file missing
import argparse import os from core import KDPVGenerator def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): parser = argparse.ArgumentParser(description='KDPV Generator') parser.add_argument('filename', nargs='?', default='data.yml', help='data file (default: data.yml)') args = parser.parse_args() if not args.filename: parser.print_help() else: if not os.path.isfile(args.filename): exit('Unable to open file: {}'.format(args.filename)) generate(args.filename) if __name__ == '__main__': main()
<commit_before>import sys from core import KDPVGenerator def print_help(): print('Usage: python run.py [data.yml]') def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): if len(sys.argv) < 2: filename = 'data.yml' else: filename = sys.argv[1] if filename in {'help', '-h', '--help'}: print_help() else: generate(filename) if __name__ == '__main__': main() <commit_msg>Add argparse, handle data file missing<commit_after>
import argparse import os from core import KDPVGenerator def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): parser = argparse.ArgumentParser(description='KDPV Generator') parser.add_argument('filename', nargs='?', default='data.yml', help='data file (default: data.yml)') args = parser.parse_args() if not args.filename: parser.print_help() else: if not os.path.isfile(args.filename): exit('Unable to open file: {}'.format(args.filename)) generate(args.filename) if __name__ == '__main__': main()
import sys from core import KDPVGenerator def print_help(): print('Usage: python run.py [data.yml]') def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): if len(sys.argv) < 2: filename = 'data.yml' else: filename = sys.argv[1] if filename in {'help', '-h', '--help'}: print_help() else: generate(filename) if __name__ == '__main__': main() Add argparse, handle data file missingimport argparse import os from core import KDPVGenerator def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): parser = argparse.ArgumentParser(description='KDPV Generator') parser.add_argument('filename', nargs='?', default='data.yml', help='data file (default: data.yml)') args = parser.parse_args() if not args.filename: parser.print_help() else: if not os.path.isfile(args.filename): exit('Unable to open file: {}'.format(args.filename)) generate(args.filename) if __name__ == '__main__': main()
<commit_before>import sys from core import KDPVGenerator def print_help(): print('Usage: python run.py [data.yml]') def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): if len(sys.argv) < 2: filename = 'data.yml' else: filename = sys.argv[1] if filename in {'help', '-h', '--help'}: print_help() else: generate(filename) if __name__ == '__main__': main() <commit_msg>Add argparse, handle data file missing<commit_after>import argparse import os from core import KDPVGenerator def generate(filename): generator = KDPVGenerator.from_yml(filename) generator.generate() def main(): parser = argparse.ArgumentParser(description='KDPV Generator') parser.add_argument('filename', nargs='?', default='data.yml', help='data file (default: data.yml)') args = parser.parse_args() if not args.filename: parser.print_help() else: if not os.path.isfile(args.filename): exit('Unable to open file: {}'.format(args.filename)) generate(args.filename) if __name__ == '__main__': main()
25e35b650d55e71b3af5b7725cdb8318a15137a2
run.py
run.py
#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True)
#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True,processes=3)
Set development process to threaded
Set development process to threaded
Python
agpl-3.0
TitanEmbeds/Titan,TitanEmbeds/Titan,TitanEmbeds/Titan
#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True) Set development process to threaded
#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True,processes=3)
<commit_before>#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True) <commit_msg>Set development process to threaded<commit_after>
#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True,processes=3)
#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True) Set development process to threaded#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True,processes=3)
<commit_before>#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True) <commit_msg>Set development process to threaded<commit_after>#!/usr/bin/env python2 from titanembeds.app import app def init_debug(): import os from flask import jsonify, request os.environ['OAUTHLIB_INSECURE_TRANSPORT'] = '1' # Testing oauthlib # Session viewer https://gist.github.com/babldev/502364a3f7c9bafaa6db def decode_flask_cookie(secret_key, cookie_str): import hashlib from itsdangerous import URLSafeTimedSerializer from flask.sessions import TaggedJSONSerializer salt = 'cookie-session' serializer = TaggedJSONSerializer() signer_kwargs = { 'key_derivation': 'hmac', 'digest_method': hashlib.sha1 } s = URLSafeTimedSerializer(secret_key, salt=salt, serializer=serializer, signer_kwargs=signer_kwargs) return s.loads(cookie_str) @app.route("/session") def session(): cookie = request.cookies.get('session') if cookie: decoded = decode_flask_cookie(app.secret_key, request.cookies.get('session')) else: decoded = None return jsonify(session_cookie=decoded) if __name__ == "__main__": init_debug() app.run(host="0.0.0.0",port=3000,debug=True,processes=3)
546f4881974af4516cfaaf4e53c0940d90b6d502
configurations/__init__.py
configurations/__init__.py
# flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install()
# flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() # django >=1.7 try: import django django.setup() except AttributeError: pass def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install()
Add `django.setup()` in `load_ipython_extension` function for django>=1.7 compatibility
Add `django.setup()` in `load_ipython_extension` function for django>=1.7 compatibility
Python
bsd-3-clause
cato-/django-configurations,blindroot/django-configurations,pombredanne/django-configurations,jezdez/django-configurations,seenureddy/django-configurations,incuna/django-configurations,jazzband/django-configurations,nangia/django-configurations,jazzband/django-configurations,NextHub/django-configurations,gatherhealth/django-configurations
# flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install() Add `django.setup()` in `load_ipython_extension` function for django>=1.7 compatibility
# flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() # django >=1.7 try: import django django.setup() except AttributeError: pass def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install()
<commit_before># flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install() <commit_msg>Add `django.setup()` in `load_ipython_extension` function for django>=1.7 compatibility<commit_after>
# flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() # django >=1.7 try: import django django.setup() except AttributeError: pass def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install()
# flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install() Add `django.setup()` in `load_ipython_extension` function for django>=1.7 compatibility# flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() # django >=1.7 try: import django django.setup() except AttributeError: pass def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install()
<commit_before># flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install() <commit_msg>Add `django.setup()` in `load_ipython_extension` function for django>=1.7 compatibility<commit_after># flake8: noqa from .base import Settings, Configuration from .decorators import pristinemethod __version__ = '0.8' __all__ = ['Configuration', 'pristinemethod', 'Settings'] def load_ipython_extension(ipython): # The `ipython` argument is the currently active `InteractiveShell` # instance, which can be used in any way. This allows you to register # new magics or aliases, for example. from . import importer importer.install() # django >=1.7 try: import django django.setup() except AttributeError: pass def setup(app): """ The callback for Sphinx that acts as a Sphinx extension. Add this to the ``extensions`` config variable in your ``conf.py``. """ from . import importer importer.install()
504c50bd5cf229b5686f398304ab26e707d0cad8
partner_firstname/exceptions.py
partner_firstname/exceptions.py
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class PartnerNameError(exceptions.ValidationError): def __init__(self, record, value=None): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id @property def value(self): raise NotImplementedError() class EmptyNames(PartnerNameError): @property def value(self): return _("No name is set.")
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class EmptyNames(exceptions.ValidationError): def __init__(self, record, value=_("No name is set.")): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id
Remove subclassing of exception, since there is only one.
Remove subclassing of exception, since there is only one.
Python
agpl-3.0
microcom/partner-contact,brain-tec/partner-contact,brain-tec/partner-contact,microcom/partner-contact
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class PartnerNameError(exceptions.ValidationError): def __init__(self, record, value=None): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id @property def value(self): raise NotImplementedError() class EmptyNames(PartnerNameError): @property def value(self): return _("No name is set.") Remove subclassing of exception, since there is only one.
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class EmptyNames(exceptions.ValidationError): def __init__(self, record, value=_("No name is set.")): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id
<commit_before># -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class PartnerNameError(exceptions.ValidationError): def __init__(self, record, value=None): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id @property def value(self): raise NotImplementedError() class EmptyNames(PartnerNameError): @property def value(self): return _("No name is set.") <commit_msg>Remove subclassing of exception, since there is only one.<commit_after>
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class EmptyNames(exceptions.ValidationError): def __init__(self, record, value=_("No name is set.")): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id
# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class PartnerNameError(exceptions.ValidationError): def __init__(self, record, value=None): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id @property def value(self): raise NotImplementedError() class EmptyNames(PartnerNameError): @property def value(self): return _("No name is set.") Remove subclassing of exception, since there is only one.# -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class EmptyNames(exceptions.ValidationError): def __init__(self, record, value=_("No name is set.")): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id
<commit_before># -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class PartnerNameError(exceptions.ValidationError): def __init__(self, record, value=None): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id @property def value(self): raise NotImplementedError() class EmptyNames(PartnerNameError): @property def value(self): return _("No name is set.") <commit_msg>Remove subclassing of exception, since there is only one.<commit_after># -*- encoding: utf-8 -*- # Odoo, Open Source Management Solution # Copyright (C) 2014-2015 Grupo ESOC <www.grupoesoc.es> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Affero General Public License for more details. # # You should have received a copy of the GNU Affero General Public License # along with this program. If not, see <http://www.gnu.org/licenses/>. from openerp import _, exceptions class EmptyNames(exceptions.ValidationError): def __init__(self, record, value=_("No name is set.")): self.record = record self._value = value self.name = _("Error(s) with partner %d's name.") % record.id
de6f0144f566bc3a8eedb3f7d8f323d2e26f0612
blender/SearchStrip.py
blender/SearchStrip.py
#=========== MODIFY PARAMETERS HERE ================= search_string="rea-mix-2016-05-13" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND' or i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True
#=========== MODIFY PARAMETERS HERE ================= search_string="2016-07-25-rea-mix" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND': if i.sound.filepath.find(search_string)!=-1: i.select = True if i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True
Fix Search Strip script again (for sound files)
Fix Search Strip script again (for sound files)
Python
cc0-1.0
morevnaproject/scripts,morevnaproject/scripts
#=========== MODIFY PARAMETERS HERE ================= search_string="rea-mix-2016-05-13" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND' or i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True Fix Search Strip script again (for sound files)
#=========== MODIFY PARAMETERS HERE ================= search_string="2016-07-25-rea-mix" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND': if i.sound.filepath.find(search_string)!=-1: i.select = True if i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True
<commit_before>#=========== MODIFY PARAMETERS HERE ================= search_string="rea-mix-2016-05-13" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND' or i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True <commit_msg>Fix Search Strip script again (for sound files)<commit_after>
#=========== MODIFY PARAMETERS HERE ================= search_string="2016-07-25-rea-mix" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND': if i.sound.filepath.find(search_string)!=-1: i.select = True if i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True
#=========== MODIFY PARAMETERS HERE ================= search_string="rea-mix-2016-05-13" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND' or i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True Fix Search Strip script again (for sound files)#=========== MODIFY PARAMETERS HERE ================= search_string="2016-07-25-rea-mix" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND': if i.sound.filepath.find(search_string)!=-1: i.select = True if i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True
<commit_before>#=========== MODIFY PARAMETERS HERE ================= search_string="rea-mix-2016-05-13" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND' or i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True <commit_msg>Fix Search Strip script again (for sound files)<commit_after>#=========== MODIFY PARAMETERS HERE ================= search_string="2016-07-25-rea-mix" #===================================================== import bpy seq=bpy.data.scenes[0].sequence_editor.sequences_all for i in seq: #print(i.type) if i.type == 'SOUND': if i.sound.filepath.find(search_string)!=-1: i.select = True if i.type == 'MOVIE': if i.filepath.find(search_string)!=-1: i.select = True if i.type=='IMAGE': if i.directory.find(search_string)!=-1: i.select = True
1b673b695cedbb5008db172309de6b4c23ec900f
appengine-experimental/src/models.py
appengine-experimental/src/models.py
from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active'
from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) modified = db.DateTimeProperty() def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active'
Add a "modified" property that will only be updated when the entity is actually updated.
Add a "modified" property that will only be updated when the entity is actually updated.
Python
isc
lectroidmarc/SacTraffic,lectroidmarc/SacTraffic
from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active' Add a "modified" property that will only be updated when the entity is actually updated.
from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) modified = db.DateTimeProperty() def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active'
<commit_before>from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active' <commit_msg>Add a "modified" property that will only be updated when the entity is actually updated.<commit_after>
from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) modified = db.DateTimeProperty() def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active'
from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active' Add a "modified" property that will only be updated when the entity is actually updated.from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) modified = db.DateTimeProperty() def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active'
<commit_before>from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active' <commit_msg>Add a "modified" property that will only be updated when the entity is actually updated.<commit_after>from datetime import datetime, timedelta from google.appengine.ext import db class CHPIncident(db.Model): CenterID = db.StringProperty(required=True) DispatchID = db.StringProperty(required=True) LogID = db.StringProperty(required=True) LogTime = db.DateTimeProperty() LogType = db.StringProperty() LogTypeID = db.StringProperty() Location = db.StringProperty() Area = db.StringProperty() ThomasBrothers = db.StringProperty() TBXY = db.StringProperty() LogDetails = db.BlobProperty() geolocation = db.GeoPtProperty() created = db.DateTimeProperty(auto_now_add=True) updated = db.DateTimeProperty(auto_now=True) modified = db.DateTimeProperty() def getStatus(self): if self.created > datetime.utcnow() - timedelta(minutes=5): # less than 5 min old == new return 'new' elif self.updated < datetime.utcnow() - timedelta(minutes=5): # not updated in 5 min == inactive return 'inactive' else: return 'active'
d2b06462f560f7243dd3f29b67c50d6d6f76f569
util/generate.py
util/generate.py
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' for f in os.listdir(TYPESDIR): basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
Allow generating one specific xml file instead of the whole directory.
Allow generating one specific xml file instead of the whole directory.
Python
apache-2.0
loganj/foursquared,loganj/foursquared
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' for f in os.listdir(TYPESDIR): basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) Allow generating one specific xml file instead of the whole directory.
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
<commit_before>#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' for f in os.listdir(TYPESDIR): basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) <commit_msg>Allow generating one specific xml file instead of the whole directory.<commit_after>
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' for f in os.listdir(TYPESDIR): basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) Allow generating one specific xml file instead of the whole directory.#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
<commit_before>#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' for f in os.listdir(TYPESDIR): basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) <commit_msg>Allow generating one specific xml file instead of the whole directory.<commit_after>#!/usr/bin/python import os import subprocess import sys BASEDIR = '../main/src/com/joelapenna/foursquare' TYPESDIR = '../captures/types/v1' captures = sys.argv[1:] if not captures: captures = os.listdir(TYPESDIR) for f in captures: basename = f.split('.')[0] javaname = ''.join([c.capitalize() for c in basename.split('_')]) fullpath = os.path.join(TYPESDIR, f) typepath = os.path.join(BASEDIR, 'types', javaname + '.java') parserpath = os.path.join(BASEDIR, 'parsers', javaname + 'Parser.java') cmd = 'python gen_class.py %s > %s' % (fullpath, typepath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True) cmd = 'python gen_parser.py %s > %s' % (fullpath, parserpath) print cmd subprocess.call(cmd, stdout=sys.stdout, shell=True)
54b83d907b5edc5ab4abe81a270acff8cd44cef5
grader/grader/utils/files.py
grader/grader/utils/files.py
import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: tar.add(source, recursive=True) return (tar_path, dest)
import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): """Create a tarball from a source directory, and store it in a temporary directory. :param str source: The directory (or file... whatever) that we're compressing into a tarball. The source will be added recursively. :param str tar_basename: The basename to use for the tarball. If you want the tarball to be named ``hsimpson.tar.gz``, then ``tar_basename`` should be ``hsimpson``. :param str extension: The extension to use for the tarball. :param str compression: The compression algorithm to use to compress the tar. :return: A tuple: (Path to the tarball, temp directory that contains the tarball) :rtype: (str, str) """ source = os.path.normpath(source) dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: arcname = os.path.basename(source) tar.add(source, arcname, recursive=True) return (tar_path, dest)
Fix folder structure of created tarballs
Fix folder structure of created tarballs
Python
mit
redkyn/grader,redkyn/grader,grade-it/grader
import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: tar.add(source, recursive=True) return (tar_path, dest) Fix folder structure of created tarballs
import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): """Create a tarball from a source directory, and store it in a temporary directory. :param str source: The directory (or file... whatever) that we're compressing into a tarball. The source will be added recursively. :param str tar_basename: The basename to use for the tarball. If you want the tarball to be named ``hsimpson.tar.gz``, then ``tar_basename`` should be ``hsimpson``. :param str extension: The extension to use for the tarball. :param str compression: The compression algorithm to use to compress the tar. :return: A tuple: (Path to the tarball, temp directory that contains the tarball) :rtype: (str, str) """ source = os.path.normpath(source) dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: arcname = os.path.basename(source) tar.add(source, arcname, recursive=True) return (tar_path, dest)
<commit_before>import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: tar.add(source, recursive=True) return (tar_path, dest) <commit_msg>Fix folder structure of created tarballs<commit_after>
import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): """Create a tarball from a source directory, and store it in a temporary directory. :param str source: The directory (or file... whatever) that we're compressing into a tarball. The source will be added recursively. :param str tar_basename: The basename to use for the tarball. If you want the tarball to be named ``hsimpson.tar.gz``, then ``tar_basename`` should be ``hsimpson``. :param str extension: The extension to use for the tarball. :param str compression: The compression algorithm to use to compress the tar. :return: A tuple: (Path to the tarball, temp directory that contains the tarball) :rtype: (str, str) """ source = os.path.normpath(source) dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: arcname = os.path.basename(source) tar.add(source, arcname, recursive=True) return (tar_path, dest)
import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: tar.add(source, recursive=True) return (tar_path, dest) Fix folder structure of created tarballsimport os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): """Create a tarball from a source directory, and store it in a temporary directory. :param str source: The directory (or file... whatever) that we're compressing into a tarball. The source will be added recursively. :param str tar_basename: The basename to use for the tarball. If you want the tarball to be named ``hsimpson.tar.gz``, then ``tar_basename`` should be ``hsimpson``. :param str extension: The extension to use for the tarball. :param str compression: The compression algorithm to use to compress the tar. :return: A tuple: (Path to the tarball, temp directory that contains the tarball) :rtype: (str, str) """ source = os.path.normpath(source) dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: arcname = os.path.basename(source) tar.add(source, arcname, recursive=True) return (tar_path, dest)
<commit_before>import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: tar.add(source, recursive=True) return (tar_path, dest) <commit_msg>Fix folder structure of created tarballs<commit_after>import os import tarfile import tempfile def make_tarball(source, tar_basename, extension=".tar.gz", compression="gz"): """Create a tarball from a source directory, and store it in a temporary directory. :param str source: The directory (or file... whatever) that we're compressing into a tarball. The source will be added recursively. :param str tar_basename: The basename to use for the tarball. If you want the tarball to be named ``hsimpson.tar.gz``, then ``tar_basename`` should be ``hsimpson``. :param str extension: The extension to use for the tarball. :param str compression: The compression algorithm to use to compress the tar. :return: A tuple: (Path to the tarball, temp directory that contains the tarball) :rtype: (str, str) """ source = os.path.normpath(source) dest = tempfile.mkdtemp() tar_name = "{}{}".format(tar_basename, extension) tar_path = os.path.join(dest, tar_name) mode = "w:{}".format(compression or "") with tarfile.open(tar_path, mode) as tar: arcname = os.path.basename(source) tar.add(source, arcname, recursive=True) return (tar_path, dest)
36ceb8ef8da382b9fdafcbe20cc45012712fbf10
user_clipboard/migrations/0001_initial.py
user_clipboard/migrations/0001_initial.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default=b'', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ]
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default='', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ]
Fix migrations (filename default value)
Fix migrations (filename default value)
Python
mit
MagicSolutions/django-user-clipboard,IndustriaTech/django-user-clipboard,MagicSolutions/django-user-clipboard,IndustriaTech/django-user-clipboard
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default=b'', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ] Fix migrations (filename default value)
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default='', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ]
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default=b'', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ] <commit_msg>Fix migrations (filename default value)<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default='', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ]
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default=b'', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ] Fix migrations (filename default value)# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default='', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ]
<commit_before># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default=b'', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ] <commit_msg>Fix migrations (filename default value)<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models from django.conf import settings import django.utils.timezone import user_clipboard.models class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ migrations.CreateModel( name='Clipboard', fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('file', models.FileField(max_length=128, upload_to=user_clipboard.models.new_file_upload_to)), ('filename', models.CharField(default='', max_length=256, editable=False)), ('is_image', models.BooleanField(default=False, db_index=True, editable=False)), ('date_created', models.DateTimeField(default=django.utils.timezone.now, editable=False, db_index=True)), ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'verbose_name': 'Clipboard Item', 'verbose_name_plural': 'Clipboard', }, ), ]
d23aab91b69e1b71603afe6c3135cc11ce14a2fc
entity_networks/model_utils.py
entity_networks/model_utils.py
from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length def get_sequence_mask(sequence, scope=None): """ This is a hacky way of masking the padded sentence embeddings. """ with tf.variable_scope(scope, 'SequenceMask'): sequence = tf.reduce_sum(sequence, reduction_indices=[-1], keep_dims=True) mask = tf.to_float(tf.greater(sequence, 0)) mask = tf.expand_dims(mask, -1) return mask
from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length
Remove get_sequence_mask in favor of simpler embedding mask
Remove get_sequence_mask in favor of simpler embedding mask
Python
mit
jimfleming/recurrent-entity-networks,mikalyoung/recurrent-entity-networks,mikalyoung/recurrent-entity-networks,jimfleming/recurrent-entity-networks
from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length def get_sequence_mask(sequence, scope=None): """ This is a hacky way of masking the padded sentence embeddings. """ with tf.variable_scope(scope, 'SequenceMask'): sequence = tf.reduce_sum(sequence, reduction_indices=[-1], keep_dims=True) mask = tf.to_float(tf.greater(sequence, 0)) mask = tf.expand_dims(mask, -1) return mask Remove get_sequence_mask in favor of simpler embedding mask
from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length
<commit_before>from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length def get_sequence_mask(sequence, scope=None): """ This is a hacky way of masking the padded sentence embeddings. """ with tf.variable_scope(scope, 'SequenceMask'): sequence = tf.reduce_sum(sequence, reduction_indices=[-1], keep_dims=True) mask = tf.to_float(tf.greater(sequence, 0)) mask = tf.expand_dims(mask, -1) return mask <commit_msg>Remove get_sequence_mask in favor of simpler embedding mask<commit_after>
from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length
from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length def get_sequence_mask(sequence, scope=None): """ This is a hacky way of masking the padded sentence embeddings. """ with tf.variable_scope(scope, 'SequenceMask'): sequence = tf.reduce_sum(sequence, reduction_indices=[-1], keep_dims=True) mask = tf.to_float(tf.greater(sequence, 0)) mask = tf.expand_dims(mask, -1) return mask Remove get_sequence_mask in favor of simpler embedding maskfrom __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length
<commit_before>from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length def get_sequence_mask(sequence, scope=None): """ This is a hacky way of masking the padded sentence embeddings. """ with tf.variable_scope(scope, 'SequenceMask'): sequence = tf.reduce_sum(sequence, reduction_indices=[-1], keep_dims=True) mask = tf.to_float(tf.greater(sequence, 0)) mask = tf.expand_dims(mask, -1) return mask <commit_msg>Remove get_sequence_mask in favor of simpler embedding mask<commit_after>from __future__ import absolute_import from __future__ import print_function from __future__ import division import numpy as np import tensorflow as tf def get_sequence_length(sequence, scope=None): """ This is a hacky way of determining the actual length of a sequence that has been padded with zeros. """ with tf.variable_scope(scope, 'SequenceLength'): used = tf.sign(tf.reduce_max(tf.abs(sequence), reduction_indices=[-1])) length = tf.cast(tf.reduce_sum(used, reduction_indices=[-1]), tf.int32) return length
b0d18dcdeb125cdae39c220726520e9a28f08ee2
tweets/views.py
tweets/views.py
from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user=self.request.user) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form)
from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user_id=self.request.user.id) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form)
Fix for lazy loading of request.user
Fix for lazy loading of request.user
Python
mit
pennomi/openwest2015-twitter-clone,pennomi/openwest2015-twitter-clone,pennomi/openwest2015-twitter-clone
from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user=self.request.user) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form) Fix for lazy loading of request.user
from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user_id=self.request.user.id) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form)
<commit_before>from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user=self.request.user) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form) <commit_msg>Fix for lazy loading of request.user<commit_after>
from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user_id=self.request.user.id) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form)
from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user=self.request.user) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form) Fix for lazy loading of request.userfrom django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user_id=self.request.user.id) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form)
<commit_before>from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user=self.request.user) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form) <commit_msg>Fix for lazy loading of request.user<commit_after>from django.http import Http404 from django.contrib.auth import get_user_model from django.shortcuts import render, get_object_or_404 from django.utils.translation import ugettext as _ from django.views.generic import ListView, edit from .models import Message class MessageList(ListView): template_name = "message_list.html" model = Message class MyMessageList(MessageList): def get_queryset(self): queryset = super().get_queryset() return queryset.filter(user_id=self.request.user.id) class FilteredMessageList(MessageList): def get_queryset(self): # Check to see if user exists. 404 if not. username = self.kwargs.get('username') user = get_object_or_404(get_user_model(), username=username) # Filter messages by the user as author. queryset = super().get_queryset() return queryset.filter(user=user) class CreateMessage(edit.CreateView): model = Message fields = ['text'] template_name = "message_form.html" def form_valid(self, form): obj = form.save(commit=False) obj.user = self.request.user obj.save() return super().form_valid(form)
1a2e892539cde260934ceffe58d399c5a3222d0c
actions/cloudbolt_plugins/multi_user_approval/two_user_approval.py
actions/cloudbolt_plugins/multi_user_approval/two_user_approval.py
""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it is becomes Active. """ from utilities.logger import ThreadLogger logger = ThreadLogger(__name__) def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", ""
""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it becomes Active. Requires CloudBolt 8.8 """ def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", ""
Remove logger and fix typos
Remove logger and fix typos [DEV-12140]
Python
apache-2.0
CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge
""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it is becomes Active. """ from utilities.logger import ThreadLogger logger = ThreadLogger(__name__) def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", "" Remove logger and fix typos [DEV-12140]
""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it becomes Active. Requires CloudBolt 8.8 """ def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", ""
<commit_before>""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it is becomes Active. """ from utilities.logger import ThreadLogger logger = ThreadLogger(__name__) def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", "" <commit_msg>Remove logger and fix typos [DEV-12140]<commit_after>
""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it becomes Active. Requires CloudBolt 8.8 """ def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", ""
""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it is becomes Active. """ from utilities.logger import ThreadLogger logger = ThreadLogger(__name__) def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", "" Remove logger and fix typos [DEV-12140]""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it becomes Active. Requires CloudBolt 8.8 """ def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", ""
<commit_before>""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it is becomes Active. """ from utilities.logger import ThreadLogger logger = ThreadLogger(__name__) def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", "" <commit_msg>Remove logger and fix typos [DEV-12140]<commit_after>""" Two User Approval Overrides CloudBolt's standard Order Approval workflow. This Orchestration Action requires two users to approve an order before it becomes Active. Requires CloudBolt 8.8 """ def run(order, *args, **kwargs): # Return the order's status to "PENDING" if fewer than two users have # approved it. if len(order.approvers) < 2: order.status = "PENDING" order.save() return "SUCCESS", "", ""
2e92550dd52d8a084b01a6e4b8a429e50f11cf36
scripts/compact_seriesly.py
scripts/compact_seriesly.py
from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY['host']) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main()
from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main()
Update reference to Seriesly hostname
Update reference to Seriesly hostname Change-Id: I03eb6b3551e21d6987f15ec236c40546b312e663 Reviewed-on: http://review.couchbase.org/71447 Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com> Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
Python
apache-2.0
pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner,couchbase/perfrunner,couchbase/perfrunner,pavel-paulau/perfrunner
from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY['host']) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main() Update reference to Seriesly hostname Change-Id: I03eb6b3551e21d6987f15ec236c40546b312e663 Reviewed-on: http://review.couchbase.org/71447 Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com> Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>
from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main()
<commit_before>from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY['host']) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main() <commit_msg>Update reference to Seriesly hostname Change-Id: I03eb6b3551e21d6987f15ec236c40546b312e663 Reviewed-on: http://review.couchbase.org/71447 Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com> Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com><commit_after>
from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main()
from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY['host']) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main() Update reference to Seriesly hostname Change-Id: I03eb6b3551e21d6987f15ec236c40546b312e663 Reviewed-on: http://review.couchbase.org/71447 Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com> Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com>from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main()
<commit_before>from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY['host']) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main() <commit_msg>Update reference to Seriesly hostname Change-Id: I03eb6b3551e21d6987f15ec236c40546b312e663 Reviewed-on: http://review.couchbase.org/71447 Reviewed-by: Pavel Paulau <dd88eded64e90046a680e3a6c0828ceb8fe8a0e7@gmail.com> Tested-by: buildbot <80754af91bfb6d1073585b046fe0a474ce868509@couchbase.com><commit_after>from logger import logger from seriesly import Seriesly from perfrunner.settings import StatsSettings def main(): s = Seriesly(StatsSettings.SERIESLY) for db in s.list_dbs(): logger.info('Compacting {}'.format(db)) result = s[db].compact() logger.info('Compaction finished: {}'.format(result)) if __name__ == '__main__': main()
59ec54bbe49013826d2c15ce2162c2e0e335bd57
modules/module_urlsize.py
modules/module_urlsize.py
"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() contentType = getUrl(url).getHeaders()['content-type'] if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType))
"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() headers = getUrl(url).getHeaders()['content-type'] if 'content-type' in headers: contentType = headers['content-type'] else: contentType = "Unknown" if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType))
Handle cases where the server doesn't return content-type
Handle cases where the server doesn't return content-type git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@120 dda364a1-ef19-0410-af65-756c83048fb2
Python
bsd-3-clause
rnyberg/pyfibot,lepinkainen/pyfibot,lepinkainen/pyfibot,rnyberg/pyfibot,EArmour/pyfibot,nigeljonez/newpyfibot,aapa/pyfibot,huqa/pyfibot,huqa/pyfibot,aapa/pyfibot,EArmour/pyfibot
"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() contentType = getUrl(url).getHeaders()['content-type'] if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType)) Handle cases where the server doesn't return content-type git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@120 dda364a1-ef19-0410-af65-756c83048fb2
"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() headers = getUrl(url).getHeaders()['content-type'] if 'content-type' in headers: contentType = headers['content-type'] else: contentType = "Unknown" if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType))
<commit_before>"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() contentType = getUrl(url).getHeaders()['content-type'] if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType)) <commit_msg>Handle cases where the server doesn't return content-type git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@120 dda364a1-ef19-0410-af65-756c83048fb2<commit_after>
"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() headers = getUrl(url).getHeaders()['content-type'] if 'content-type' in headers: contentType = headers['content-type'] else: contentType = "Unknown" if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType))
"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() contentType = getUrl(url).getHeaders()['content-type'] if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType)) Handle cases where the server doesn't return content-type git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@120 dda364a1-ef19-0410-af65-756c83048fb2"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() headers = getUrl(url).getHeaders()['content-type'] if 'content-type' in headers: contentType = headers['content-type'] else: contentType = "Unknown" if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType))
<commit_before>"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() contentType = getUrl(url).getHeaders()['content-type'] if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType)) <commit_msg>Handle cases where the server doesn't return content-type git-svn-id: 056f9092885898c4775d98c479d2d33d00273e45@120 dda364a1-ef19-0410-af65-756c83048fb2<commit_after>"""Warns about large files""" def handle_url(bot, user, channel, url, msg): if channel == "#wow": return # inform about large files (over 5MB) size = getUrl(url).getSize() headers = getUrl(url).getHeaders()['content-type'] if 'content-type' in headers: contentType = headers['content-type'] else: contentType = "Unknown" if not size: return size = size / 1024 if size > 5: bot.say(channel, "File size: %s MB - Content-Type: %s" % (size, contentType))
1c9fc34d3c022d975b986f81d7947564bfc8462e
stock_ownership_availability_rules/model/stock_change_product_qty.py
stock_ownership_availability_rules/model/stock_change_product_qty.py
# -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _finalize_inventory_line(self, data): line_data = super(StockChangeProductQty, self)._finalize_inventory_line(data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data
# -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _prepare_inventory_line(self, inventory_id, data): line_data = super(StockChangeProductQty, self)._prepare_inventory_line(inventory_id, data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data
Update PR regarding hook accepted by Odoo
Update PR regarding hook accepted by Odoo
Python
agpl-3.0
brain-tec/stock-logistics-workflow,brain-tec/stock-logistics-workflow,open-synergy/stock-logistics-workflow,akretion/stock-logistics-workflow,Eficent/stock-logistics-workflow,open-synergy/stock-logistics-workflow,gurneyalex/stock-logistics-workflow,acsone/stock-logistics-workflow,acsone/stock-logistics-workflow,Eficent/stock-logistics-workflow,gurneyalex/stock-logistics-workflow,akretion/stock-logistics-workflow
# -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _finalize_inventory_line(self, data): line_data = super(StockChangeProductQty, self)._finalize_inventory_line(data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data Update PR regarding hook accepted by Odoo
# -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _prepare_inventory_line(self, inventory_id, data): line_data = super(StockChangeProductQty, self)._prepare_inventory_line(inventory_id, data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data
<commit_before># -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _finalize_inventory_line(self, data): line_data = super(StockChangeProductQty, self)._finalize_inventory_line(data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data <commit_msg>Update PR regarding hook accepted by Odoo<commit_after>
# -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _prepare_inventory_line(self, inventory_id, data): line_data = super(StockChangeProductQty, self)._prepare_inventory_line(inventory_id, data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data
# -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _finalize_inventory_line(self, data): line_data = super(StockChangeProductQty, self)._finalize_inventory_line(data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data Update PR regarding hook accepted by Odoo# -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _prepare_inventory_line(self, inventory_id, data): line_data = super(StockChangeProductQty, self)._prepare_inventory_line(inventory_id, data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data
<commit_before># -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _finalize_inventory_line(self, data): line_data = super(StockChangeProductQty, self)._finalize_inventory_line(data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data <commit_msg>Update PR regarding hook accepted by Odoo<commit_after># -*- coding: utf-8 -*- # © 2016 Laetitia Gangloff, Acsone SA/NV (http://www.acsone.eu) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from openerp import api, models class StockChangeProductQty(models.TransientModel): _inherit = "stock.change.product.qty" @api.model def _prepare_inventory_line(self, inventory_id, data): line_data = super(StockChangeProductQty, self)._prepare_inventory_line(inventory_id, data) Company = self.env['res.company'] location = data.location_id line_data['partner_id'] = ( location.partner_id.id or location.company_id.partner_id.id or Company.browse( Company._company_default_get('stock.quant') ).partner_id.id ) return line_data
118033befdee71e77913a736ddf0d349837fe5f4
tests/integration_tests/resources/plugins/target-aware-mock/setup.py
tests/integration_tests/resources/plugins/target-aware-mock/setup.py
from setuptools import setup setup( name='target-aware-mock', version='4.2', packages=['target_aware_mock'], )
from setuptools import setup setup( name='target-aware-mock', version='1.0', packages=['target_aware_mock'], )
Fix test_deploy_with_operation_executor_override by setting back the version of target_aware_mock plugin to 1.0
Fix test_deploy_with_operation_executor_override by setting back the version of target_aware_mock plugin to 1.0
Python
apache-2.0
cloudify-cosmo/cloudify-manager,cloudify-cosmo/cloudify-manager,cloudify-cosmo/cloudify-manager
from setuptools import setup setup( name='target-aware-mock', version='4.2', packages=['target_aware_mock'], ) Fix test_deploy_with_operation_executor_override by setting back the version of target_aware_mock plugin to 1.0
from setuptools import setup setup( name='target-aware-mock', version='1.0', packages=['target_aware_mock'], )
<commit_before>from setuptools import setup setup( name='target-aware-mock', version='4.2', packages=['target_aware_mock'], ) <commit_msg>Fix test_deploy_with_operation_executor_override by setting back the version of target_aware_mock plugin to 1.0<commit_after>
from setuptools import setup setup( name='target-aware-mock', version='1.0', packages=['target_aware_mock'], )
from setuptools import setup setup( name='target-aware-mock', version='4.2', packages=['target_aware_mock'], ) Fix test_deploy_with_operation_executor_override by setting back the version of target_aware_mock plugin to 1.0from setuptools import setup setup( name='target-aware-mock', version='1.0', packages=['target_aware_mock'], )
<commit_before>from setuptools import setup setup( name='target-aware-mock', version='4.2', packages=['target_aware_mock'], ) <commit_msg>Fix test_deploy_with_operation_executor_override by setting back the version of target_aware_mock plugin to 1.0<commit_after>from setuptools import setup setup( name='target-aware-mock', version='1.0', packages=['target_aware_mock'], )
85fa8d64ebbe8cdc0097f0dbdf5e3ab6d094e075
cast_convert/preferences.py
cast_convert/preferences.py
from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-vbr 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'
from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-q:a 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'
USe -q:a flag for mp3 encoder
USe -q:a flag for mp3 encoder
Python
agpl-3.0
thismachinechills/cast_convert
from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-vbr 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'USe -q:a flag for mp3 encoder
from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-q:a 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'
<commit_before>from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-vbr 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'<commit_msg>USe -q:a flag for mp3 encoder<commit_after>
from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-q:a 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'
from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-vbr 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'USe -q:a flag for mp3 encoderfrom multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-q:a 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'
<commit_before>from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-vbr 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'<commit_msg>USe -q:a flag for mp3 encoder<commit_after>from multiprocessing import cpu_count ENCODING_OPTIONS = { 'mp3': '-c:a libmp3lame ' '-q:a 3 ', 'h264': '-c:v libx264 ' '-preset ultrafast ' '-crf 21 ', 'mp4': '-f mp4' } COPY_OPTIONS = { 'audio': '-c:a copy', 'video': '-c:v copy', 'container': '' } THREADS = cpu_count() AUDIO_CODEC = 'mp3' VIDEO_CODEC = 'h264' CONTAINER_TYPE = 'mp4' NEW_FILE_FMT = '%s_castconvert.mp4'
1cb0cb3167a9d641c45d034000a9b0f5202c0dde
preferences/models.py
preferences/models.py
from django.db import models # Create your models here.
from django.db import models from opencivicdata.models.people_orgs import Person class Preferences(models.Model): representitive = models.ForeignKey(Person, related_name='rep_preferences') senator = models.ForeignKey(Person, related_name='sen_preferences') street_line1 = models.CharField(max_length = 100, blank = True) street_line2 = models.CharField(max_length = 100, blank = True) zipcode = models.CharField(max_length = 5, blank = True) city = models.CharField(max_length = 100, blank = True) state = models.CharField(max_length = 100, blank = True)
Add preferences model with address rep and sen
Add preferences model with address rep and sen
Python
mit
jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot,jamesturk/tot
from django.db import models # Create your models here. Add preferences model with address rep and sen
from django.db import models from opencivicdata.models.people_orgs import Person class Preferences(models.Model): representitive = models.ForeignKey(Person, related_name='rep_preferences') senator = models.ForeignKey(Person, related_name='sen_preferences') street_line1 = models.CharField(max_length = 100, blank = True) street_line2 = models.CharField(max_length = 100, blank = True) zipcode = models.CharField(max_length = 5, blank = True) city = models.CharField(max_length = 100, blank = True) state = models.CharField(max_length = 100, blank = True)
<commit_before>from django.db import models # Create your models here. <commit_msg>Add preferences model with address rep and sen<commit_after>
from django.db import models from opencivicdata.models.people_orgs import Person class Preferences(models.Model): representitive = models.ForeignKey(Person, related_name='rep_preferences') senator = models.ForeignKey(Person, related_name='sen_preferences') street_line1 = models.CharField(max_length = 100, blank = True) street_line2 = models.CharField(max_length = 100, blank = True) zipcode = models.CharField(max_length = 5, blank = True) city = models.CharField(max_length = 100, blank = True) state = models.CharField(max_length = 100, blank = True)
from django.db import models # Create your models here. Add preferences model with address rep and senfrom django.db import models from opencivicdata.models.people_orgs import Person class Preferences(models.Model): representitive = models.ForeignKey(Person, related_name='rep_preferences') senator = models.ForeignKey(Person, related_name='sen_preferences') street_line1 = models.CharField(max_length = 100, blank = True) street_line2 = models.CharField(max_length = 100, blank = True) zipcode = models.CharField(max_length = 5, blank = True) city = models.CharField(max_length = 100, blank = True) state = models.CharField(max_length = 100, blank = True)
<commit_before>from django.db import models # Create your models here. <commit_msg>Add preferences model with address rep and sen<commit_after>from django.db import models from opencivicdata.models.people_orgs import Person class Preferences(models.Model): representitive = models.ForeignKey(Person, related_name='rep_preferences') senator = models.ForeignKey(Person, related_name='sen_preferences') street_line1 = models.CharField(max_length = 100, blank = True) street_line2 = models.CharField(max_length = 100, blank = True) zipcode = models.CharField(max_length = 5, blank = True) city = models.CharField(max_length = 100, blank = True) state = models.CharField(max_length = 100, blank = True)
2a34baee8a33c01fcb253cb336144a570c32d5fa
digits/utils/lmdbreader.py
digits/utils/lmdbreader.py
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] self.txn = self._db.begin() def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item def entry(self, key): """Return single entry""" return self.txn.get(key)
Add API to LmdbReader (used by gan_features.py)
Add API to LmdbReader (used by gan_features.py)
Python
bsd-3-clause
ethantang95/DIGITS-GAN,gheinrich/DIGITS-GAN,ethantang95/DIGITS-GAN,gheinrich/DIGITS-GAN,gheinrich/DIGITS-GAN,gheinrich/DIGITS-GAN,ethantang95/DIGITS-GAN,ethantang95/DIGITS-GAN
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item Add API to LmdbReader (used by gan_features.py)
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] self.txn = self._db.begin() def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item def entry(self, key): """Return single entry""" return self.txn.get(key)
<commit_before># Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item <commit_msg>Add API to LmdbReader (used by gan_features.py)<commit_after>
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] self.txn = self._db.begin() def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item def entry(self, key): """Return single entry""" return self.txn.get(key)
# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item Add API to LmdbReader (used by gan_features.py)# Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] self.txn = self._db.begin() def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item def entry(self, key): """Return single entry""" return self.txn.get(key)
<commit_before># Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item <commit_msg>Add API to LmdbReader (used by gan_features.py)<commit_after># Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import import lmdb class DbReader(object): """ Reads a database """ def __init__(self, location): """ Arguments: location -- where is the database """ self._db = lmdb.open( location, map_size=1024**3, # 1MB readonly=True, lock=False) with self._db.begin() as txn: self.total_entries = txn.stat()['entries'] self.txn = self._db.begin() def entries(self): """ Generator returning all entries in the DB """ with self._db.begin() as txn: cursor = txn.cursor() for item in cursor: yield item def entry(self, key): """Return single entry""" return self.txn.get(key)
24194cc6d7b4248e3eb10535be43f5bb01f41fe7
eratosthenes_lambda.py
eratosthenes_lambda.py
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, "headers": {"Content-Type": "application/json"}, "body": "{\"durationSeconds\": " + str(durationSeconds) + ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"}
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, \ "headers": {"Content-Type": "application/json"}, \ "body": "{\"durationSeconds\": " + str(durationSeconds) + \ ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"}
Reformat for easier copy and pasting (needed for usability with AWS Console).
Reformat for easier copy and pasting (needed for usability with AWS Console).
Python
mit
jconning/lambda-cpu-cost,jconning/lambda-cpu-cost
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, "headers": {"Content-Type": "application/json"}, "body": "{\"durationSeconds\": " + str(durationSeconds) + ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"} Reformat for easier copy and pasting (needed for usability with AWS Console).
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, \ "headers": {"Content-Type": "application/json"}, \ "body": "{\"durationSeconds\": " + str(durationSeconds) + \ ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"}
<commit_before>from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, "headers": {"Content-Type": "application/json"}, "body": "{\"durationSeconds\": " + str(durationSeconds) + ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"} <commit_msg>Reformat for easier copy and pasting (needed for usability with AWS Console).<commit_after>
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, \ "headers": {"Content-Type": "application/json"}, \ "body": "{\"durationSeconds\": " + str(durationSeconds) + \ ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"}
from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, "headers": {"Content-Type": "application/json"}, "body": "{\"durationSeconds\": " + str(durationSeconds) + ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"} Reformat for easier copy and pasting (needed for usability with AWS Console).from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, \ "headers": {"Content-Type": "application/json"}, \ "body": "{\"durationSeconds\": " + str(durationSeconds) + \ ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"}
<commit_before>from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, "headers": {"Content-Type": "application/json"}, "body": "{\"durationSeconds\": " + str(durationSeconds) + ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"} <commit_msg>Reformat for easier copy and pasting (needed for usability with AWS Console).<commit_after>from __future__ import print_function from timeit import default_timer as timer import json import datetime print('Loading function') def eratosthenes(n): sieve = [ True for i in range(n+1) ] def markOff(pv): for i in range(pv+pv, n+1, pv): sieve[i] = False markOff(2) for i in range(3, n+1): if sieve[i]: markOff(i) return [ i for i in range(1, n+1) if sieve[i] ] def lambda_handler(event, context): start = timer() #print("Received event: " + json.dumps(event, indent=2)) maxPrime = int(event['queryStringParameters']['max']) numLoops = int(event['queryStringParameters']['loops']) print("looping " + str(numLoops) + " time(s)") for loop in range (0, numLoops): primes = eratosthenes(maxPrime) print("Highest 3 primes: " + str(primes.pop()) + ", " + str(primes.pop()) + ", " + str(primes.pop())) durationSeconds = timer() - start return {"statusCode": 200, \ "headers": {"Content-Type": "application/json"}, \ "body": "{\"durationSeconds\": " + str(durationSeconds) + \ ", \"max\": " + str(maxPrime) + ", \"loops\": " + str(numLoops) + "}"}
318781bca1973f34d3a6b00b5b9253cef5190f58
skimage/io/tests/test_io.py
skimage/io/tests/test_io.py
import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) if __name__ == "__main__": run_module_suite()
import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage.io._plugins.plugin import plugin_store from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) @raises(RuntimeError) def test_imread_no_plugin(): # tweak data path so that file URI works on both unix and windows. image_path = os.path.join(data_dir, 'lena.png') plugin_store['imread'] = [] io.imread(image_path) if __name__ == "__main__": run_module_suite()
Add test that error gets raised when no plugin available
Add test that error gets raised when no plugin available
Python
bsd-3-clause
bsipocz/scikit-image,emon10005/scikit-image,SamHames/scikit-image,GaZ3ll3/scikit-image,chintak/scikit-image,robintw/scikit-image,warmspringwinds/scikit-image,bennlich/scikit-image,ajaybhat/scikit-image,pratapvardhan/scikit-image,blink1073/scikit-image,michaelpacer/scikit-image,chintak/scikit-image,vighneshbirodkar/scikit-image,rjeli/scikit-image,youprofit/scikit-image,pratapvardhan/scikit-image,Hiyorimi/scikit-image,bennlich/scikit-image,oew1v07/scikit-image,keflavich/scikit-image,michaelpacer/scikit-image,rjeli/scikit-image,michaelaye/scikit-image,newville/scikit-image,ofgulban/scikit-image,paalge/scikit-image,oew1v07/scikit-image,jwiggins/scikit-image,rjeli/scikit-image,newville/scikit-image,chriscrosscutler/scikit-image,vighneshbirodkar/scikit-image,chintak/scikit-image,keflavich/scikit-image,paalge/scikit-image,SamHames/scikit-image,GaZ3ll3/scikit-image,juliusbierk/scikit-image,dpshelio/scikit-image,chriscrosscutler/scikit-image,jwiggins/scikit-image,juliusbierk/scikit-image,paalge/scikit-image,warmspringwinds/scikit-image,Hiyorimi/scikit-image,WarrenWeckesser/scikits-image,SamHames/scikit-image,Midafi/scikit-image,emon10005/scikit-image,blink1073/scikit-image,michaelaye/scikit-image,ClinicalGraphics/scikit-image,bsipocz/scikit-image,robintw/scikit-image,Midafi/scikit-image,Britefury/scikit-image,WarrenWeckesser/scikits-image,dpshelio/scikit-image,vighneshbirodkar/scikit-image,ofgulban/scikit-image,ajaybhat/scikit-image,youprofit/scikit-image,SamHames/scikit-image,ClinicalGraphics/scikit-image,chintak/scikit-image,Britefury/scikit-image,ofgulban/scikit-image
import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) if __name__ == "__main__": run_module_suite() Add test that error gets raised when no plugin available
import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage.io._plugins.plugin import plugin_store from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) @raises(RuntimeError) def test_imread_no_plugin(): # tweak data path so that file URI works on both unix and windows. image_path = os.path.join(data_dir, 'lena.png') plugin_store['imread'] = [] io.imread(image_path) if __name__ == "__main__": run_module_suite()
<commit_before>import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) if __name__ == "__main__": run_module_suite() <commit_msg>Add test that error gets raised when no plugin available<commit_after>
import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage.io._plugins.plugin import plugin_store from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) @raises(RuntimeError) def test_imread_no_plugin(): # tweak data path so that file URI works on both unix and windows. image_path = os.path.join(data_dir, 'lena.png') plugin_store['imread'] = [] io.imread(image_path) if __name__ == "__main__": run_module_suite()
import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) if __name__ == "__main__": run_module_suite() Add test that error gets raised when no plugin availableimport os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage.io._plugins.plugin import plugin_store from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) @raises(RuntimeError) def test_imread_no_plugin(): # tweak data path so that file URI works on both unix and windows. image_path = os.path.join(data_dir, 'lena.png') plugin_store['imread'] = [] io.imread(image_path) if __name__ == "__main__": run_module_suite()
<commit_before>import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) if __name__ == "__main__": run_module_suite() <commit_msg>Add test that error gets raised when no plugin available<commit_after>import os from numpy.testing import assert_array_equal, raises, run_module_suite import numpy as np import skimage.io as io from skimage.io._plugins.plugin import plugin_store from skimage import data_dir def test_stack_basic(): x = np.arange(12).reshape(3, 4) io.push(x) assert_array_equal(io.pop(), x) @raises(ValueError) def test_stack_non_array(): io.push([[1, 2, 3]]) def test_imread_url(): # tweak data path so that file URI works on both unix and windows. data_path = data_dir.lstrip(os.path.sep) data_path = data_path.replace(os.path.sep, '/') image_url = 'file:///{0}/camera.png'.format(data_path) image = io.imread(image_url) assert image.shape == (512, 512) @raises(RuntimeError) def test_imread_no_plugin(): # tweak data path so that file URI works on both unix and windows. image_path = os.path.join(data_dir, 'lena.png') plugin_store['imread'] = [] io.imread(image_path) if __name__ == "__main__": run_module_suite()
1ba12783fca76247447d84013d91f5c3073386a4
web_scraper/core/html_fetchers.py
web_scraper/core/html_fetchers.py
import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url): """Fetch html from url and return html :param str url: an address to a resource on the Internet :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err
import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url, user_agent='python_requests.cli-ws'): """Fetch html from url and return html :param str url: an address to a resource on the Internet :opt param str user_agent: user agent that the request will be made with :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url, headers={'User-Agent': user_agent}) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err
Add user-agent field to html_fetcher
Add user-agent field to html_fetcher
Python
mit
Samuel-L/cli-ws,Samuel-L/cli-ws
import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url): """Fetch html from url and return html :param str url: an address to a resource on the Internet :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err Add user-agent field to html_fetcher
import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url, user_agent='python_requests.cli-ws'): """Fetch html from url and return html :param str url: an address to a resource on the Internet :opt param str user_agent: user agent that the request will be made with :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url, headers={'User-Agent': user_agent}) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err
<commit_before>import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url): """Fetch html from url and return html :param str url: an address to a resource on the Internet :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err <commit_msg>Add user-agent field to html_fetcher<commit_after>
import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url, user_agent='python_requests.cli-ws'): """Fetch html from url and return html :param str url: an address to a resource on the Internet :opt param str user_agent: user agent that the request will be made with :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url, headers={'User-Agent': user_agent}) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err
import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url): """Fetch html from url and return html :param str url: an address to a resource on the Internet :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err Add user-agent field to html_fetcherimport os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url, user_agent='python_requests.cli-ws'): """Fetch html from url and return html :param str url: an address to a resource on the Internet :opt param str user_agent: user agent that the request will be made with :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url, headers={'User-Agent': user_agent}) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err
<commit_before>import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url): """Fetch html from url and return html :param str url: an address to a resource on the Internet :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err <commit_msg>Add user-agent field to html_fetcher<commit_after>import os import sys sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) import requests def fetch_html_document(url, user_agent='python_requests.cli-ws'): """Fetch html from url and return html :param str url: an address to a resource on the Internet :opt param str user_agent: user agent that the request will be made with :return no except hit: status code and html of page (if exists) :rtype: tuple :return except hit: error :rtype: str """ try: response = requests.get(url, headers={'User-Agent': user_agent}) if response.status_code == requests.codes.ok: return response.status_code, response.text # html else: return response.status_code, response.text except Exception as err: return err
a8f4f7a3d3ecc88a8517221437f1e7b14b3f0a1d
seimas/prototype/helpers.py
seimas/prototype/helpers.py
import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = os.path.join('seimas', 'website') candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if os.path.exists(os.path.join(base, 'templates', template)): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls
import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = settings.PROJECT_DIR / 'seimas/website' candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if (base / 'templates' / template).exists(): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls
Fix prototype template loading error
Fix prototype template loading error
Python
agpl-3.0
sirex/manopozicija.lt,sirex/nuomones,sirex/manopozicija.lt,sirex/nuomones,sirex/manopozicija.lt
import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = os.path.join('seimas', 'website') candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if os.path.exists(os.path.join(base, 'templates', template)): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls Fix prototype template loading error
import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = settings.PROJECT_DIR / 'seimas/website' candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if (base / 'templates' / template).exists(): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls
<commit_before>import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = os.path.join('seimas', 'website') candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if os.path.exists(os.path.join(base, 'templates', template)): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls <commit_msg>Fix prototype template loading error<commit_after>
import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = settings.PROJECT_DIR / 'seimas/website' candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if (base / 'templates' / template).exists(): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls
import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = os.path.join('seimas', 'website') candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if os.path.exists(os.path.join(base, 'templates', template)): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls Fix prototype template loading errorimport yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = settings.PROJECT_DIR / 'seimas/website' candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if (base / 'templates' / template).exists(): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls
<commit_before>import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = os.path.join('seimas', 'website') candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if os.path.exists(os.path.join(base, 'templates', template)): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open() as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls <commit_msg>Fix prototype template loading error<commit_after>import yaml import os.path from django.http import Http404 from django.conf.urls import url from django.conf import settings def get_page(path): url = ('/%s/' % path) if path else '/' with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) try: page = data['urls'][url] or { 'context': {}, } except KeyError: raise Http404("Requested %s page not found." % url) if 'globals' in data and page.get('type', 'html') == 'html': page['context'] = dict(data['globals'], **page.get('context', {})) return page def get_template(path): base = settings.PROJECT_DIR / 'seimas/website' candidates = [ os.path.join(path, 'index.html'), '%s.html' % path, ] for template in candidates: if (base / 'templates' / template).exists(): return template def get_urls(view): with (settings.PROJECT_DIR / 'prototype.yml').open(encoding='utf-8') as f: data = yaml.load(f) urls = [] for path, page in data['urls'].items(): if page and 'name' in page: pattern = r'^%s$' % path.lstrip('/') kwargs = {'path': path.strip('/')} urls.append(url(pattern, view, kwargs, name=page['name'])) return urls
71105218d25c8a415d23afa24808f46364eef88d
run_api.py
run_api.py
import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=True, host='0.0.0.0', port=4242) print("Running app on port {}".format(4242))
import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=False, host='0.0.0.0', port=4243) print("Running app on port {}".format(4243))
Change port to enable export
Change port to enable export
Python
mit
meerkat-cv/annotator-supreme,meerkat-cv/annotator-supreme,meerkat-cv/annotator-supreme,meerkat-cv/annotator-supreme,meerkat-cv/annotator-supreme
import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=True, host='0.0.0.0', port=4242) print("Running app on port {}".format(4242)) Change port to enable export
import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=False, host='0.0.0.0', port=4243) print("Running app on port {}".format(4243))
<commit_before>import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=True, host='0.0.0.0', port=4242) print("Running app on port {}".format(4242)) <commit_msg>Change port to enable export<commit_after>
import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=False, host='0.0.0.0', port=4243) print("Running app on port {}".format(4243))
import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=True, host='0.0.0.0', port=4242) print("Running app on port {}".format(4242)) Change port to enable exportimport annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=False, host='0.0.0.0', port=4243) print("Running app on port {}".format(4243))
<commit_before>import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=True, host='0.0.0.0', port=4242) print("Running app on port {}".format(4242)) <commit_msg>Change port to enable export<commit_after>import annotator_supreme if __name__ == "__main__": app = annotator_supreme.build_app() app.run(debug=False, host='0.0.0.0', port=4243) print("Running app on port {}".format(4243))
2979986e68d2b8c2b3fb4090e258a941d6a56d9e
tests/test_website_flow.py
tests/test_website_flow.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!'
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' def test_404_comes_out_404(harness): harness.fs.project.mk(('404.html.spt', 'Eep!')) assert harness.client.GET(raise_immediately=False).code == 404
Add failing test for exception handling regression
Add failing test for exception handling regression Code coming out of custom error message needs to be the code expected.
Python
mit
gratipay/aspen.py,gratipay/aspen.py
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' Add failing test for exception handling regression Code coming out of custom error message needs to be the code expected.
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' def test_404_comes_out_404(harness): harness.fs.project.mk(('404.html.spt', 'Eep!')) assert harness.client.GET(raise_immediately=False).code == 404
<commit_before>from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' <commit_msg>Add failing test for exception handling regression Code coming out of custom error message needs to be the code expected.<commit_after>
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' def test_404_comes_out_404(harness): harness.fs.project.mk(('404.html.spt', 'Eep!')) assert harness.client.GET(raise_immediately=False).code == 404
from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' Add failing test for exception handling regression Code coming out of custom error message needs to be the code expected.from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' def test_404_comes_out_404(harness): harness.fs.project.mk(('404.html.spt', 'Eep!')) assert harness.client.GET(raise_immediately=False).code == 404
<commit_before>from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' <commit_msg>Add failing test for exception handling regression Code coming out of custom error message needs to be the code expected.<commit_after>from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals def test_website_can_respond(harness): harness.fs.www.mk(('index.html.spt', 'Greetings, program!')) assert harness.client.GET().body == 'Greetings, program!' def test_404_comes_out_404(harness): harness.fs.project.mk(('404.html.spt', 'Eep!')) assert harness.client.GET(raise_immediately=False).code == 404