aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/gmg_commands
Commit message (Collapse)AuthorAgeFilesLines
* Fix some unused imports and local variables.Ben Sturmfels2021-09-234-8/+3
|
* Apply pyupgrade --py36-plus.Ben Sturmfels2021-09-233-8/+8
| | | | This removes some 'u' prefixes and converts simple format() calls to f-strings.
* Implement `gmg serve` and `gmg celery`.Ben Sturmfels2021-09-173-25/+65
| | | | | | | There was an existing stub for `gmg serve`, but had never been completed. This will make it simpler to run the MediaGoblin web interface and media processing backend.
* Remove remaining imports/calls to six not automatically removed by pyupgrade.Ben Sturmfels2021-03-056-19/+2
|
* Apply `pyupgrade --py3-plus` to remove Python 2 compatibility code.Ben Sturmfels2021-03-0511-58/+52
|
* Add basic duplicate prevention for batchaddmedia.Ben Sturmfels2019-09-181-3/+18
|
* batchaddmedia: Simplify the Python 2 & 3 unicode handling.Ben Sturmfels2019-09-121-59/+12
| | | | | | | | | To avoid issues with quotes, I've replaced the manual CSV handling with csv.DictReader and simplified the unicode handling down to a single line. I don't believe any special encoding is required when writing to the database. This has been tested by importing a CSV with braille characters on Python 3 and Python 2.
* Remove unicode literals in batchaddmedia.Ben Sturmfels2019-09-121-13/+13
|
* Fix URL-based importing with batchaddmedia command.Ben Sturmfels2019-09-121-2/+18
| | | | | The command was raising "io.UnsupportedOperation: seek" for URL-based imports and didn't support HTTPS.
* fix default gmg help messageBoris Bobrov2018-07-111-1/+4
|
* Port batchaddmedia command to Python 3Simen Heggestøyl2017-10-161-3/+9
|
* Handle collection in batchaddmedia commandSimen Heggestøyl2017-10-161-0/+2
| | | | | | | Make the batchaddmedia command look for a 'collection-slug' column, that for each row may specify the slug of a collection that the media should be added to. This matches the '--collection-slug' argument of the addmedia command.
* Remove dead code in batchaddmedia.pySimen Heggestøyl2017-10-161-4/+1
| | | | | Remove an unused import and an unused local variable from batchaddmedia.py.
* Commit session after alembic updates have finishedBoris Bobrov2017-04-011-2/+4
| | | | | | | | | | After alembic updates we need to add foundations. The tables to add foundations to are created as part of dbupdate process. For some reason Alembic doesn't commit a session in the end. Because the session is not commited, the tables do not really get created. And because of that, foundations fail. The solution is to commit the session after alembic updates.
* Fix trivial spelling and spacing error in cli helpAndrew Browning2017-03-011-2/+2
|
* Merge remote-tracking branch 'spechards-mediagoblin/master'Boris Bobrov2017-01-291-0/+6
|\ | | | | | | | | | | | | | | Conflicts: mediagoblin/submit/lib.py -- happened because of creator->actor change Fixes issue #915
| * Add collection option to 'addmedia' cli uploadingStéphane Péchard2014-07-131-0/+6
| |
* | Fix #928 - cleanup to avoid duplicated get_upload_file_limitsLoic Dachary2016-07-252-8/+2
| | | | | | | | Signed-off-by: Loic Dachary <loic@dachary.org>
* | Replace raw_input with six.moves.inputBerker Peksag2016-04-021-1/+3
| | | | | | | | Fixes #5441
* | dbupdate: Correctly handle plugin foundationsChristopher Allan Webber2016-03-261-1/+1
| | | | | | | | | | | | | | * mediagoblin/gmg_commands/dbupdate.py (run_foundations): When adding a plugin's foundations, correctly append both the name and the foundations in a tuple to the list. This prevents errors.
* | Removing erronously installed print statement.Christopher Allan Webber2016-03-261-1/+0
| | | | | | | | | | * mediagoblin/gmg_commands/alembic_commands.py (FudgedCommandLine.main): Removed call to print.
* | Allow for passing in --with-plugins to the alembic gmg subcommand.Christopher Allan Webber2016-03-261-0/+19
| | | | | | | | | | | | | | | | | | This allows plugin writers to easily take advantage off alembic's migration autogeneration support. * mediagoblin/gmg_commands/alembic_commands.py: Adjusted imports. (FudgedCommandLine.main, parser_setup): Add support for importing plugins when --with-plugins is passed in.
* | Only run sqlalchemy-migrate migrations if we have to; separate foundationsChristopher Allan Webber2016-03-261-22/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The goal is to get things to the point where Alembic can run on its own for new databases and initialize the whole database on its own. There are risks to not doing so, see #5413 for details. There's a lot more here that could removed or cleaned up once sqlalchemy-migrate is *completely* removed in the future. * mediagoblin/db/migration_tools.py (MigrationManager.foundations): Removed attribute. (MigrationManager.populate_table_foundations): Removed method. (MigrationManager.init_or_migrate): Removed call to deprecated method. (populate_table_foundations): New function, refactored from former MigrationManager method of same name. * mediagoblin/gmg_commands/dbupdate.py: Import populate_table_foundations. (DatabaseData.foundations): Remove attribute. (DatabaseData.make_migration_manager): Adjust instantiation of MigrationManager. (gather_database_data): Move out the work of building up foundations data. (run_foundations): New method, incorporating logic for gathering and running foundations which was previously spread across other functions and methods. (run_alembic_migrations): Remove deprecated comment. (run_dbupdate): Only run sqlalchemy migrations if we have to. Also run run_foundations if we are setting up this database for the first time. (sqam_migrations_to_run): New method.
* | dbupdate updates to use plugin migrations if availableChristopher Allan Webber2016-03-261-3/+12
| | | | | | | | | | | | | | | | | | This makes use of the recently added "build_alembic_config" tool and removes AlembicMigrationManager. * mediagoblin/db/migration_tools.py (AlembicMigrationManager): Removed. * mediagoblin/gmg_commands/dbupdate.py (run_alembic_migrations): Adjusted to use recently added build_alembic_config tool.
* | Add build_alembic_config, use it to add plugin migrations to alembic configChristopher Allan Webber2016-03-261-9/+6
| |
* | Fix module name for `gmg alembic` commandBoris Bobrov2016-03-082-2/+2
| | | | | | | | | | | | | | | | gmg_commands.alembic attempted to import from `alembic`. On python2.7 it resulted in import from itself. Rename alembic.py to alembic_commands.py and fix references to gmg_commands.alembic.
* | Commentary on where this hack on detecting no subcommand to Alembic comes fromChristopher Allan Webber2016-03-051-0/+2
| |
* | Add "gmg raw_alembic" command.Christopher Allan Webber2016-03-032-0/+60
| | | | | | | | | | This allows you to dispatch to the "alembic" command line tool properly, but properly respecting MediaGoblin's own configuration.
* | Switch from Paste for serving to WaitressChristopher Allan Webber2016-02-191-1/+0
| | | | | | | | | | Incredibly, it looks like none of our documentation has to change taking this route...!
* | Add a TODO to rename run_all_migrations to run_legacy_migrationsChristopher Allan Webber2016-01-111-0/+1
| |
* | Enable alembic as the main tool for migrationsBoris Bobrov2016-01-111-2/+1
| | | | | | | | | | | | Enable alembic for all migrations and limit the max number of sqlalchemy-migration migration. All new migrations must now be in Alembic!
* | Fix various style issuesBoris Bobrov2016-01-111-11/+13
| | | | | | | | Sorry, cannot look at them without urge to fix
* | Prevent unhandled exception on non-existant user.Ben Sturmfels2015-11-051-13/+15
| | | | | | | | | | | | These changes bring `makeadmin` and `changepw` in-line with the approach used in `deleteuser`. I've also made the error messages more consistent: list the username and full sentences.
* | Collection changes and migration for federationJessica Tallon2015-10-071-1/+0
| | | | | | | | | | | | | | - Adds a "type" column to the Collection object and allows the CollectionItem model to contain any object. - Changes "items" to "num_items" as per TODO - Renames "uploader", "creator" and "user" to a common "actor" in most places
* | Fix some unit tests and bugsJessica Tallon2015-08-243-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a lot of the issues with the LocalUser changes that were merged recently. There was a problem where the attributes of LocalUser were not being eagerly loaded and because the Session was detached an exception was being raised when they were accessed. This also fixes some typo's which were introduced. Finally this adds a temporary fix for a potential SQLAlchemy bug, this is a bug where doing: User.query.filter(LocalUser.username == "some_username").first() does NOT yeild a user with the username "some_username" but all users on the site. The temp fix is to just query the LocalUser, this should be resolved when bug is confirmed and fixed upstream.
* | Change codebase to query or create correct User modelJessica Tallon2015-07-313-10/+21
| | | | | | | | | | | | | | The code base had many references to User.username and other specific to LocalUser attributes as that was the way it use to exist. This updates those to query on the generic User model but filtering by attributes on the LocalUser.
* | Return non-zero exit code if the command cannot be completed successfully.Berker Peksag2015-07-221-0/+6
| | | | | | | | Fixes #5084
* | Change all unicode() calls with six.text_type().Berker Peksag2015-06-252-2/+3
| | | | | | | | Fixes #5329.
* | Let parser handle typing for deletuser commandJessica Tallon2015-01-201-3/+3
| |
* | Context objects now use a contextmanager (and update gmg shell to use it)Christopher Allan Webber2014-12-031-9/+10
| | | | | | | | | | | | | | | | | | This means that we have a really convenient way to make sure that you have a context/request that threads its way through the application, where everything needed gets "shut down" appropriately by the end. You always get a context object via a context manager! And by the time you're done with it, things should be cleaned up.
* | Make "gmg shell" work with the new globals-less setupChristopher Allan Webber2014-12-031-17/+36
| |
* | This import_export stuff is mongodb days leftovers. Removing!Christopher Allan Webber2014-11-262-270/+0
| | | | | | | | This commit sponsored by Ray Redd. Thanks!
* | Fix unicode handling in "gmg addmedia".Berker Peksag2014-11-221-3/+4
| |
* | Make a mediagoblin.ini file for the user if needed.Christopher Allan Webber2014-10-101-0/+26
| | | | | | | | | | This is to prevent our docs from confusing people in this transitionary time period...
* | Port "gmg batchaddmedia" command to Python 3.Berker Peksag2014-10-021-20/+26
| |
* | Switch print statement to print functionChristopher Allan Webber2014-09-241-1/+1
| |
* | Making alembic happen with python 3 only... for now.Christopher Allan Webber2014-09-221-1/+6
| | | | | | | | We want to make sure it works nicely first.
* | Merge branch 'merge-python3-port'Christopher Allan Webber2014-09-227-46/+138
|\ \ | | | | | | | | | | | | Conflicts: setup.py
| * | Merge branch 'master' into merge-python3-portChristopher Allan Webber2014-09-164-3/+242
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Has some issues, will iteratively fix! Conflicts: mediagoblin/gmg_commands/__init__.py mediagoblin/gmg_commands/deletemedia.py mediagoblin/gmg_commands/users.py mediagoblin/oauth/views.py mediagoblin/plugins/api/views.py mediagoblin/tests/test_api.py mediagoblin/tests/test_edit.py mediagoblin/tests/test_oauth1.py mediagoblin/tests/test_util.py mediagoblin/tools/mail.py mediagoblin/webfinger/views.py setup.py
| * | Implement ServeCommand.{loadserver, loadapp}.Berker Peksag2014-08-151-4/+7
| | | | | | | | | | | | This is partly port from PasteScript.