Skip to content

Instantly share code, notes, and snippets.

@smitmartijn
Created December 27, 2021 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smitmartijn/b371220fb1f07663957a7b71ffbd7524 to your computer and use it in GitHub Desktop.
Save smitmartijn/b371220fb1f07663957a7b71ffbd7524 to your computer and use it in GitHub Desktop.
More complete font awesome v4 to v5 migration
import os
from collections import OrderedDict
findreplace = [
('fa fa-500px', 'fab fa-500px'),
('fa fa-address-book-o', 'far fa-address-book'),
('fa fa-address-card-o', 'far fa-address-card'),
('fa fa-adn', 'fab fa-adn'),
('fa fa-amazon', 'fab fa-amazon'),
('fa fa-android', 'fab fa-android'),
('fa fa-angellist', 'fab fa-angellist'),
('fa fa-apple', 'fab fa-apple'),
('fa fa-area-chart', 'fas fa-chart-area'),
('fa fa-arrow-circle-o-down', 'far fa-arrow-alt-circle-down'),
('fa fa-arrow-circle-o-left', 'far fa-arrow-alt-circle-left'),
('fa fa-arrow-circle-o-right', 'far fa-arrow-alt-circle-right'),
('fa fa-arrow-circle-o-up', 'far fa-arrow-alt-circle-up'),
('fa fa-arrows-alt', 'fas fa-expand-arrows-alt'),
('fa fa-arrows-h', 'fas fa-arrows-alt-h'),
('fa fa-arrows-v', 'fas fa-arrows-alt-v'),
('fa fa-arrows', 'fas fa-arrows-alt'),
('fa fa-asl-interpreting', 'fas fa-american-sign-language-interpreting'),
('fa fa-automobile', 'fas fa-car'),
('fa fa-bandcamp', 'fab fa-bandcamp'),
('fa fa-bank', 'fas fa-university'),
('fa fa-bar-chart-o', 'far fa-chart-bar'),
('fa fa-bar-chart', 'far fa-chart-bar'),
('fa fa-bathtub', 'fas fa-bath'),
('fa fa-battery-0', 'fas fa-battery-empty'),
('fa fa-battery-1', 'fas fa-battery-quarter'),
('fa fa-battery-2', 'fas fa-battery-half'),
('fa fa-battery-3', 'fas fa-battery-three-quarters'),
('fa fa-battery-4', 'fas fa-battery-full'),
('fa fa-battery', 'fas fa-battery-full'),
('fa fa-behance', 'fab fa-behance'),
('fa fa-behance-square', 'fab fa-behance-square'),
('fa fa-bell-o', 'far fa-bell'),
('fa fa-bell-slash-o', 'far fa-bell-slash'),
('fa fa-bitbucket-square', 'fab fa-bitbucket'),
('fa fa-bitbucket', 'fab fa-bitbucket'),
('fa fa-bitcoin', 'fab fa-btc'),
('fa fa-black-tie', 'fab fa-black-tie'),
('fa fa-bluetooth-b', 'fab fa-bluetooth-b'),
('fa fa-bluetooth', 'fab fa-bluetooth'),
('fa fa-bookmark-o', 'far fa-bookmark'),
('fa fa-btc', 'fab fa-btc'),
('fa fa-building-o', 'far fa-building'),
('fa fa-buysellads', 'fab fa-buysellads'),
('fa fa-cab', 'fas fa-taxi'),
('fa fa-calendar-check-o', 'far fa-calendar-check'),
('fa fa-calendar-minus-o', 'far fa-calendar-minus'),
('fa fa-calendar-o', 'far fa-calendar'),
('fa fa-calendar-plus-o', 'far fa-calendar-plus'),
('fa fa-calendar-times-o', 'far fa-calendar-times'),
('fa fa-calendar', 'fas fa-calendar-alt'),
('fa fa-caret-square-o-down', 'far fa-caret-square-down'),
('fa fa-caret-square-o-left', 'far fa-caret-square-left'),
('fa fa-caret-square-o-right', 'far fa-caret-square-right'),
('fa fa-caret-square-o-up', 'far fa-caret-square-up'),
('fa fa-cc-amex', 'fab fa-cc-amex'),
('fa fa-cc-diners-club', 'fab fa-cc-diners-club'),
('fa fa-cc-discover', 'fab fa-cc-discover'),
('fa fa-cc-jcb', 'fab fa-cc-jcb'),
('fa fa-cc-mastercard', 'fab fa-cc-mastercard'),
('fa fa-cc-paypal', 'fab fa-cc-paypal'),
('fa fa-cc-stripe', 'fab fa-cc-stripe'),
('fa fa-cc-visa', 'fab fa-cc-visa'),
('fa fa-cc', 'far fa-closed-captioning'),
('fa fa-chain-broken', 'fas fa-unlink'),
('fa fa-chain', 'fas fa-link'),
('fa fa-check-circle-o', 'far fa-check-circle'),
('fa fa-check-square-o', 'far fa-check-square'),
('fa fa-chrome', 'fab fa-chrome'),
('fa fa-circle-o-notch', 'fas fa-circle-notch'),
('fa fa-circle-o', 'far fa-circle'),
('fa fa-circle-thin', 'far fa-circle'),
('fa fa-clipboard', 'far fa-clipboard'),
('fa fa-clock-o', 'far fa-clock'),
('fa fa-clone', 'far fa-clone'),
('fa fa-close', 'fas fa-times'),
('fa fa-cloud-download', 'fas fa-cloud-download-alt'),
('fa fa-cloud-upload', 'fas fa-cloud-upload-alt'),
('fa fa-cny', 'fas fa-yen-sign'),
('fa fa-code-fork', 'fas fa-code-branch'),
('fa fa-codepen', 'fab fa-codepen'),
('fa fa-codiepie', 'fab fa-codiepie'),
('fa fa-comment-o', 'far fa-comment'),
('fa fa-commenting-o', 'far fa-comment-dots'),
('fa fa-commenting', 'fas fa-comment-dots'),
('fa fa-comments-o', 'far fa-comments'),
('fa fa-compass', 'far fa-compass'),
('fa fa-connectdevelop', 'fab fa-connectdevelop'),
('fa fa-contao', 'fab fa-contao'),
('fa fa-copyright', 'far fa-copyright'),
('fa fa-creative-commons', 'fab fa-creative-commons'),
('fa fa-credit-card-alt', 'fas fa-credit-card'),
('fa fa-credit-card', 'far fa-credit-card'),
('fa fa-css3', 'fab fa-css3'),
('fa fa-cutlery', 'fas fa-utensils'),
('fa fa-dashboard', 'fas fa-tachometer-alt'),
('fa fa-dashcube', 'fab fa-dashcube'),
('fa fa-deafness', 'fas fa-deaf'),
('fa fa-dedent', 'fas fa-outdent'),
('fa fa-delicious', 'fab fa-delicious'),
('fa fa-deviantart', 'fab fa-deviantart'),
('fa fa-diamond', 'far fa-gem'),
('fa fa-digg', 'fab fa-digg'),
('fa fa-dollar', 'fas fa-dollar-sign'),
('fa fa-dot-circle-o', 'far fa-dot-circle'),
('fa fa-dribbble', 'fab fa-dribbble'),
('fa fa-drivers-license-o', 'far fa-id-card'),
('fa fa-drivers-license', 'fas fa-id-card'),
('fa fa-dropbox', 'fab fa-dropbox'),
('fa fa-drupal', 'fab fa-drupal'),
('fa fa-edge', 'fab fa-edge'),
('fa fa-eercast', 'fab fa-sellcast'),
('fa fa-empire', 'fab fa-empire'),
('fa fa-envelope-open-o', 'far fa-envelope-open'),
('fa fa-envelope-o', 'far fa-envelope'),
('fa fa-envira', 'fab fa-envira'),
('fa fa-etsy', 'fab fa-etsy'),
('fa fa-euro', 'fas fa-euro-sign'),
('fa fa-eur', 'fas fa-euro-sign'),
('fa fa-exchange', 'fas fa-exchange-alt'),
('fa fa-expeditedssl', 'fab fa-expeditedssl'),
('fa fa-external-link-square', 'fas fa-external-link-square-alt'),
('fa fa-external-link', 'fas fa-external-link-alt'),
('fa fa-eye-slash', 'far fa-eye-slash'),
('fa fa-eyedropper', 'fas fa-eye-dropper'),
('fa fa-eye', 'far fa-eye'),
('fa fa-facebook-f', 'fab fa-facebook-f'),
('fa fa-facebook-official', 'fab fa-facebook'),
('fa fa-facebook-square', 'fab fa-facebook-square'),
('fa fa-facebook', 'fab fa-facebook-f'),
('fa fa-feed', 'fas fa-rss'),
('fa fa-file-archive-o', 'far fa-file-archive'),
('fa fa-file-audio-o', 'far fa-file-audio'),
('fa fa-file-code-o', 'far fa-file-code'),
('fa fa-file-excel-o', 'far fa-file-excel'),
('fa fa-file-image-o', 'far fa-file-image'),
('fa fa-file-movie-o', 'far fa-file-video'),
('fa fa-file-o', 'far fa-file'),
('fa fa-file-pdf-o', 'far fa-file-pdf'),
('fa fa-file-photo-o', 'far fa-file-image'),
('fa fa-file-picture-o', 'far fa-file-image'),
('fa fa-file-powerpoint-o', 'far fa-file-powerpoint'),
('fa fa-file-sound-o', 'far fa-file-audio'),
('fa fa-file-text-o', 'far fa-file-alt'),
('fa fa-file-text', 'fas fa-file-alt'),
('fa fa-file-video-o', 'far fa-file-video'),
('fa fa-file-word-o', 'far fa-file-word'),
('fa fa-file-zip-o', 'far fa-file-archive'),
('fa fa-files-o', 'far fa-copy'),
('fa fa-firefox', 'fab fa-firefox'),
('fa fa-first-order', 'fab fa-first-order'),
('fa fa-flag-o', 'far fa-flag'),
('fa fa-flash', 'fas fa-bolt'),
('fa fa-flickr', 'fab fa-flickr'),
('fa fa-floppy-o', 'far fa-save'),
('fa fa-folder-o', 'far fa-folder'),
('fa fa-folder-open-o', 'far fa-folder-open'),
('fa fa-font-awesome', 'fab fa-font-awesome'),
('fa fa-fonticons', 'fab fa-fonticons'),
('fa fa-fort-awesome', 'fab fa-fort-awesome'),
('fa fa-forumbee', 'fab fa-forumbee'),
('fa fa-foursquare', 'fab fa-foursquare'),
('fa fa-free-code-camp', 'fab fa-free-code-camp'),
('fa fa-frown-o', 'far fa-frown'),
('fa fa-futbol-o', 'far fa-futbol'),
('fa fa-gbp', 'fas fa-pound-sign'),
('fa fa-gears', 'fas fa-cogs'),
('fa fa-gear', 'fas fa-cog'),
('fa fa-get-pocket', 'fab fa-get-pocket'),
('fa fa-ge', 'fab fa-empire'),
('fa fa-gg-circle', 'fab fa-gg-circle'),
('fa fa-gg', 'fab fa-gg'),
('fa fa-git-square', 'fab fa-git-square'),
('fa fa-github-alt', 'fab fa-github-alt'),
('fa fa-github-square', 'fab fa-github-square'),
('fa fa-github', 'fab fa-github'),
('fa fa-gitlab', 'fab fa-gitlab'),
('fa fa-gittip', 'fab fa-gratipay'),
('fa fa-git', 'fab fa-git'),
('fa fa-glass', 'fas fa-glass-martini'),
('fa fa-glide-g', 'fab fa-glide-g'),
('fa fa-glide', 'fab fa-glide'),
('fa fa-google-plus-circle', 'fab fa-google-plus'),
('fa fa-google-plus-official', 'fab fa-google-plus'),
('fa fa-google-plus-square', 'fab fa-google-plus-square'),
('fa fa-google-plus', 'fab fa-google-plus-g'),
('fa fa-google-wallet', 'fab fa-google-wallet'),
('fa fa-google', 'fab fa-google'),
('fa fa-gratipay', 'fab fa-gratipay'),
('fa fa-grav', 'fab fa-grav'),
('fa fa-group', 'fas fa-users'),
('fa fa-hacker-news', 'fab fa-hacker-news'),
('fa fa-hand-grab-o', 'far fa-hand-rock'),
('fa fa-hand-lizard-o', 'far fa-hand-lizard'),
('fa fa-hand-o-down', 'far fa-hand-point-down'),
('fa fa-hand-o-left', 'far fa-hand-point-left'),
('fa fa-hand-o-right', 'far fa-hand-point-right'),
('fa fa-hand-o-up', 'far fa-hand-point-up'),
('fa fa-hand-paper-o', 'far fa-hand-paper'),
('fa fa-hand-peace-o', 'far fa-hand-peace'),
('fa fa-hand-pointer-o', 'far fa-hand-pointer'),
('fa fa-hand-rock-o', 'far fa-hand-rock'),
('fa fa-hand-scissors-o', 'far fa-hand-scissors'),
('fa fa-hand-spock-o', 'far fa-hand-spock'),
('fa fa-hand-stop-o', 'far fa-hand-paper'),
('fa fa-handshake-o', 'far fa-handshake'),
('fa fa-hard-of-hearing', 'fas fa-deaf'),
('fa fa-hdd-o', 'far fa-hdd'),
('fa fa-header', 'fas fa-heading'),
('fa fa-heart-o', 'far fa-heart'),
('fa fa-hospital-o', 'far fa-hospital'),
('fa fa-hotel', 'fas fa-bed'),
('fa fa-hourglass-1', 'fas fa-hourglass-start'),
('fa fa-hourglass-2', 'fas fa-hourglass-half'),
('fa fa-hourglass-3', 'fas fa-hourglass-end'),
('fa fa-hourglass-o', 'far fa-hourglass'),
('fa fa-houzz', 'fab fa-houzz'),
('fa fa-html5', 'fab fa-html5'),
('fa fa-id-badge', 'far fa-id-badge'),
('fa fa-id-card-o', 'far fa-id-card'),
('fa fa-ils', 'fas fa-shekel-sign'),
('fa fa-image', 'far fa-image'),
('fa fa-imdb', 'fab fa-imdb'),
('fa fa-inr', 'fas fa-rupee-sign'),
('fa fa-instagram', 'fab fa-instagram'),
('fa fa-institution', 'fas fa-university'),
('fa fa-internet-explorer', 'fab fa-internet-explorer'),
('fa fa-intersex', 'fas fa-transgender'),
('fa fa-ioxhost', 'fab fa-ioxhost'),
('fa fa-joomla', 'fab fa-joomla'),
('fa fa-jpy', 'fas fa-yen-sign'),
('fa fa-jsfiddle', 'fab fa-jsfiddle'),
('fa fa-keyboard-o', 'far fa-keyboard'),
('fa fa-krw', 'fas fa-won-sign'),
('fa fa-lastfm-square', 'fab fa-lastfm-square'),
('fa fa-lastfm', 'fab fa-lastfm'),
('fa fa-leanpub', 'fab fa-leanpub'),
('fa fa-legal', 'fas fa-gavel'),
('fa fa-lemon-o', 'far fa-lemon'),
('fa fa-level-down', 'fas fa-level-down-alt'),
('fa fa-level-up', 'fas fa-level-up-alt'),
('fa fa-life-bouy', 'far fa-life-ring'),
('fa fa-life-buoy', 'far fa-life-ring'),
('fa fa-life-ring', 'far fa-life-ring'),
('fa fa-life-saver', 'far fa-life-ring'),
('fa fa-lightbulb-o', 'far fa-lightbulb'),
('fa fa-line-chart', 'fas fa-chart-line'),
('fa fa-linkedin-square', 'fab fa-linkedin'),
('fa fa-linkedin', 'fab fa-linkedin-in'),
('fa fa-linode', 'fab fa-linode'),
('fa fa-linux', 'fab fa-linux'),
('fa fa-list-alt', 'far fa-list-alt'),
('fa fa-long-arrow-down', 'fas fa-long-arrow-alt-down'),
('fa fa-long-arrow-left', 'fas fa-long-arrow-alt-left'),
('fa fa-long-arrow-right', 'fas fa-long-arrow-alt-right'),
('fa fa-long-arrow-up', 'fas fa-long-arrow-alt-up'),
('fa fa-mail-forward', 'fas fa-share'),
('fa fa-mail-reply-all', 'fas fa-reply-all'),
('fa fa-mail-reply', 'fas fa-reply'),
('fa fa-map-marker', 'fas fa-map-marker-alt'),
('fa fa-map-o', 'far fa-map'),
('fa fa-maxcdn', 'fab fa-maxcdn'),
('fa fa-meanpath', 'fab fa-font-awesome'),
('fa fa-medium', 'fab fa-medium'),
('fa fa-meetup', 'fab fa-meetup'),
('fa fa-meh-o', 'far fa-meh'),
('fa fa-minus-square-o', 'far fa-minus-square'),
('fa fa-mixcloud', 'fab fa-mixcloud'),
('fa fa-mobile-phone', 'fas fa-mobile-alt'),
('fa fa-mobile', 'fas fa-mobile-alt'),
('fa fa-modx', 'fab fa-modx'),
('fa fa-moon-o', 'far fa-moon'),
('fa fa-money', 'far fa-money-bill-alt'),
('fa fa-mortar-board', 'fas fa-graduation-cap'),
('fa fa-navicon', 'fas fa-bars'),
('fa fa-newspaper-o', 'far fa-newspaper'),
('fa fa-object-group', 'far fa-object-group'),
('fa fa-object-ungroup', 'far fa-object-ungroup'),
('fa fa-odnoklassniki-square', 'fab fa-odnoklassniki-square'),
('fa fa-odnoklassniki', 'fab fa-odnoklassniki'),
('fa fa-opencart', 'fab fa-opencart'),
('fa fa-openid', 'fab fa-openid'),
('fa fa-opera', 'fab fa-opera'),
('fa fa-optin-monster', 'fab fa-optin-monster'),
('fa fa-pagelines', 'fab fa-pagelines'),
('fa fa-paper-plane-o', 'far fa-paper-plane'),
('fa fa-paste', 'far fa-clipboard'),
('fa fa-pause-circle-o', 'far fa-pause-circle'),
('fa fa-paypal', 'fab fa-paypal'),
('fa fa-pencil-square', 'fas fa-pen-square'),
('fa fa-pencil-square-o', 'far fa-edit'),
('fa fa-pencil', 'fas fa-pencil-alt'),
('fa fa-photo', 'far fa-image'),
('fa fa-picture-o', 'far fa-image'),
('fa fa-pie-chart', 'fas fa-chart-pie'),
('fa fa-pied-piper-alt', 'fab fa-pied-piper-alt'),
('fa fa-pied-piper-pp', 'fab fa-pied-piper-pp'),
('fa fa-pied-piper', 'fab fa-pied-piper'),
('fa fa-pinterest-p', 'fab fa-pinterest-p'),
('fa fa-pinterest-square', 'fab fa-pinterest-square'),
('fa fa-pinterest', 'fab fa-pinterest'),
('fa fa-play-circle-o', 'far fa-play-circle'),
('fa fa-plus-square-o', 'far fa-plus-square'),
('fa fa-product-hunt', 'fab fa-product-hunt'),
('fa fa-qq', 'fab fa-qq'),
('fa fa-question-circle-o', 'far fa-question-circle'),
('fa fa-quora', 'fab fa-quora'),
('fa fa-ravelry', 'fab fa-ravelry'),
('fa fa-ra', 'fab fa-rebel'),
('fa fa-rebel', 'fab fa-rebel'),
('fa fa-reddit-alien', 'fab fa-reddit-alien'),
('fa fa-reddit-square', 'fab fa-reddit-square'),
('fa fa-reddit', 'fab fa-reddit'),
('fa fa-refresh', 'fas fa-sync'),
('fa fa-registered', 'far fa-registered'),
('fa fa-remove', 'fas fa-times'),
('fa fa-renren', 'fab fa-renren'),
('fa fa-reorder', 'fas fa-bars'),
('fa fa-repeat', 'fas fa-redo'),
('fa fa-resistance', 'fab fa-rebel'),
('fa fa-rmb', 'fas fa-yen-sign'),
('fa fa-rotate-left', 'fas fa-undo'),
('fa fa-rotate-right', 'fas fa-redo'),
('fa fa-rouble', 'fas fa-ruble-sign'),
('fa fa-ruble', 'fas fa-ruble-sign'),
('fa fa-rub', 'fas fa-ruble-sign'),
('fa fa-rupee', 'fas fa-rupee-sign'),
('fa fa-s15', 'fas fa-bath'),
('fa fa-safari', 'fab fa-safari'),
('fa fa-scissors', 'fas fa-cut'),
('fa fa-scribd', 'fab fa-scribd'),
('fa fa-sellsy', 'fab fa-sellsy'),
('fa fa-send-o', 'far fa-paper-plane'),
('fa fa-send', 'fas fa-paper-plane'),
('fa fa-share-square-o', 'far fa-share-square'),
('fa fa-shekel', 'fas fa-shekel-sign'),
('fa fa-sheqel', 'fas fa-shekel-sign'),
('fa fa-shield', 'fas fa-shield-alt'),
('fa fa-shirtsinbulk', 'fab fa-shirtsinbulk'),
('fa fa-sign-in', 'fas fa-sign-in-alt'),
('fa fa-sign-out', 'fas fa-sign-out-alt'),
('fa fa-signing', 'fas fa-sign-language'),
('fa fa-simplybuilt', 'fab fa-simplybuilt'),
('fa fa-skyatlas', 'fab fa-skyatlas'),
('fa fa-skype', 'fab fa-skype'),
('fa fa-slack', 'fab fa-slack'),
('fa fa-sliders', 'fas fa-sliders-h'),
('fa fa-slideshare', 'fab fa-slideshare'),
('fa fa-smile-o', 'far fa-smile'),
('fa fa-snapchat-ghost', 'fab fa-snapchat-ghost'),
('fa fa-snapchat-square', 'fab fa-snapchat-square'),
('fa fa-snapchat', 'fab fa-snapchat'),
('fa fa-snowflake-o', 'far fa-snowflake'),
('fa fa-soccer-ball-o', 'far fa-futbol'),
('fa fa-sort-alpha-asc', 'fas fa-sort-alpha-down'),
('fa fa-sort-alpha-desc', 'fas fa-sort-alpha-up'),
('fa fa-sort-amount-asc', 'fas fa-sort-amount-down'),
('fa fa-sort-amount-desc', 'fas fa-sort-amount-up'),
('fa fa-sort-asc', 'fas fa-sort-up'),
('fa fa-sort-desc', 'fas fa-sort-down'),
('fa fa-sort-numeric-asc', 'fas fa-sort-numeric-down'),
('fa fa-sort-numeric-desc', 'fas fa-sort-numeric-up'),
('fa fa-soundcloud', 'fab fa-soundcloud'),
('fa fa-spoon', 'fas fa-utensil-spoon'),
('fa fa-spotify', 'fab fa-spotify'),
('fa fa-square-o', 'far fa-square'),
('fa fa-stack-exchange', 'fab fa-stack-exchange'),
('fa fa-stack-overflow', 'fab fa-stack-overflow'),
('fa fa-star-half-empty', 'far fa-star-half'),
('fa fa-star-half-full', 'far fa-star-half'),
('fa fa-star-half-o', 'far fa-star-half'),
('fa fa-star-o', 'far fa-star'),
('fa fa-steam-square', 'fab fa-steam-square'),
('fa fa-steam', 'fab fa-steam'),
('fa fa-sticky-note-o', 'far fa-sticky-note'),
('fa fa-stop-circle-o', 'far fa-stop-circle'),
('fa fa-stumbleupon-circle', 'fab fa-stumbleupon-circle'),
('fa fa-stumbleupon', 'fab fa-stumbleupon'),
('fa fa-sun-o', 'far fa-sun'),
('fa fa-superpowers', 'fab fa-superpowers'),
('fa fa-support', 'far fa-life-ring'),
('fa fa-tablet', 'fas fa-tablet-alt'),
('fa fa-tachometer', 'fas fa-tachometer-alt'),
('fa fa-telegram', 'fab fa-telegram'),
('fa fa-television', 'fas fa-tv'),
('fa fa-tencent-weibo', 'fab fa-tencent-weibo'),
('fa fa-themeisle', 'fab fa-themeisle'),
('fa fa-thermometer-0', 'fas fa-thermometer-empty'),
('fa fa-thermometer-1', 'fas fa-thermometer-quarter'),
('fa fa-thermometer-2', 'fas fa-thermometer-half'),
('fa fa-thermometer-3', 'fas fa-thermometer-three-quarters'),
('fa fa-thermometer-4', 'fas fa-thermometer-full'),
('fa fa-thermometer', 'fas fa-thermometer-full'),
('fa fa-thumb-tack', 'fas fa-thumbtack'),
('fa fa-thumbs-o-down', 'far fa-thumbs-down'),
('fa fa-thumbs-o-up', 'far fa-thumbs-up'),
('fa fa-ticket', 'fas fa-ticket-alt'),
('fa fa-times-circle-o', 'far fa-times-circle'),
('fa fa-times-rectangle-o', 'far fa-window-close'),
('fa fa-times-rectangle', 'fas fa-window-close'),
('fa fa-toggle-down', 'far fa-caret-square-down'),
('fa fa-toggle-left', 'far fa-caret-square-left'),
('fa fa-toggle-right', 'far fa-caret-square-right'),
('fa fa-toggle-up', 'far fa-caret-square-up'),
('fa fa-trash-o', 'far fa-trash-alt'),
('fa fa-trash', 'fas fa-trash-alt'),
('fa fa-trello', 'fab fa-trello'),
('fa fa-tripadvisor', 'fab fa-tripadvisor'),
('fa fa-try', 'fas fa-lira-sign'),
('fa fa-tumblr-square', 'fab fa-tumblr-square'),
('fa fa-tumblr', 'fab fa-tumblr'),
('fa fa-turkish-lira', 'fas fa-lira-sign'),
('fa fa-twitch', 'fab fa-twitch'),
('fa fa-twitter-square', 'fab fa-twitter-square'),
('fa fa-twitter', 'fab fa-twitter'),
('fa fa-unsorted', 'fas fa-sort'),
('fa fa-usb', 'fab fa-usb'),
('fa fa-usd', 'fas fa-dollar-sign'),
('fa fa-user-circle-o', 'far fa-user-circle'),
('fa fa-user-o', 'far fa-user'),
('fa fa-vcard-o', 'far fa-address-card'),
('fa fa-vcard', 'fas fa-address-card'),
('fa fa-viacoin', 'fab fa-viacoin'),
('fa fa-viadeo-square', 'fab fa-viadeo-square'),
('fa fa-viadeo', 'fab fa-viadeo'),
('fa fa-video-camera', 'fas fa-video'),
('fa fa-vimeo-square', 'fab fa-vimeo-square'),
('fa fa-vimeo', 'fab fa-vimeo-v'),
('fa fa-vine', 'fab fa-vine'),
('fa fa-vk', 'fab fa-vk'),
('fa fa-volume-control-phone', 'fas fa-phone-volume'),
('fa fa-warning', 'fas fa-exclamation-triangle'),
('fa fa-wechat', 'fab fa-weixin'),
('fa fa-weibo', 'fab fa-weibo'),
('fa fa-weixin', 'fab fa-weixin'),
('fa fa-whatsapp', 'fab fa-whatsapp'),
('fa fa-wheelchair-alt', 'fab fa-accessible-icon'),
('fa fa-wikipedia-w', 'fab fa-wikipedia-w'),
('fa fa-window-close-o', 'far fa-window-close'),
('fa fa-window-maximize', 'far fa-window-maximize'),
('fa fa-window-restore', 'far fa-window-restore'),
('fa fa-windows', 'fab fa-windows'),
('fa fa-won', 'fas fa-won-sign'),
('fa fa-wordpress', 'fab fa-wordpress'),
('fa fa-wpbeginner', 'fab fa-wpbeginner'),
('fa fa-wpexplorer', 'fab fa-wpexplorer'),
('fa fa-wpforms', 'fab fa-wpforms'),
('fa fa-xing-square', 'fab fa-xing-square'),
('fa fa-xing', 'fab fa-xing'),
('fa fa-y-combinator-square', 'fab fa-hacker-news'),
('fa fa-y-combinator', 'fab fa-y-combinator'),
('fa fa-yahoo', 'fab fa-yahoo'),
('fa fa-yc', 'fab fa-y-combinator'),
('fa fa-yc-square', 'fab fa-hacker-news'),
('fa fa-yelp', 'fab fa-yelp'),
('fa fa-yen', 'fas fa-yen-sign'),
('fa fa-yoast', 'fab fa-yoast'),
('fa fa-youtube-play', 'fab fa-youtube'),
('fa fa-youtube-square', 'fab fa-youtube-square'),
('fa fa-youtube', 'fab fa-youtube'),
('fa fa-fa', 'fab fa-font-awesome'),
('fa fa-lock', 'fas fa-lock'),
('fa fa-envelope', 'fas fa-envelope'),
('fa fa-times', 'fas fa-times'),
('fa fa-edit', 'far fa-edit'),
('fa fa-check', 'far fa-check'),
('fa fa-home', 'fas fa-home'),
('fa fa-info-circle', 'fas fa-info-circle'),
('fa fa-users', 'fas fa-users'),
('fa fa-check-circle', 'fas fa-check-circle'),
('fa fa-file', 'fas fa-file'),
('fa fa-cogs', 'fas fa-cogs'),
('fa fa-cog', 'fas fa-cog'),
('fa fa-arrow-left', 'fas fa-arrow-left'),
('fa fa-arrow-right', 'fas fa-arrow-right'),
('fa fa-chevron-left', 'fas fa-chevron-left'),
('fa fa-chevron-right', 'fas fa-chevron-right'),
('fa fa-unlock-alt', 'fas fa-unlock'),
('fa fa-times-circle', 'fas fa-times-circle'),
('fa fa-bell', 'fas fa-bell'),
('fa fa-plus', 'fas fa-plus'),
('fa fa-download', 'fas fa-download'),
('fa fa-desktop', 'fas fa-desktop'),
('fa fa-mouse-pointer', 'fas fa-mouse-pointer'),
('fa fa-history', 'fas fa-history'),
('fa fa-question', 'fas fa-question'),
('fa fa-link', 'fas fa-link'),
('fa fa-globe', 'fas fa-globe'),
('fa fa-plus-circle', 'fas fa-plus-circle'),
('fa fa-database', 'fas fa-database'),
('fa fa-upload', 'fas fa-upload'),
('fa fa-info', 'fas fa-info'),
('fa fa-paper-plane', 'fas fa-paper-plane'),
('fa fa-question-circle', 'fas fa-question-circle'),
('fa fa-envelope', 'fas fa-envelope'),
('fa fa-asterisk', 'fas fa-asterisk'),
('fa fa-exclamation-triangle', 'fas fa-exclamation-triangle'),
('fa fa-comments', 'fas fa-comments'),
('fa fa-wrench', 'fas fa-wrench'),
('fa fa-reply', 'fas fa-reply'),
('fa fa-table', 'fas fa-table'),
('fa fa-eraser', 'fas fa-eraser'),
]
def upgrade(project_path, extensions, exclude_directories):
for dname, dirs, files in os.walk(project_path):
dirs[:] = [d for d in dirs if d not in exclude_directories]
for fname in files:
if(fname.lower().endswith(extensions)):
fpath = os.path.join(dname, fname)
print (fpath)
s = open(fpath).read()
for icon in findreplace:
s = s.replace(icon[0]+'"', icon[1]+'"')
s = s.replace(icon[0]+"'", icon[1]+"'")
s = s.replace(icon[0]+" ", icon[1]+" ")
# s = s.replace(icon[0], icon[1])
f = open(fpath, "w")
f.write(s)
print ("\nAbove files have been modified")
project_path = os.getcwd()
extensions = ('.php', '.tpl')
exclude_directories = set(['node_modules','test'])
upgrade(project_path, extensions, exclude_directories)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment